@pascal-app/nodes 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block/definition.d.ts.map +1 -1
- package/dist/block/definition.js +4 -1
- package/dist/block/face-host.d.ts.map +1 -1
- package/dist/block/face-host.js +19 -2
- package/dist/block/hosted-edit.d.ts +13 -0
- package/dist/block/hosted-edit.d.ts.map +1 -0
- package/dist/block/hosted-edit.js +205 -0
- package/dist/block/last-operation.d.ts +1 -1
- package/dist/block/last-operation.d.ts.map +1 -1
- package/dist/block/last-operation.js +6 -4
- package/dist/block/modal-session.d.ts +2 -1
- package/dist/block/modal-session.d.ts.map +1 -1
- package/dist/block/modal-session.js +2 -2
- package/dist/block/selection.d.ts.map +1 -1
- package/dist/block/selection.js +82 -24
- package/dist/block/surface.d.ts +4 -0
- package/dist/block/surface.d.ts.map +1 -0
- package/dist/block/surface.js +54 -0
- package/dist/block/use-block-face-operation.d.ts +2 -2
- package/dist/block/use-block-face-operation.d.ts.map +1 -1
- package/dist/block/use-block-face-operation.js +25 -11
- package/dist/box-vent/definition.d.ts.map +1 -1
- package/dist/box-vent/definition.js +1 -0
- package/dist/building/renderer.d.ts.map +1 -1
- package/dist/building/renderer.js +1 -1
- package/dist/cabinet/definition.d.ts.map +1 -1
- package/dist/cabinet/definition.js +3 -1
- package/dist/cabinet/hosted-resize.d.ts +3 -6
- package/dist/cabinet/hosted-resize.d.ts.map +1 -1
- package/dist/cabinet/hosted-resize.js +9 -153
- package/dist/cabinet/placement-snap.d.ts.map +1 -1
- package/dist/cabinet/placement-snap.js +4 -2
- package/dist/cabinet/surfaces.d.ts +1 -0
- package/dist/cabinet/surfaces.d.ts.map +1 -1
- package/dist/cabinet/surfaces.js +13 -1
- package/dist/cabinet/tool.d.ts.map +1 -1
- package/dist/cabinet/tool.js +8 -4
- package/dist/ceiling/definition.d.ts.map +1 -1
- package/dist/ceiling/definition.js +5 -0
- package/dist/ceiling/renderer.d.ts.map +1 -1
- package/dist/ceiling/renderer.js +3 -2
- package/dist/chimney/definition.d.ts.map +1 -1
- package/dist/chimney/definition.js +1 -0
- package/dist/column/definition.d.ts.map +1 -1
- package/dist/column/definition.js +10 -3
- package/dist/column/floorplan-affordances.d.ts.map +1 -1
- package/dist/column/floorplan-affordances.js +6 -1
- package/dist/column/floorplan.d.ts.map +1 -1
- package/dist/column/floorplan.js +23 -11
- package/dist/column/hosted-resize.d.ts +116 -0
- package/dist/column/hosted-resize.d.ts.map +1 -0
- package/dist/column/hosted-resize.js +9 -0
- package/dist/column/panel.d.ts.map +1 -1
- package/dist/column/panel.js +6 -3
- package/dist/column/renderer.d.ts.map +1 -1
- package/dist/column/renderer.js +25 -103
- package/dist/column/shape.d.ts +22 -0
- package/dist/column/shape.d.ts.map +1 -0
- package/dist/column/shape.js +120 -0
- package/dist/column/surface.d.ts +4 -0
- package/dist/column/surface.d.ts.map +1 -0
- package/dist/column/surface.js +66 -0
- package/dist/cupola/definition.d.ts.map +1 -1
- package/dist/cupola/definition.js +1 -0
- package/dist/door/definition.d.ts.map +1 -1
- package/dist/door/definition.js +40 -1
- package/dist/door/door-math.d.ts +1 -1
- package/dist/door/door-math.d.ts.map +1 -1
- package/dist/door/door-math.js +7 -10
- package/dist/door/floorplan-affordances.d.ts.map +1 -1
- package/dist/door/floorplan-affordances.js +8 -12
- package/dist/door/move-tool.d.ts.map +1 -1
- package/dist/door/move-tool.js +3 -4
- package/dist/door/panel.d.ts.map +1 -1
- package/dist/door/panel.js +23 -52
- package/dist/door/tool.d.ts.map +1 -1
- package/dist/door/tool.js +20 -2
- package/dist/dormer/definition.d.ts.map +1 -1
- package/dist/dormer/definition.js +1 -0
- package/dist/downspout/definition.d.ts.map +1 -1
- package/dist/downspout/definition.js +1 -0
- package/dist/duct-segment/tool.d.ts.map +1 -1
- package/dist/duct-segment/tool.js +11 -0
- package/dist/duct-terminal/tool.d.ts.map +1 -1
- package/dist/duct-terminal/tool.js +77 -8
- package/dist/elevator/definition.d.ts.map +1 -1
- package/dist/elevator/definition.js +2 -0
- package/dist/elevator/parametrics.d.ts.map +1 -1
- package/dist/elevator/parametrics.js +98 -1
- package/dist/eyebrow-vent/definition.d.ts.map +1 -1
- package/dist/eyebrow-vent/definition.js +1 -0
- package/dist/fence/definition.d.ts.map +1 -1
- package/dist/fence/definition.js +1 -0
- package/dist/fence/tool.js +2 -2
- package/dist/guide/definition.d.ts.map +1 -1
- package/dist/guide/definition.js +1 -0
- package/dist/gutter/definition.d.ts.map +1 -1
- package/dist/gutter/definition.js +1 -0
- package/dist/hvac-equipment/tool.d.ts.map +1 -1
- package/dist/hvac-equipment/tool.js +8 -2
- package/dist/item/__fixtures__/main-floorplan.d.ts +26 -0
- package/dist/item/__fixtures__/main-floorplan.d.ts.map +1 -0
- package/dist/item/__fixtures__/main-floorplan.js +297 -0
- package/dist/item/definition.d.ts.map +1 -1
- package/dist/item/definition.js +3 -1
- package/dist/item/floorplan-move.d.ts.map +1 -1
- package/dist/item/floorplan-move.js +209 -130
- package/dist/item/floorplan.d.ts +22 -0
- package/dist/item/floorplan.d.ts.map +1 -1
- package/dist/item/floorplan.js +61 -2
- package/dist/item/move-tool.d.ts +1 -1
- package/dist/item/move-tool.d.ts.map +1 -1
- package/dist/item/move-tool.js +15 -7
- package/dist/item/renderer.d.ts.map +1 -1
- package/dist/item/renderer.js +8 -2
- package/dist/level/renderer.js +1 -1
- package/dist/lineset/tool.d.ts.map +1 -1
- package/dist/lineset/tool.js +1 -0
- package/dist/liquid-line/tool.d.ts.map +1 -1
- package/dist/liquid-line/tool.js +5 -1
- package/dist/measurement/definition.d.ts.map +1 -1
- package/dist/measurement/definition.js +1 -0
- package/dist/pipe-segment/tool.d.ts.map +1 -1
- package/dist/pipe-segment/tool.js +14 -3
- package/dist/pipe-trap/tool.d.ts.map +1 -1
- package/dist/pipe-trap/tool.js +7 -8
- package/dist/procedural-item/definition.d.ts.map +1 -1
- package/dist/procedural-item/definition.js +4 -1
- package/dist/ridge-vent/definition.d.ts.map +1 -1
- package/dist/ridge-vent/definition.js +1 -0
- package/dist/roof/definition.d.ts.map +1 -1
- package/dist/roof/definition.js +4 -1
- package/dist/roof/panel-model.d.ts +4 -0
- package/dist/roof/panel-model.d.ts.map +1 -0
- package/dist/roof/panel-model.js +151 -0
- package/dist/roof/panel.d.ts.map +1 -1
- package/dist/roof/panel.js +3 -4
- package/dist/roof/parametrics.d.ts.map +1 -1
- package/dist/roof/parametrics.js +16 -1
- package/dist/roof-segment/definition.d.ts.map +1 -1
- package/dist/roof-segment/definition.js +1 -0
- package/dist/roof-segment/parametrics.d.ts.map +1 -1
- package/dist/roof-segment/parametrics.js +176 -1
- package/dist/scan/definition.d.ts.map +1 -1
- package/dist/scan/definition.js +1 -0
- package/dist/shared/commit-opening-move.d.ts +4 -0
- package/dist/shared/commit-opening-move.d.ts.map +1 -0
- package/dist/shared/commit-opening-move.js +9 -0
- package/dist/shared/curtain-opening-limits.d.ts +14 -0
- package/dist/shared/curtain-opening-limits.d.ts.map +1 -0
- package/dist/shared/curtain-opening-limits.js +53 -0
- package/dist/shared/draft-axis-guides.d.ts +0 -6
- package/dist/shared/draft-axis-guides.d.ts.map +1 -1
- package/dist/shared/draft-axis-guides.js +1 -8
- package/dist/shared/hosted-resize.d.ts +12 -0
- package/dist/shared/hosted-resize.d.ts.map +1 -0
- package/dist/shared/hosted-resize.js +166 -0
- package/dist/shared/opening-grid-follow.d.ts +8 -0
- package/dist/shared/opening-grid-follow.d.ts.map +1 -0
- package/dist/shared/opening-grid-follow.js +12 -0
- package/dist/shared/opening-property-preview-host.d.ts +3 -0
- package/dist/shared/opening-property-preview-host.d.ts.map +1 -0
- package/dist/shared/opening-property-preview-host.js +21 -0
- package/dist/shared/opening-property-preview.d.ts +19 -0
- package/dist/shared/opening-property-preview.d.ts.map +1 -0
- package/dist/shared/opening-property-preview.js +99 -0
- package/dist/shared/resting-surface-plan.d.ts +2 -1
- package/dist/shared/resting-surface-plan.d.ts.map +1 -1
- package/dist/shared/resting-surface-plan.js +29 -4
- package/dist/shared/surface-counterparts.d.ts +12 -0
- package/dist/shared/surface-counterparts.d.ts.map +1 -0
- package/dist/shared/surface-counterparts.js +27 -0
- package/dist/shared/wall-attach-target.d.ts +1 -0
- package/dist/shared/wall-attach-target.d.ts.map +1 -1
- package/dist/shared/wall-attach-target.js +4 -1
- package/dist/shared/wall-event-from-grid.d.ts +5 -0
- package/dist/shared/wall-event-from-grid.d.ts.map +1 -0
- package/dist/shared/wall-event-from-grid.js +36 -0
- package/dist/shelf/definition.d.ts.map +1 -1
- package/dist/shelf/definition.js +3 -1
- package/dist/shelf/floorplan.d.ts.map +1 -1
- package/dist/shelf/floorplan.js +9 -2
- package/dist/site/renderer.d.ts.map +1 -1
- package/dist/site/renderer.js +9 -2
- package/dist/skylight/definition.d.ts.map +1 -1
- package/dist/skylight/definition.js +1 -0
- package/dist/slab/definition.d.ts.map +1 -1
- package/dist/slab/definition.js +4 -0
- package/dist/solar-panel/definition.d.ts.map +1 -1
- package/dist/solar-panel/definition.js +1 -0
- package/dist/spawn/definition.d.ts.map +1 -1
- package/dist/spawn/definition.js +1 -0
- package/dist/stair/definition.d.ts.map +1 -1
- package/dist/stair/definition.js +2 -0
- package/dist/stair/parametrics.d.ts.map +1 -1
- package/dist/stair/parametrics.js +164 -1
- package/dist/stair-segment/definition.d.ts.map +1 -1
- package/dist/stair-segment/definition.js +1 -0
- package/dist/stair-segment/parametrics.d.ts.map +1 -1
- package/dist/stair-segment/parametrics.js +81 -1
- package/dist/turbine-vent/definition.d.ts.map +1 -1
- package/dist/turbine-vent/definition.js +1 -0
- package/dist/wall/actions.d.ts +3 -0
- package/dist/wall/actions.d.ts.map +1 -0
- package/dist/wall/actions.js +56 -0
- package/dist/wall/curtain-opening-frame.d.ts +14 -0
- package/dist/wall/curtain-opening-frame.d.ts.map +1 -0
- package/dist/wall/curtain-opening-frame.js +111 -0
- package/dist/wall/curtain-panel-highlight.d.ts +3 -0
- package/dist/wall/curtain-panel-highlight.d.ts.map +1 -0
- package/dist/wall/curtain-panel-highlight.js +113 -0
- package/dist/wall/curtain-wall-adapter.d.ts +3 -0
- package/dist/wall/curtain-wall-adapter.d.ts.map +1 -0
- package/dist/wall/curtain-wall-adapter.js +55 -0
- package/dist/wall/curtain-wall-floorplan.d.ts +3 -0
- package/dist/wall/curtain-wall-floorplan.d.ts.map +1 -0
- package/dist/wall/curtain-wall-floorplan.js +91 -0
- package/dist/wall/curtain-wall-geometry.d.ts +4 -0
- package/dist/wall/curtain-wall-geometry.d.ts.map +1 -0
- package/dist/wall/curtain-wall-geometry.js +226 -0
- package/dist/wall/curtain-wall-layout.d.ts +16 -0
- package/dist/wall/curtain-wall-layout.d.ts.map +1 -0
- package/dist/wall/curtain-wall-layout.js +176 -0
- package/dist/wall/curtain-wall-materials.d.ts +5 -0
- package/dist/wall/curtain-wall-materials.d.ts.map +1 -0
- package/dist/wall/curtain-wall-materials.js +55 -0
- package/dist/wall/curtain-wall-panel.d.ts +14 -0
- package/dist/wall/curtain-wall-panel.d.ts.map +1 -0
- package/dist/wall/curtain-wall-panel.js +167 -0
- package/dist/wall/curtain-wall-piece-geometry.d.ts +5 -0
- package/dist/wall/curtain-wall-piece-geometry.d.ts.map +1 -0
- package/dist/wall/curtain-wall-piece-geometry.js +220 -0
- package/dist/wall/curtain-wall-shadow.d.ts +4 -0
- package/dist/wall/curtain-wall-shadow.d.ts.map +1 -0
- package/dist/wall/curtain-wall-shadow.js +15 -0
- package/dist/wall/definition.d.ts +0 -15
- package/dist/wall/definition.d.ts.map +1 -1
- package/dist/wall/definition.js +65 -4
- package/dist/wall/drawing-mode.d.ts +12 -0
- package/dist/wall/drawing-mode.d.ts.map +1 -0
- package/dist/wall/drawing-mode.js +38 -0
- package/dist/wall/floorplan-tool.d.ts +4 -0
- package/dist/wall/floorplan-tool.d.ts.map +1 -0
- package/dist/wall/floorplan-tool.js +107 -0
- package/dist/wall/floorplan.d.ts.map +1 -1
- package/dist/wall/floorplan.js +6 -2
- package/dist/wall/length-patch.d.ts +3 -0
- package/dist/wall/length-patch.d.ts.map +1 -0
- package/dist/wall/length-patch.js +14 -0
- package/dist/wall/move-tool.d.ts.map +1 -1
- package/dist/wall/move-tool.js +23 -1
- package/dist/wall/paint.d.ts.map +1 -1
- package/dist/wall/paint.js +39 -4
- package/dist/wall/panel-model.d.ts +4 -0
- package/dist/wall/panel-model.d.ts.map +1 -0
- package/dist/wall/panel-model.js +117 -0
- package/dist/wall/panel.d.ts.map +1 -1
- package/dist/wall/panel.js +20 -24
- package/dist/wall/property-preview.d.ts +7 -0
- package/dist/wall/property-preview.d.ts.map +1 -0
- package/dist/wall/property-preview.js +31 -0
- package/dist/wall/rectangle-command.d.ts +149 -0
- package/dist/wall/rectangle-command.d.ts.map +1 -0
- package/dist/wall/rectangle-command.js +22 -0
- package/dist/wall/rectangle-tool.d.ts +2 -0
- package/dist/wall/rectangle-tool.d.ts.map +1 -0
- package/dist/wall/rectangle-tool.js +147 -0
- package/dist/wall/renderer.d.ts.map +1 -1
- package/dist/wall/renderer.js +7 -4
- package/dist/wall/slots.d.ts +2 -2
- package/dist/wall/slots.d.ts.map +1 -1
- package/dist/wall/slots.js +10 -2
- package/dist/wall/split-floorplan-layer.d.ts +4 -0
- package/dist/wall/split-floorplan-layer.d.ts.map +1 -0
- package/dist/wall/split-floorplan-layer.js +71 -0
- package/dist/wall/split-pointer.d.ts +3 -0
- package/dist/wall/split-pointer.d.ts.map +1 -0
- package/dist/wall/split-pointer.js +95 -0
- package/dist/wall/split-preview.d.ts +55 -0
- package/dist/wall/split-preview.d.ts.map +1 -0
- package/dist/wall/split-preview.js +106 -0
- package/dist/wall/split-session.d.ts +16 -0
- package/dist/wall/split-session.d.ts.map +1 -0
- package/dist/wall/split-session.js +138 -0
- package/dist/wall/split-store.d.ts +16 -0
- package/dist/wall/split-store.d.ts.map +1 -0
- package/dist/wall/split-store.js +6 -0
- package/dist/wall/split-tool.d.ts +10 -0
- package/dist/wall/split-tool.d.ts.map +1 -0
- package/dist/wall/split-tool.js +95 -0
- package/dist/wall/system.d.ts.map +1 -1
- package/dist/wall/system.js +3 -1
- package/dist/wall/tool.d.ts.map +1 -1
- package/dist/wall/tool.js +14 -6
- package/dist/wall/wall-batch-system.d.ts.map +1 -1
- package/dist/wall/wall-batch-system.js +3 -0
- package/dist/window/definition.d.ts.map +1 -1
- package/dist/window/definition.js +48 -1
- package/dist/window/floorplan-affordances.d.ts.map +1 -1
- package/dist/window/floorplan-affordances.js +8 -10
- package/dist/window/move-tool.d.ts.map +1 -1
- package/dist/window/move-tool.js +4 -6
- package/dist/window/panel.d.ts.map +1 -1
- package/dist/window/panel.js +21 -59
- package/dist/window/tool.d.ts.map +1 -1
- package/dist/window/tool.js +34 -2
- package/dist/window/window-math.d.ts +1 -1
- package/dist/window/window-math.d.ts.map +1 -1
- package/dist/window/window-math.js +8 -11
- package/dist/zone/definition.d.ts.map +1 -1
- package/dist/zone/definition.js +1 -0
- package/dist/zone/quantities-panel.d.ts.map +1 -1
- package/dist/zone/quantities-panel.js +3 -19
- package/dist/zone/renderer.d.ts.map +1 -1
- package/dist/zone/renderer.js +1 -1
- package/package.json +8 -8
- package/dist/shared/opening-documentation-fields.d.ts +0 -16
- package/dist/shared/opening-documentation-fields.d.ts.map +0 -1
- package/dist/shared/opening-documentation-fields.js +0 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/eyebrow-vent/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA+F1C;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,OAAO,eAAe,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/eyebrow-vent/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA+F1C;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,OAAO,eAAe,CA+DxE,CAAA"}
|
|
@@ -127,6 +127,7 @@ export const eyebrowVentDefinition = {
|
|
|
127
127
|
parametrics: eyebrowVentParametrics,
|
|
128
128
|
handles: eyebrowVentHandles,
|
|
129
129
|
floorplan: buildEyebrowVentFloorplan,
|
|
130
|
+
rendersChildren: false,
|
|
130
131
|
renderer: {
|
|
131
132
|
kind: 'parametric',
|
|
132
133
|
module: () => import('./renderer'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/fence/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAA;AAmBzB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAgPpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,SAAS,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/fence/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAA;AAmBzB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAgPpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,SAAS,CA2H5D,CAAA"}
|
package/dist/fence/definition.js
CHANGED
package/dist/fence/tool.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { calculateLevelMiters, collectAlignmentAnchors, emitter, getTwoPointFenceCurveTangents, getWallMiterBoundaryPoints, resolveAlignment, sampleFenceSpline, useScene, } from '@pascal-app/core';
|
|
4
|
-
import { CursorSphere, clearPlacementSurface, createFenceOnCurrentLevel, createSplineFenceOnCurrentLevel, EDITOR_LAYER, formatAngleRadians, formatLinearMeasurement, getAngleArcToSegmentReference, getAngleToSegmentReference, getSegmentAngleReferenceAtPoint, getSegmentGridStep, isAlignmentGuideActive, isAngleSnapActive, isGridSnapActive, isMagneticSnapActive, markToolCancelConsumed, publishPlacementSurface, resolvePointerSupportSurface, snapFenceDraftPoint, snapScalarToGrid, triggerSFX, useAlignmentGuides, useEditor, useFenceCurveDraft, useFloorplanDraftPreview, useSegmentDraftChain, } from '@pascal-app/editor';
|
|
4
|
+
import { CursorSphere, clearPlacementSurface, createFenceOnCurrentLevel, createSplineFenceOnCurrentLevel, DraftMeasurementLabel, EDITOR_LAYER, formatAngleRadians, formatLinearMeasurement, getAngleArcToSegmentReference, getAngleToSegmentReference, getSegmentAngleReferenceAtPoint, getSegmentGridStep, isAlignmentGuideActive, isAngleSnapActive, isGridSnapActive, isMagneticSnapActive, markToolCancelConsumed, publishPlacementSurface, resolvePointerSupportSurface, snapFenceDraftPoint, snapScalarToGrid, triggerSFX, useAlignmentGuides, useEditor, useFenceCurveDraft, useFloorplanDraftPreview, useSegmentDraftChain, } from '@pascal-app/editor';
|
|
5
5
|
import { getSceneTheme, useViewer } from '@pascal-app/viewer';
|
|
6
6
|
import { useThree } from '@react-three/fiber';
|
|
7
7
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { BufferGeometry, DoubleSide, Vector3 } from 'three';
|
|
9
|
-
import { DraftAngleArc, DraftAxisGuides,
|
|
9
|
+
import { DraftAngleArc, DraftAxisGuides, getNearestAxisAngleLabel, } from '../shared/draft-axis-guides';
|
|
10
10
|
const FENCE_PREVIEW_HEIGHT = 1.8;
|
|
11
11
|
const FENCE_PREVIEW_THICKNESS = 0.08;
|
|
12
12
|
// Grid-plane surface publish (pointer-decided): scratch + constant normal so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/guide/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,SAAS,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/guide/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,OAAO,SAAS,CAiD5D,CAAA"}
|
package/dist/guide/definition.js
CHANGED
|
@@ -31,6 +31,7 @@ export const guideDefinition = {
|
|
|
31
31
|
parametrics: guideParametrics,
|
|
32
32
|
// No dirty consumer rebuilds this kind — see NodeDefinition.dirtyTracking.
|
|
33
33
|
dirtyTracking: false,
|
|
34
|
+
rendersChildren: false,
|
|
34
35
|
renderer: {
|
|
35
36
|
kind: 'parametric',
|
|
36
37
|
module: () => import('./renderer'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/gutter/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAoHrC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/gutter/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAoHrC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,OAAO,UAAU,CA+D9D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/hvac-equipment/tool.tsx"],"names":[],"mappings":"AA4BA;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/hvac-equipment/tool.tsx"],"names":[],"mappings":"AA4BA;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB,0CAwHtB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -28,10 +28,15 @@ function snap(value, step) {
|
|
|
28
28
|
*/
|
|
29
29
|
const HvacEquipmentTool = () => {
|
|
30
30
|
const activeLevelId = useViewer((s) => s.selection.levelId);
|
|
31
|
+
const toolDefaults = useEditor((s) => s.toolDefaults['hvac-equipment']);
|
|
31
32
|
const [cursor, setCursor] = useState(null);
|
|
32
33
|
const [yaw, setYaw] = useState(0);
|
|
33
34
|
const yawRef = useRef(0);
|
|
34
|
-
const previewNode = useMemo(() => HvacEquipmentNode.parse({
|
|
35
|
+
const previewNode = useMemo(() => HvacEquipmentNode.parse({
|
|
36
|
+
...hvacEquipmentDefinition.defaults(),
|
|
37
|
+
...toolDefaults,
|
|
38
|
+
name: 'Furnace',
|
|
39
|
+
}), [toolDefaults]);
|
|
35
40
|
const ghost = useMemo(() => {
|
|
36
41
|
const group = buildHvacEquipmentGeometry(previewNode);
|
|
37
42
|
group.traverse((child) => {
|
|
@@ -67,6 +72,7 @@ const HvacEquipmentTool = () => {
|
|
|
67
72
|
const position = resolveAligned(event);
|
|
68
73
|
const unit = HvacEquipmentNode.parse({
|
|
69
74
|
...hvacEquipmentDefinition.defaults(),
|
|
75
|
+
...toolDefaults,
|
|
70
76
|
name: 'Furnace',
|
|
71
77
|
position,
|
|
72
78
|
rotation: yawRef.current,
|
|
@@ -110,7 +116,7 @@ const HvacEquipmentTool = () => {
|
|
|
110
116
|
window.removeEventListener('keydown', onKeyDown, true);
|
|
111
117
|
clearDrawAlignment();
|
|
112
118
|
};
|
|
113
|
-
}, [activeLevelId]);
|
|
119
|
+
}, [activeLevelId, toolDefaults]);
|
|
114
120
|
if (!activeLevelId || !cursor)
|
|
115
121
|
return null;
|
|
116
122
|
return (_jsxs(LevelOffsetGroup, { children: [_jsx("group", { position: cursor, rotation: [0, yaw, 0], children: _jsx("primitive", { object: ghost }) }), _jsx(Html, { center: true, position: [cursor[0], cursor[1] + previewNode.height + 0.4, cursor[2]], style: { pointerEvents: 'none', userSelect: 'none' }, zIndexRange: [100, 0], children: _jsx("div", { className: "flex items-center gap-2 whitespace-nowrap rounded-full border border-border/60 bg-background/90 px-4 py-1.5 text-xs tabular-nums shadow-sm backdrop-blur", children: _jsx("span", { className: "font-medium text-foreground", children: "R/T rotate" }) }) })] }));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type FloorplanGeometry, type GeometryContext, type ItemNode } from '@pascal-app/core';
|
|
2
|
+
/**
|
|
3
|
+
* Stage C floor-plan builder for item.
|
|
4
|
+
*
|
|
5
|
+
* Items can be parented to a wall, ceiling, slab, or another item.
|
|
6
|
+
* Position is in the parent's local frame, so we walk the parent chain
|
|
7
|
+
* via `ctx.resolve` to compute the world-space (level-local) transform.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors `getItemFloorplanTransform` from editor/lib/floorplan/items.ts
|
|
10
|
+
* but uses the registry's resolve callback instead of a node map. Logic
|
|
11
|
+
* is identical so visual output matches the legacy.
|
|
12
|
+
*
|
|
13
|
+
* Returns a rotated rectangle of width × depth at the resolved position.
|
|
14
|
+
* Phase 5 follow-up may render `asset.floorPlanUrl` as a custom image
|
|
15
|
+
* overlay when present.
|
|
16
|
+
*/
|
|
17
|
+
type Transform = {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
rotation: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function resolveItemTransform(item: ItemNode, ctx: GeometryContext, cache?: Map<`roof_${string}` | `rseg_${string}` | `site_${string}` | `building_${string}` | `level_${string}` | `elevator_${string}` | `unit_${string}` | `zone_${string}` | `block_${string}` | `ceiling_${string}` | `item_${string}` | `procedural-item_${string}` | `column_${string}` | `construction-dimension_${string}` | `wall_${string}` | `slab_${string}` | `fence_${string}` | `structural-grid_${string}` | `imesh_${string}` | `stair_${string}` | `scan_${string}` | `guide_${string}` | `measurement_${string}` | `spawn_${string}` | `shelf_${string}` | `duct-segment_${string}` | `duct-fitting_${string}` | `duct-terminal_${string}` | `hvac-equipment_${string}` | `lineset_${string}` | `liquid-line_${string}` | `pipe-segment_${string}` | `pipe-fitting_${string}` | `pipe-trap_${string}` | `leanto_${string}` | `door_${string}` | `window_${string}` | `cabinet_${string}` | `cabinet-module_${string}` | `sseg_${string}` | `bvent_${string}` | `rvent_${string}` | `tvent_${string}` | `cupola_${string}` | `eyebrow-vent_${string}` | `gutter_${string}` | `chimney_${string}` | `solarpanel_${string}` | `skylight_${string}` | `dormer_${string}` | `downspout_${string}`, Transform | null>): Transform | null;
|
|
23
|
+
export declare function buildItemContextualDimensions(node: ItemNode, ctx: GeometryContext): FloorplanGeometry | null;
|
|
24
|
+
export declare function buildItemFloorplan(node: ItemNode, ctx: GeometryContext): FloorplanGeometry | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=main-floorplan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-floorplan.d.ts","sourceRoot":"","sources":["../../../src/item/__fixtures__/main-floorplan.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EAIpB,KAAK,QAAQ,EAId,MAAM,kBAAkB,CAAA;AAIzB;;;;;;;;;;;;;;GAcG;AACH,KAAK,SAAS,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA;AAe3D,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,GAAG,EAAE,eAAe,EACpB,KAAK,0pCAAyC,GAC7C,SAAS,GAAG,IAAI,CA6JlB;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,EACd,GAAG,EAAE,eAAe,GACnB,iBAAiB,GAAG,IAAI,CA+C1B;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,GAAG,iBAAiB,GAAG,IAAI,CAmGjG"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { getBlockFaceFrame, getRoofWallFaceFrame, getScaledDimensions, roofFacePointToSegment, useLiveTransforms, } from '@pascal-app/core';
|
|
2
|
+
import { formatLinearMeasurement, readFloorplanMetricNotationOverride } from '@pascal-app/editor';
|
|
3
|
+
import { restingNodePlanFrame } from '../../shared/resting-surface-plan';
|
|
4
|
+
// Plan-space rotation convention used by the legacy `rotatePlanVector`
|
|
5
|
+
// in `editor/src/lib/floorplan/geometry.ts`. This is a CLOCKWISE rotation
|
|
6
|
+
// — the registry-side equivalent of the canonical floor-plan transform
|
|
7
|
+
// math. Don't switch to a standard counter-clockwise rotation; the wall
|
|
8
|
+
// items math (wallRotation = -atan2(dy, dx)) is calibrated against this
|
|
9
|
+
// convention, and the legacy item floor-plan stack reads from these
|
|
10
|
+
// offsets across many sites.
|
|
11
|
+
function rotateVec(x, y, angle) {
|
|
12
|
+
const c = Math.cos(angle);
|
|
13
|
+
const s = Math.sin(angle);
|
|
14
|
+
return [x * c + y * s, -x * s + y * c];
|
|
15
|
+
}
|
|
16
|
+
export function resolveItemTransform(item, ctx, cache = new Map()) {
|
|
17
|
+
const cached = cache.get(item.id);
|
|
18
|
+
if (cached !== undefined)
|
|
19
|
+
return cached;
|
|
20
|
+
const localRotation = item.rotation[1] ?? 0;
|
|
21
|
+
let result = null;
|
|
22
|
+
const parentNode = item.parentId
|
|
23
|
+
? ctx.resolve(item.parentId)
|
|
24
|
+
: undefined;
|
|
25
|
+
if (parentNode?.type === 'wall') {
|
|
26
|
+
// Wall-aligned: rotate item.position by wall's angle, anchor at wall.start.
|
|
27
|
+
const wall = parentNode;
|
|
28
|
+
const wallRotation = -Math.atan2(wall.end[1] - wall.start[1], wall.end[0] - wall.start[0]);
|
|
29
|
+
const wallLocalZ = item.asset.attachTo === 'wall-side'
|
|
30
|
+
? ((wall.thickness ?? 0.1) / 2) * (item.side === 'front' ? 1 : -1)
|
|
31
|
+
: item.position[2];
|
|
32
|
+
const [offsetX, offsetY] = rotateVec(item.position[0], wallLocalZ, wallRotation);
|
|
33
|
+
result = {
|
|
34
|
+
x: wall.start[0] + offsetX,
|
|
35
|
+
y: wall.start[1] + offsetY,
|
|
36
|
+
rotation: wallRotation + localRotation,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else if (parentNode?.type === 'item') {
|
|
40
|
+
// Nested item: recursively resolve parent's transform.
|
|
41
|
+
const parentT = resolveItemTransform(parentNode, ctx, cache);
|
|
42
|
+
if (parentT) {
|
|
43
|
+
const [offsetX, offsetY] = rotateVec(item.position[0], item.position[2], parentT.rotation);
|
|
44
|
+
result = {
|
|
45
|
+
x: parentT.x + offsetX,
|
|
46
|
+
y: parentT.y + offsetY,
|
|
47
|
+
rotation: parentT.rotation + localRotation,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (parentNode?.type === 'cabinet' ||
|
|
52
|
+
parentNode?.type === 'cabinet-module' ||
|
|
53
|
+
parentNode?.type === 'procedural-item') {
|
|
54
|
+
const f = restingNodePlanFrame(item, ctx.resolve);
|
|
55
|
+
result = {
|
|
56
|
+
x: f.position[0],
|
|
57
|
+
y: f.position[2],
|
|
58
|
+
rotation: Math.atan2(f.axes[2][0], f.axes[2][2]),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
else if (parentNode?.type === 'shelf') {
|
|
62
|
+
// Shelf-hosted item: `item.position` is in shelf-local coords. The
|
|
63
|
+
// shelf has its own `position` + `rotation[1]` in its parent (level)
|
|
64
|
+
// frame, so the item's plan-space position composes the shelf's
|
|
65
|
+
// pose with the item's local offset. Without this branch the
|
|
66
|
+
// `else` below would treat shelf-local coords as level-local and
|
|
67
|
+
// the item would render at the wrong spot whenever the shelf is
|
|
68
|
+
// anywhere other than (0, 0, 0).
|
|
69
|
+
//
|
|
70
|
+
// We also check `useLiveTransforms` for the shelf — if the shelf is
|
|
71
|
+
// mid-move (3D or 2D), its scene-state `position` is still at the
|
|
72
|
+
// pre-move spot but the live transform carries the cursor-tracked
|
|
73
|
+
// position. Reading the live value here keeps the hosted item
|
|
74
|
+
// following the shelf in 2D throughout the drag, mirroring how the
|
|
75
|
+
// shelf's own entry follows via the layer's effectiveNode override.
|
|
76
|
+
const shelf = parentNode;
|
|
77
|
+
const live = useLiveTransforms.getState().get(shelf.id);
|
|
78
|
+
if (shelf.parentId &&
|
|
79
|
+
['item', 'shelf', 'cabinet', 'cabinet-module', 'procedural-item'].includes(ctx.resolve(shelf.parentId)?.type ?? '')) {
|
|
80
|
+
const parentT = resolveItemTransform({
|
|
81
|
+
...shelf,
|
|
82
|
+
position: live?.position ?? shelf.position,
|
|
83
|
+
rotation: [0, live?.rotation ?? shelf.rotation[1], 0],
|
|
84
|
+
}, ctx, cache);
|
|
85
|
+
if (!parentT)
|
|
86
|
+
return null;
|
|
87
|
+
const [x, y] = rotateVec(item.position[0], item.position[2], parentT.rotation);
|
|
88
|
+
return { x: parentT.x + x, y: parentT.y + y, rotation: parentT.rotation + localRotation };
|
|
89
|
+
}
|
|
90
|
+
const shelfX = live?.position[0] ?? shelf.position[0];
|
|
91
|
+
const shelfZ = live?.position[2] ?? shelf.position[2];
|
|
92
|
+
const shelfRotationY = live?.rotation ?? shelf.rotation[1] ?? 0;
|
|
93
|
+
const [offsetX, offsetY] = rotateVec(item.position[0], item.position[2], shelfRotationY);
|
|
94
|
+
result = {
|
|
95
|
+
x: shelfX + offsetX,
|
|
96
|
+
y: shelfZ + offsetY,
|
|
97
|
+
rotation: shelfRotationY + localRotation,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
else if (parentNode?.type === 'roof-segment') {
|
|
101
|
+
// Roof-hosted wall item: FACE-LOCAL position mapped through the face
|
|
102
|
+
// frame, then composed through the segment's and parent roof's poses
|
|
103
|
+
// into level-local plan coords.
|
|
104
|
+
const segment = parentNode;
|
|
105
|
+
const roof = segment.parentId
|
|
106
|
+
? ctx.resolve(segment.parentId)
|
|
107
|
+
: undefined;
|
|
108
|
+
if (roof?.type === 'roof' && item.roofFace) {
|
|
109
|
+
const frame = getRoofWallFaceFrame(segment, item.roofFace);
|
|
110
|
+
const segLocal = roofFacePointToSegment(segment, item.roofFace, item.position);
|
|
111
|
+
const [sx, sz] = rotateVec(segLocal[0], segLocal[2], segment.rotation ?? 0);
|
|
112
|
+
const [rx, rz] = rotateVec(sx + segment.position[0], sz + segment.position[2], roof.rotation ?? 0);
|
|
113
|
+
result = {
|
|
114
|
+
x: rx + roof.position[0],
|
|
115
|
+
y: rz + roof.position[2],
|
|
116
|
+
rotation: (roof.rotation ?? 0) + (segment.rotation ?? 0) + frame.yaw + localRotation,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else if (parentNode?.type === 'block' && item.blockFaceId) {
|
|
121
|
+
const frame = getBlockFaceFrame(parentNode.topology, item.blockFaceId);
|
|
122
|
+
if (frame) {
|
|
123
|
+
const localX = frame.origin[0] +
|
|
124
|
+
frame.xAxis[0] * item.position[0] +
|
|
125
|
+
frame.yAxis[0] * item.position[1] +
|
|
126
|
+
frame.normal[0] * item.position[2];
|
|
127
|
+
const localZ = frame.origin[2] +
|
|
128
|
+
frame.xAxis[2] * item.position[0] +
|
|
129
|
+
frame.yAxis[2] * item.position[1] +
|
|
130
|
+
frame.normal[2] * item.position[2];
|
|
131
|
+
const hostRotation = parentNode.rotation ?? 0;
|
|
132
|
+
const [offsetX, offsetZ] = rotateVec(localX, localZ, hostRotation);
|
|
133
|
+
const faceRotation = -Math.atan2(frame.xAxis[2], frame.xAxis[0]);
|
|
134
|
+
result = {
|
|
135
|
+
x: parentNode.position[0] + offsetX,
|
|
136
|
+
y: parentNode.position[2] + offsetZ,
|
|
137
|
+
rotation: hostRotation + faceRotation + localRotation,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
// Level / slab / ceiling parent — item.position is level-local.
|
|
143
|
+
result = {
|
|
144
|
+
x: item.position[0],
|
|
145
|
+
y: item.position[2],
|
|
146
|
+
rotation: localRotation,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
cache.set(item.id, result);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
export function buildItemContextualDimensions(node, ctx) {
|
|
153
|
+
const transform = resolveItemTransform(node, ctx);
|
|
154
|
+
if (!transform)
|
|
155
|
+
return null;
|
|
156
|
+
const [width, , depth] = getScaledDimensions(node);
|
|
157
|
+
if (width <= 1e-6 || depth <= 1e-6)
|
|
158
|
+
return null;
|
|
159
|
+
const centerLocalZ = node.asset.attachTo === 'wall-side' ? depth / 2 : 0;
|
|
160
|
+
const [centerOffsetX, centerOffsetY] = rotateVec(0, centerLocalZ, transform.rotation);
|
|
161
|
+
const cx = transform.x + centerOffsetX;
|
|
162
|
+
const cy = transform.y + centerOffsetY;
|
|
163
|
+
const halfWidth = width / 2;
|
|
164
|
+
const halfDepth = depth / 2;
|
|
165
|
+
const point = (x, y) => {
|
|
166
|
+
const [rx, ry] = rotateVec(x, y, transform.rotation);
|
|
167
|
+
return [cx + rx, cy + ry];
|
|
168
|
+
};
|
|
169
|
+
const widthNormal = rotateVec(0, -1, transform.rotation);
|
|
170
|
+
const depthNormal = rotateVec(1, 0, transform.rotation);
|
|
171
|
+
const unit = ctx.viewState?.unit ?? 'metric';
|
|
172
|
+
const metricNotation = readFloorplanMetricNotationOverride(ctx) ?? 'meters';
|
|
173
|
+
const stroke = ctx.viewState?.palette?.selectedStroke ?? '#2563eb';
|
|
174
|
+
return {
|
|
175
|
+
kind: 'group',
|
|
176
|
+
children: [
|
|
177
|
+
{
|
|
178
|
+
kind: 'dimension',
|
|
179
|
+
start: point(-halfWidth, -halfDepth),
|
|
180
|
+
end: point(halfWidth, -halfDepth),
|
|
181
|
+
offsetNormal: widthNormal,
|
|
182
|
+
offsetDistance: 0.28,
|
|
183
|
+
extensionOvershoot: 0.08,
|
|
184
|
+
text: formatLinearMeasurement(width, unit, metricNotation),
|
|
185
|
+
stroke,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
kind: 'dimension',
|
|
189
|
+
start: point(halfWidth, -halfDepth),
|
|
190
|
+
end: point(halfWidth, halfDepth),
|
|
191
|
+
offsetNormal: depthNormal,
|
|
192
|
+
offsetDistance: 0.28,
|
|
193
|
+
extensionOvershoot: 0.08,
|
|
194
|
+
text: formatLinearMeasurement(depth, unit, metricNotation),
|
|
195
|
+
stroke,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
export function buildItemFloorplan(node, ctx) {
|
|
201
|
+
const transform = resolveItemTransform(node, ctx);
|
|
202
|
+
if (!transform)
|
|
203
|
+
return null;
|
|
204
|
+
const [width, , depth] = getScaledDimensions(node);
|
|
205
|
+
if (width <= 0 || depth <= 0)
|
|
206
|
+
return null;
|
|
207
|
+
// Wall-side items are anchored at the mounted wall face; their body extends
|
|
208
|
+
// depth-ward AWAY from the wall (into the room), so push the footprint centre
|
|
209
|
+
// a half-depth out along the item's local +Z. After the front/back π flip in
|
|
210
|
+
// `transform.rotation`, +depth/2 always points off the wall for either side;
|
|
211
|
+
// a negative offset would lay the footprint across the wall onto the far side.
|
|
212
|
+
const centerLocalZ = node.asset.attachTo === 'wall-side' ? depth / 2 : 0;
|
|
213
|
+
const [centerOffsetX, centerOffsetY] = rotateVec(0, centerLocalZ, transform.rotation);
|
|
214
|
+
const cx = transform.x + centerOffsetX;
|
|
215
|
+
const cy = transform.y + centerOffsetY;
|
|
216
|
+
// Rectangle corners in local space, rotated and translated.
|
|
217
|
+
const halfW = width / 2;
|
|
218
|
+
const halfD = depth / 2;
|
|
219
|
+
const corners = [
|
|
220
|
+
[-halfW, -halfD],
|
|
221
|
+
[halfW, -halfD],
|
|
222
|
+
[halfW, halfD],
|
|
223
|
+
[-halfW, halfD],
|
|
224
|
+
];
|
|
225
|
+
const points = corners.map(([x, y]) => {
|
|
226
|
+
const [rx, ry] = rotateVec(x, y, transform.rotation);
|
|
227
|
+
return [cx + rx, cy + ry];
|
|
228
|
+
});
|
|
229
|
+
const isSelected = ctx.viewState?.selected ?? false;
|
|
230
|
+
// Marquee preview — the about-to-be-selected tint every other kind shows.
|
|
231
|
+
const isHighlighted = ctx.viewState?.highlighted ?? false;
|
|
232
|
+
const showSelection = isSelected || isHighlighted;
|
|
233
|
+
const isMoving = ctx.viewState?.moving ?? false;
|
|
234
|
+
const selectedStroke = ctx.viewState?.palette?.selectedStroke ?? '#3b82f6';
|
|
235
|
+
const floorPlanUrl = node.asset.floorPlanUrl;
|
|
236
|
+
const children = [
|
|
237
|
+
{
|
|
238
|
+
kind: 'polygon',
|
|
239
|
+
points,
|
|
240
|
+
// When an asset thumbnail is present, the polygon is a transparent
|
|
241
|
+
// hit-target — the image carries the visual weight. Without a
|
|
242
|
+
// thumbnail the polygon needs a light fill to read at all.
|
|
243
|
+
//
|
|
244
|
+
// `transparent` (not `none`) so the interior remains hit-testable —
|
|
245
|
+
// the registry layer's wrapping `<g>` only fires onPointerDown when
|
|
246
|
+
// the child renders a paintable surface. `fill="none"` would make
|
|
247
|
+
// clicks pass through to whatever's beneath, breaking selection.
|
|
248
|
+
fill: floorPlanUrl ? 'transparent' : '#fef3c7',
|
|
249
|
+
// Selected items read as selected: palette stroke + heavier weight
|
|
250
|
+
// (the move dot used to be the only cue, and it hides in
|
|
251
|
+
// multi-selections).
|
|
252
|
+
stroke: showSelection ? selectedStroke : '#92400e',
|
|
253
|
+
strokeWidth: showSelection ? 0.035 : 0.012,
|
|
254
|
+
opacity: 0.85,
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
// Asset thumbnail — top-down PNG capture from the asset modal. Drawn
|
|
258
|
+
// inside the footprint with the item's rotation applied. Matches the
|
|
259
|
+
// legacy `FloorplanItemImage` overlay.
|
|
260
|
+
if (floorPlanUrl) {
|
|
261
|
+
children.push({
|
|
262
|
+
kind: 'image',
|
|
263
|
+
url: floorPlanUrl,
|
|
264
|
+
center: [cx, cy],
|
|
265
|
+
width,
|
|
266
|
+
height: depth,
|
|
267
|
+
// `rotateVec` (the footprint polygon) applies R(-angle), but the renderer
|
|
268
|
+
// draws the image with SVG `rotate(+deg)` = R(+angle). Negate so the
|
|
269
|
+
// sprite rotates the same way as its footprint box (and 3D); otherwise the
|
|
270
|
+
// two counter-rotate and diverge by 2x the item's rotation.
|
|
271
|
+
rotation: -transform.rotation,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
// Selection ring ABOVE the thumbnail — the base polygon's selected stroke
|
|
275
|
+
// sits underneath the image, so re-draw it on top. `fill: none` keeps the
|
|
276
|
+
// ring click-through; the base polygon owns hit-testing.
|
|
277
|
+
if (showSelection && floorPlanUrl) {
|
|
278
|
+
children.push({
|
|
279
|
+
kind: 'polygon',
|
|
280
|
+
points,
|
|
281
|
+
fill: 'none',
|
|
282
|
+
stroke: selectedStroke,
|
|
283
|
+
strokeWidth: 0.035,
|
|
284
|
+
opacity: isSelected ? 0.95 : 0.7,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// Move handle — orange dot at the item center. Only when selected and not
|
|
288
|
+
// already moving: during a move the dot sits under the cursor, so a release
|
|
289
|
+
// over it would re-arm the move (and re-enter edit) instead of committing.
|
|
290
|
+
if (isSelected && !isMoving) {
|
|
291
|
+
children.push({
|
|
292
|
+
kind: 'move-handle',
|
|
293
|
+
point: [cx, cy],
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
return { kind: 'group', children };
|
|
297
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/item/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/item/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AAOzB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AA+HnC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,OAAO,QAAQ,CAyL1D,CAAA"}
|
package/dist/item/definition.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getScaledDimensions, } from '@pascal-app/core';
|
|
2
|
+
import { restingFloorplanAffectedIds } from '../shared/resting-surface-plan';
|
|
2
3
|
import { buildItemContextualDimensions, buildItemFloorplan } from './floorplan';
|
|
3
4
|
import { itemFloorplanMoveTarget } from './floorplan-move';
|
|
4
5
|
import { itemPaint } from './paint';
|
|
@@ -196,7 +197,7 @@ export const itemDefinition = {
|
|
|
196
197
|
},
|
|
197
198
|
},
|
|
198
199
|
},
|
|
199
|
-
duplicable:
|
|
200
|
+
duplicable: { subtree: 'with-children' },
|
|
200
201
|
deletable: true,
|
|
201
202
|
paint: itemPaint,
|
|
202
203
|
// Items participate in compositions — e.g. "table-with-plants",
|
|
@@ -297,6 +298,7 @@ export const itemDefinition = {
|
|
|
297
298
|
// Stage C: floor-plan polygon. ctx.resolve walks the parent chain
|
|
298
299
|
// (wall / nested item / level) to compute the world-space transform.
|
|
299
300
|
floorplan: buildItemFloorplan,
|
|
301
|
+
floorplanAffectedIds: restingFloorplanAffectedIds,
|
|
300
302
|
// 2D move-on-floorplan handler. Branches on `asset.attachTo`:
|
|
301
303
|
// wall items snap to walls (like door / window), ceiling items
|
|
302
304
|
// snap to ceiling polygons, floor items snap to slabs. attachTo
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floorplan-move.d.ts","sourceRoot":"","sources":["../../src/item/floorplan-move.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"floorplan-move.d.ts","sourceRoot":"","sources":["../../src/item/floorplan-move.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,EAMhB,KAAK,mBAAmB,EAKxB,KAAK,QAAQ,EAQd,MAAM,kBAAkB,CAAA;AA+EzB,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,CAAC,QAAQ,CA+BjE,CAAA;AAgaD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACjC,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,UAAU,EAAE,SAAS,GACpB,WAAW,GAAG,IAAI,CAwBpB"}
|