Skip to main content
It draws handles above your Three.js view and lets the user select, move and reshape elements.

Import

Example

Notes

  • The editor does not own your renderer or your camera.
  • Call update() in each frame.
  • To keep the edits in a building model, connect the editor with bindManagedSceneEditor.
  • A placed catalog block with a width or depth size rule has grips on the corresponding sides. Drag along that axis to choose the nearest offered size while keeping the opposite side fixed. Hold Alt to keep the center fixed. The box and size label preview the edit. Releasing saves one replace-element command and rebuilds the block once. Undo restores the old size and placement.
  • dispose() removes the overlay and its listeners.
  • startWallDrawing(storeyId, wall) draws a saved wall on the floor of a storey of a managed scene, with the keys of the plan wall tool. It saves one create-wall, the same command as the plan editor. cancelWallDrawing() stops it.
  • startMassDrawing(options) draws the outline of a new mass on the ground of a managed scene and saves one add-building, the same command as the plan editor. It resolves with the id of the new mass, which is selected, or with undefined after Escape or a refused outline. cancelMassDrawing() stops it.

Constructor

Properties

Event<EditableTarget | undefined>
Read-only. The target whose grips are on, or undefined when the grips go.
Event<ScenePick>
Read-only. In select mode: a click, with the target under the pointer. See PickMode.
Event<EditableTarget | undefined>
Read-only. In select mode: the target under the pointer changed, while no button is down — picked by its surfaces, not by its edge lines. Undefined when the pointer is over empty space, over the grips, out of the container, or a drawing tool runs. At most once per animation frame.
(change: EditorChange) => void
Called after every edit reaches the target, for hosts that need to react (mark a document dirty, push an undo entry, re-run a schedule). Optional and unset by default; assign it directly — editor.onChange = (change) =&gt; &#123;…&#125;.
(change: EditorChange) => void
Called with the live target, before anything is saved, so that a host can show live numbers (the floor area of a mass) while a grip is used. It fires on every live write of a profile, push/pull, radius or anchor grip, with the kind profile, extrudeHeight, radius or anchor: each pointer move of a drag, and also the typed push/pull value, an edge-midpoint insert and a vertex delete. It fires on each preview frame of the move and turn grips, with the kind move or rotate, but not on their release. It does not fire for the end and body drags of a saved wall, the drags of a door or window, or a block size grip. If a drag ends without saving (Escape, a release next to the press, or a refusal that the error callback reports), the editor restores the target without a call. The saved edit reports once through onChange. Optional; assign it directly: editor.onDrag = (change) =&gt; &#123;…&#125;.
(end: GestureEnd) => void
Called once per press of a grip or of a body (a grip drag, a push/pull, a move or a turn), after the press ends, moved or not. kind is commit after its step is saved, and cancel when it saved nothing: a press with no move, Escape, a pointer cancel, a lost pointer capture, a refused or failed save. While a press is open, a draw from the bound session refuses with live-edit-open; in this callback a draw works and shows the saved model. Optional; assign it directly.
boolean
Read-only. Whether the next scene click will attempt a saved free-opening attachment.
PickMode
Read-only. How a click in the scene picks; edit until it is set. See PickMode.
EditableTarget | undefined
Read-only. The target whose grips are on, if any.
EditableTarget | undefined
Read-only. The target under the pointer, as the last hover found it.

Methods

addControls

Attach editing handles to a polygon, rectangle, line, cuboid, element, cylinder, or any target exposing the generic getEditAnchors() contract.

clearSelection

selectedPart

armFreeOpeningRehost

Wait for a deliberate wall mesh click to attach the selected saved free opening.

setDimensionFormat

Set units and precision for editable measurements; model coordinates remain metres.

setManagedEdits

Use saved building commands for scene grips and keyboard history.

startWallDrawing

Draw a saved wall on the floor plane of storey storeyId of a managed scene, with the settings wall. Throws: Error when the scene is not managed or cannot draw walls on that storey.

setWallDrawingMode

startRailingDrawing

startMassDrawing

Let the user draw the outline of a new building with one mass on the ground of a managed scene, then save it as one add-building (the command and the options of ManagedPlanEditor.startMassDrawing) and resolve with the id of the new mass, which is selected with its grips. Throws: Error when the scene is not managed, or BmEditError when the options are bad.

cancelMassDrawing

