Skip to content

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

ComponentDefinition

Shared geometry that groups and component instances place in the model.

readonly entities: Entities

The definition’s own entities, in definition-local coordinates.


readonly entityId: number

Identifier that stays the same for the entity’s lifetime, including across undo and redo.

Entity.entityId


facingCamera: boolean

Whether views turn each instance about its own blue (Z) axis, through its origin, so its -Y side faces the camera, like a cardboard scale figure. Only component instances turn; the stored transformations never change. Assign inside Model.operation.


readonly isDeleted: boolean

Whether the entity was deleted, for example by an edit or by undo.

Entity.isDeleted


readonly isValid: boolean

Whether the entity still exists in the model.

Entity.isValid


name: string

Definition name, shared by all its instances; assign inside Model.operation.


readonly type: "ComponentDefinition"

The concrete class name, for narrowing unions such as AnyElement.

Entity.type

toJSON(): object

JSON.stringify writes the entity as its type and entityId, plus its name when it has one, such as { "type": "Group", "entityId": 12, "name": "Wheel" }.

object

entityId: number

optional name?: string

type: "Material" | "Vertex" | "Edge" | "Face" | "Loop" | "EdgeUse" | "Curve" | "ArcCurve" | "ComponentDefinition" | "ComponentInstance" | "Group" | "Layer" | "Guide" | "Text" | "LinearDimension" | "SectionPlane"

Entity.toJSON