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.
  • dispose() removes the overlay and its listeners.

Constructor

Properties

Event<EditableTarget | undefined>
Read-only.
(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 or for the drags of a door or window, nor when a drag ends without a save (Escape, a release next to the press, or a refusal that the error callback reports): the target is put back without a call. The saved edit reports once through onChange. Optional; assign it directly: editor.onDrag = (change) =&gt; &#123;…&#125;.
boolean
Read-only. Whether the next scene click will attempt a saved free-opening attachment.

Methods

addControls

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

clearSelection

armFreeOpeningRehost

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

setManagedEdits

Use saved building commands for scene grips and keyboard history.

setTool

enablePicking

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.

EditorChange

Emitted after every write-back, via GUIEditor.onChange or createModelRenderer().onChange.
EditorChangeKind
required
EditableTarget
required
string
The EditAnchor id, for kind: 'anchor' only.
string
The edited element’s id, where the surface knows it — the 2D plan view always does, because it resolved the element from a picked ogid in the first place. This is what lets a host write the edit back to its own store without searching for which element changed. EditableTarget is a bare THREE.Object3D and carries no id of its own.
string[]
The elements whose built objects the step changed. ogid and target name the element of the last command of the step whose element changed.

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.

ProfileTopology

EditorChangeKind

Which channel of the target an edit wrote to.

ManagedModelObjectEdits

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

ManagedOpeningRehostTransaction

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.

ManagedTransformTransaction

One saved transform; previewing the overlay does not write an edit. 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.

TransformPosition

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

ModelObjectPresentation

The package does not export this type by name.
Last modified on October 13, 2026