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-elementcommand 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 onecreate-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 oneadd-building, the same command as the plan editor. It resolves with the id of the new mass, which is selected, or withundefinedafter Escape or a refused outline.cancelMassDrawing()stops it.
Constructor
Properties
Read-only. The target whose grips are on, or undefined when the grips go.
Read-only. In
select mode: a click, with the target under the pointer. See PickMode.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.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) => {…}.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) => {…}.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.Methods
addControls
getEditAnchors() contract.
clearSelection
selectedPart
armFreeOpeningRehost
setDimensionFormat
setManagedEdits
startWallDrawing
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
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
startMassDrawing; it resolves undefined.
cancelWallDrawing
startWallDrawing without saving it.
setTool
enablePicking
setPickMode
setHighlighted
select mode, the selection it keeps from onPick.
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.
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.
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.ScenePick
A click ofselect mode.
GestureEnd
How a gesture of an editor ended:commit saved a step, cancel saved nothing.
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.
ManagedSceneEditDeps
The scene projects saved points; the project owner commits their edits.SceneWallDrawingTemplate
The settings of a wall that the 3D wall draft saves: acreate-wall wall without its axis.
The package does not export this type by name.
SceneMassDrawingOptions
The new building ofGUIEditor.startMassDrawing, and how its outline is drawn.
The package does not export this type by name.
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.Model-space endpoints, using the same frame as the target’s anchors.
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.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.ManagedSizeTransaction
One saved size change; acentred drag moves the opposite side as well.
The package does not export this type by name.