Stop the outline draft of startMassDrawing; it resolves undefined.

cancelWallDrawing

Stop the saved wall draft of startWallDrawing without saving it.

setTool

enablePicking

setPickMode

Choose how a click in the scene picks.

setHighlighted

Name the targets the host shows as selected — in select mode, the selection it keeps from onPick.

update

Public hook for hosts that prefer to drive the overlay from their own loop.

dispose

Stop the editor: cancel the loop, remove the overlay and listeners.

Types

EditableTarget

Structural contract the editor needs from any target: a THREE.Object3D that exposes an editable .profile ring (the edit channel) and an ogType discriminator.
string
required
Profile
Editable outer ring + holes. Absent for circle targets (cylinder).
number
number
Local Y of the plane that the profile and the push/pull grip sit on, when it is not the bottom of the object: an upper part of a stacked mass sits on the parts below it.
string
A target made of parts: the id of the part that the grips edit, the one selectPart chose. An editor reads it when it builds its grips and sets it again when one of its gestures begins, so that two editors on one target each edit the part whose grips they drag.
ProfileTopology
number
Present (with no profile) => a circle target: push/pull + radius handle only.

ScenePick

A click of select mode.
EditableTarget | undefined
required
The target under the pointer; undefined over empty space.
boolean
required
Shift, Ctrl or Cmd was down: add the target to the selection, or take it out.

GestureEnd

How a gesture of an editor ended: commit saved a step, cancel saved nothing.

CameraControlsLike

Anything with a toggleable enabled flag — both three.js OrbitControls and the camera-controls library used by Floorkit/PlanCamera satisfy this, so the editor stays renderer-agnostic.

ManagedSceneEditDeps

The scene projects saved points; the project owner commits their edits.

SceneWallDrawingTemplate

The settings of a wall that the 3D wall draft saves: a create-wall wall without its axis. The package does not export this type by name.

SceneMassDrawingOptions

The new building of GUIEditor.startMassDrawing, and how its outline is drawn. The package does not export this type by name.
'free' | 'rectangle'
free (the default): a click per corner; rectangle: two clicks at opposite corners.

PickMode

How a click in the scene picks.

EditDimensionDescriptor

Optional measurement supplied by an editable target.
string
required
'length' | 'width' | 'height' | 'elevation' | 'radius' | 'angle'
required
number
required
[ number, number, number ]
required
Model-space endpoints, using the same frame as the target’s anchors.
[ number, number, number ]
required

ProfileTopology

ManagedModelObjectEdits

Editor callbacks; the project owner resolves planes and commits saved transactions. The package does not export this type by name.

WallJoint

The package does not export this type by name.

ManagedOpeningRehostTransaction

The package does not export this type by name.

ManagedWallEndTransaction

The saved move of a wall end; refusal gives what commit would throw, without saving. The package does not export this type by name.

ManagedWallBodyTransaction

The saved move of a wall body; refusal gives what commit would throw, without saving. The package does not export this type by name.

ManagedReshapeTransaction

The saved reshape of a managed outline; refusal gives what saving profile would throw. The package does not export this type by name.

SceneTransformTarget

Saved XZ placement and copied outline on the owning elevation plane. The package does not export this type by name.
boolean
Catalog placement, rather than a BIM element with its own geometric grips.
TransformPosition
required
number
required
number
number
readonly TransformPosition[]
required
readonly string[]
readonly ManagedSizeGrip[]
The sides of a block with a size rule that a drag can move.

ManagedTransformTransaction

One saved transform; previewing the overlay does not write an edit. The package does not export this type by name.

SavedDraft

The package does not export this type by name.

ManagedModelObjectView

Copied saved geometry and the actual world frame used to project its handles. The package does not export this type by name.

ModelObjectPreviewDraft

The package does not export this type by name.

JointEnd

The package does not export this type by name.

TransformPosition

Pure drawing-plane geometry for the managed transform preview. The package does not export this type by name.

ManagedSizeGrip

A grip on one side of a block that comes in other sizes. The package does not export this type by name.
string
required
One per grip of the block, such as width-high.
string
required
Position
required
The outward unit direction of the side in the drawing.

ManagedSizeTransaction

One saved size change; a centred drag moves the opposite side as well. The package does not export this type by name.

ModelObjectPresentation

The package does not export this type by name.

Position

The package does not export this type by name.
Last modified on December 1, 2026