Skip to content

Vibe coding a plugin? 😎 Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

ToolView

What a tool’s draw function draws its preview with.

image(image, corners, style?): void

An image stretched over four corners: its top left, top right, bottom right and bottom left. In model coordinates the image bends with the perspective; with screen: true the corners are screen pixels, as for a photo to match the model to. Images draw over the model and the other shapes, at opacity from 0 to 1.

PluginImage

readonly [Point3dLike | readonly [number, number], Point3dLike | readonly [number, number], Point3dLike | readonly [number, number], Point3dLike | readonly [number, number]]

number

boolean

void

// Shows a photo over the top left of the viewport, half see-through.
const photo = context.loadImage("site.jpg");
context.addOverlay((view) => {
const [w, h] = [photo.width / 4, photo.height / 4];
view.image(photo, [[20, 60], [20 + w, 60], [20 + w, 60 + h], [20, 60 + h]], { screen: true, opacity: 0.5 });
});

lines(points, style?): void

Separate segments, one from each pair of points.

Iterable<Point3dLike | readonly [number, number]>

PreviewStyle

void


points(points, style?): void

Iterable<Point3dLike | readonly [number, number]>

PreviewStyle

void


polygon(points, style?): void

A filled convex polygon.

Iterable<Point3dLike | readonly [number, number]>

PreviewStyle

void


polyline(points, style?): void

Iterable<Point3dLike | readonly [number, number]>

PreviewStyle

void


text(position, text, style?): void

Text at a point, or at screen pixels.

Point3dLike | readonly [number, number]

unknown

PreviewStyle

void