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) => {…}.(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) => {…}.boolean
Read-only. Whether the next scene click will attempt a saved free-opening attachment.
Methods
addControls
getEditAnchors() contract.
clearSelection
armFreeOpeningRehost
setManagedEdits
setTool
enablePicking
update
dispose
Types
EditableTarget
Structural contract the editor needs from any target: aTHREE.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, viaGUIEditor.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 toggleableenabled flag — both three.js OrbitControls and the camera-controls library used by Floorkit/PlanCamera satisfy this, so the editor stays renderer-agnostic.