Commit Graph
579 Commits
Author SHA1 Message Date
PascalandGitHub 0a46a9deb4 sync: comprehensive monorepo → editor parity (2D/3D decoupling, UX polish, crash fixes)
Squash merge of 3 commits:
1. useLiveTransforms store for 2D/3D decoupling + floorplan overhaul + Sentry crash fixes
2. Comprehensive 59-file sync bringing editor to full monorepo parity (selection highlights, delete tool, furnish/zone modes, keyboard shortcuts, all panels)
3. Missing files fix (materials.ts, merged-outline-node.ts, type fix)

75 files changed, ~6K additions.
2026-04-07 19:21:10 -04:00
PascalandGitHub e8ad92592d fix(viewer): suppress THREE.Clock deprecation warning from R3F 9.x (#215)
three.js r183 deprecated THREE.Clock, but @react-three/fiber 9.x still
uses it internally per <Canvas> mount. This floods the dev console with
noise on every page load and HMR reload.

Uses three's setConsoleFunction hook to surgically suppress only the
exact Clock deprecation message. All other three.js logs pass through
untouched, including TSL stack-trace warnings.

Safe to remove once R3F v10 stable ships (which replaces Clock with
Timer). Removal condition documented in file header.

Closes #213
2026-04-07 10:17:00 -04:00
PascalandGitHub d9965f487c fix: sync stair elevations with floor slabs (#216)
Mark stair nodes as dirty when slabs change so stairs properly stack on
top of floor slabs. StairSystem now computes slab-driven elevation by
sampling segment centers against the spatial grid.

Changes:
- spatial-grid-sync: mark stair nodes dirty on slab changes (same level)
- stair-system: syncStairGroupElevation + getStairSlabElevation compute
  Y offset from slab data; rotateXZ helper for world-space transforms
- stair-renderer: use position-x/position-z so the system controls Y
2026-04-06 12:02:57 -04:00
ed6ed3f018 fix(editor): release scene singletons on Editor unmount (#214)
The spatial-grid manager, scene-store subscriptions, and the viewer
outliner's Object3D arrays are module-level singletons that previously
lived for the whole page lifetime. When an app unmounted the Editor
(e.g. navigating away from the 3D editor and back in an SPA host) they
retained references to the disposed Three.js scene graph, which caused
the app to freeze on re-entry as the stale data was replayed against a
fresh scene.

- initSpatialGridSync now returns the unsubscribe handle from its
  scene-store subscription so callers can detach it.
- initializeEditorRuntime becomes reversible: it wires up the spatial
  grid, space detection and SFX bus on mount and returns a teardown
  closure that detaches both store subscriptions, clears the spatial
  grid manager, and truncates the viewer outliner's selected/hovered
  arrays in place.
- The Editor component's runtime-init effect now returns that teardown,
  so the singletons are reset cleanly every time the Editor unmounts.
- initSFXBus is now idempotent via an internal guard so repeated
  Editor mounts do not stack duplicate mitt listeners.

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-05 23:37:30 -04:00
PascalandGitHub 0bd0cab533 feat: stair system, scene graph utilities, read-only mode, viewer state improvements (#210)
Stair system (full stack):
- New StairNode + StairSegmentNode schemas with flights, landings, L/U-shapes
- StairSystem: geometry generation with throttled per-frame updates
- Stair tool, edit system, panels, tree node, and renderers
- Event bus types, scene registry, and command palette entries

Scene graph utilities:
- cloneLevelSubtree: deep-clone a level with remapped IDs
- forkSceneGraph: clone + strip scan/guide nodes for project forking

Core improvements:
- Read-only mode on scene store (blocks create/update/delete when locked)
- readOnly guards on node-actions and collection actions
- Upload store for scan/guide file upload handling

Viewer state:
- previewSelectedIds for box-select live preview
- hoverHighlightMode (default/delete) for delete-mode hover outline
2026-04-05 01:20:43 -04:00
ClayandGitHub 08f93f527a feat(slider): implement infinity dragging using PointerLock API (#206)
Slider controls now use the Pointer Lock API for drag interactions. When dragging a slider label, the cursor locks and movement continues infinitely past the screen edge, matching Unity3D and other professional 3D editors.

- requestPointerLock on drag start, movementX accumulation, exitPointerLock on release
- Falls back to setPointerCapture if PointerLock unavailable
- ESC during drag handled via pointerlockchange listener
- Shift/Ctrl step multipliers preserved
- Undo/redo temporal state correctly managed on all exit paths

Closes #204
2026-04-02 11:26:23 -04:00
PascalandGitHub 50eca057ca feat: editor layout redesign v2 + 3D box select (#207)
Major layout redesign introducing v2 editor layout:

**New Features**
- V2 two-column layout (resizable sidebar + viewer panel with toolbar slots)
- 3D box select tool with marquee selection (561 lines pure Three.js geometry)
- View mode system (3D/2D/Split) replacing old floorplan toggle
- Floating level selector on viewer panel
- Viewer toolbar: level mode, wall mode, units, theme, camera, walkthrough, preview
- Horizontal tab bar for sidebar panels

**Layout Changes**
- Fixed 5-button control bar: Select, Box Select, Site Edit, Build, Delete
- Simplified view toggles (scans/guides only)
- Always-mounted viewers (display:none) to preserve WebGL context
- First-person walkthrough forces 3D view, restores on exit
- Site edit as permanent control (phase='site' is sole signal)

**Technical**
- layoutVersion prop: 'v1' (default) or 'v2'
- New exports: FloatingLevelSelector, SettingsPanel, SidebarTab, ViewMode, ViewerToolbarLeft/Right
- isCollapsed/setIsCollapsed added to sidebar store
- isFirstPersonMode restored for walkthrough support

19 files changed, +3230/-1898
Built and verified: bun run build passes (all tasks, 0 errors)
2026-04-02 11:24:19 -04:00
Pascal b4d9f3fbf6 fix: resolve type errors in export-system for tsc --build
- Cast scene.clone() to Scene for GLTFExporter compatibility
- Cast DataView.buffer to ArrayBuffer for STL Blob construction
- Add THREE import for Object3D type in traverse callback
2026-03-31 20:54:46 +00:00
Pascal f2f362eda9 release: @pascal-app/core@0.3.3 @pascal-app/viewer@0.3.3 2026-03-31 20:52:13 +00:00
PascalandGitHub 3e05e5aa43 Merge pull request #203 from thiago-lopes-dev/main
feat: implement export scene system (GLB, STL, OBJ)
2026-03-31 16:51:51 -04:00
PascalandGitHub c77a8070e1 Merge pull request #205 from pascalorg/fix/ceiling-transparent-fallback
fix: ceiling transparent by default when no material is set
2026-03-31 16:51:19 -04:00
Pascal b6636c179b fix: ceiling transparent by default when no material is set
The ceiling renderer was falling back to DEFAULT_CEILING_MATERIAL (an
opaque MeshStandardMaterial) when no material was set on the node.
This made ceilings fully opaque instead of using the intended
transparent grid pattern for scenes created before v0.3.2.

Now uses resolveMaterial() to extract the color from whatever material
config exists (preset, custom, or default white), then always creates
the proper transparent ceiling materials for both faces.
2026-03-31 19:31:46 +00:00
Pascal e84e870248 release: @pascal-app/core@0.3.2 @pascal-app/viewer@0.3.2 2026-03-30 21:10:55 +00:00
PascalandGitHub 08a9d66520 Merge pull request #201 from PMAT77/feature/material
Feature/material
2026-03-30 17:07:01 -04:00
Pascal f7a024d5f0 chore: remove AGENTS.md — not intended for the repository 2026-03-30 21:06:49 +00:00
Thiago LöpesandGitHub dff934e0bb Export ExportSystem from the export-system module 2026-03-30 17:43:01 -03:00
Thiago LöpesandGitHub 02d68835ef Add ExportSystem component to viewer 2026-03-30 17:42:11 -03:00
PascalandGitHub 4a83bed6dd Merge pull request #173 from Yashism/feat/street-view
Add street view / walkthrough mode
2026-03-30 16:40:19 -04:00
PascalandGitHub 4b17241873 Merge pull request #202 from pascalorg/chore/update-templates
chore: encourage screen recordings in PR and bug report templates
2026-03-30 16:40:08 -04:00
Thiago LöpesandGitHub 9056eb2f1d Add files via upload 2026-03-30 17:39:37 -03:00
Pascal 10d96b3b2b chore: encourage screen recordings in PR and bug report templates 2026-03-30 20:07:22 +00:00
Pascal 5fcdad79ce merge: resolve conflict with main — keep first-person mode bypass + tool cancel pattern + delete mode + counter-clockwise rotation 2026-03-30 20:06:47 +00:00
Developer 0be6d84c98 refactor: 完善材质系统相关代码
- 修复 node-actions.ts 中 forEach 返回值 lint 警告
- 更新材质 schema 定义和渲染器
- wall-cutout.tsx 材质颜色保留修复
2026-03-30 20:29:29 +08:00
Developer d0cdeb2ac4 fix(viewer): 修复墙体材质切换后缩放旋转时颜色恢复问题
问题描述:
选中墙体并切换材质颜色后,在界面上进行缩放、旋转或移动操作时,
墙体实际渲染的颜色会恢复为原来的白色,但颜色选项卡显示仍为选中的颜色。

根本原因:
WallCutout 系统在每次相机移动时,直接使用固定的白色材质覆盖墙体材质,
完全忽略了用户在节点上设置的自定义材质。

修复内容:
- 为每个墙体创建独立的材质对象,支持用户自定义颜色
- 支持预设颜色(brick, concrete, wood 等)和自定义颜色属性
- 添加材质哈希值跟踪,检测材质变化并重新创建材质
- 提取 getWallHideState() 辅助函数,优化代码结构
- 添加预设颜色映射的类型安全改进,使用 as const 和 keyof 类型操作
2026-03-30 20:21:48 +08:00
Developer 12b6292623 feat: add material system for all node types
- Add MaterialSchema with 10 presets (white, brick, concrete, wood, glass, metal, plaster, tile, marble, custom)
- Add material field to Wall, Slab, Door, Window, Ceiling, Roof, RoofSegment nodes
- Create MaterialPicker UI component with preset selection and custom properties
- Update all renderers to support material rendering with caching
- Add Material section to all node panels (WallPanel, SlabPanel, DoorPanel, WindowPanel, CeilingPanel, RoofPanel, RoofSegmentPanel)
- Update AGENTS.md with Material System documentation
2026-03-30 12:15:16 +08:00
Pascal 99bb5f3645 Merge pull request #178 from korvixhq/feat/duplicate-project
feat: duplicate project - cloneSceneGraph utility
2026-03-28 22:45:54 +00:00
Pascal 3474ee226d fix: use structuredClone to avoid shared references in cloneSceneGraph
The original implementation used spread ({ ...node }) which only shallow-copies.
Nested objects (asset, polygon, position tuples, metadata) would share references
between the original and cloned scene, meaning mutations to the clone could
corrupt the original.

Also removed resolveChildRefId helper — children arrays in the schema are always
string IDs, so the object-with-id handling was dead code.
2026-03-28 22:45:33 +00:00
Pascal 58676e5720 Merge remote-tracking branch 'origin/main' into feat/duplicate-project 2026-03-28 22:43:18 +00:00
Huy HoangandGitHub c05ae9d38e fix: allow deleting walls and slabs via floating action menu (#180)
* fix: allow deleting walls and slabs via floating action menu

Walls and slabs were excluded from ALLOWED_TYPES in FloatingActionMenu,
so no delete UI appeared when selecting them. Added wall/slab to the
allowed types and show only the delete button (no move/duplicate) since
they are structural elements.

Usage: switch to select mode (V), click a wall or slab, then use the
floating trash icon or press Delete/Backspace to remove it.

Closes #156

* fix: offset delete button higher on walls/slabs to avoid covering measurement labels

* feat: implement sledgehammer-style delete mode

Clicking the trash icon in the floating action menu now activates a
persistent delete mode (like The Sims sledgehammer tool) instead of
deleting immediately. Users can then click objects on the canvas to
delete them one by one. Press V or Escape to exit delete mode.

- Wire delete mode clicks/hover in SelectionManager
- Add D keyboard shortcut to activate delete mode
- Change floating menu delete button to activate delete mode
- Add crosshair cursor when delete mode is active
2026-03-28 18:27:44 -04:00
PascalandGitHub b024aaf91a Merge pull request #189 from korvixhq/chore/image-props
Add sizes and loading props to catalog item images
2026-03-28 18:27:07 -04:00
PascalandGitHub 479552394b Merge pull request #184 from nnhhoang/fix/counter-clockwise-rotation
fix: implement T key for counter-clockwise rotation on selected nodes
2026-03-28 18:26:28 -04:00
PascalandGitHub daf62ce6d2 feat: implement editable wall length slider (#195)
feat: implement editable wall length slider #191
2026-03-28 18:24:14 -04:00
Thiago LöpesandGitHub 16835c6f46 feat: implement editable wall length slider #191
Key Additions & Changes:

Interactive Length Control: Replaced the static "Length" text with an editable SliderControl component.

Vector Math Implementation: Added handleUpdateLength, a function that recalculates the wall's end position ($P_{end}$) based on the user's input while preserving the wall's original direction.

Real-time Geometry Updates: Integrated the change with useScene and dirtyNodes to ensure the 3D mesh updates instantly in the viewer as the slider moves.

UX Consistency: Used the existing SliderControl and PanelSection patterns to match the Pascal Editor's design system.

Fixes #191
2026-03-28 17:12:35 -03:00
BravadoBoss b47e8446bd Add sizes and loading props to catalog item images 2026-03-26 21:38:17 -04:00
github-actions[bot] f2a22bbc2b release: @pascal-app/core@0.3.1 @pascal-app/viewer@0.3.1 2026-03-26 19:52:23 +00:00
PascalandGitHub 9f62bd108f fix: slider rewrite, ESC key fix, antialias improvements (#187)
Slider control:
- Rewrite drag interaction to use label-based drag instead of track slider
- Remove hardcoded min/max bounds, default to unbounded
- Add ArrowLeft/ArrowRight key support alongside Up/Down
- Cleaner, more compact UI (238 lines vs 332)

ESC key cancel fix:
- Pressing ESC during mid-action (drawing wall, placing slab) now only
  cancels the current action, not also switching back to select mode
- Tools mark cancel as consumed via markToolCancelConsumed()
- Second ESC press switches to select mode as before

Window panel:
- Remove hardcoded min/max on position, dimension, and frame sliders
- Works with new unbounded slider defaults

Viewer:
- Re-enable default antialias on WebGPU renderer
- Remove GroundOccluder (no longer needed)
- Add resize debounce (100ms)
- Clean up post-processing pipeline code
2026-03-26 15:51:37 -04:00
PascalandGitHub d287428599 fix: README badge colors (#186)
- Remove hardcoded red from npm badges (use shields.io defaults)
- Switch Discord badge to static 'Join Server' (avoids widget dependency)
2026-03-26 15:39:40 -04:00
nnhhoang 5801ce0270 fix: implement T key for counter-clockwise rotation on selected nodes
The keyboard shortcuts dialog documents T as counter-clockwise rotation,
and it works during placement/move mode, but was missing for already
selected nodes. R (clockwise) worked in all contexts but T did not.
2026-03-26 15:24:54 +07:00
PascalandGitHub 81dff06d2a docs: add badges and contributors to README (#181)
- Add license, npm (core + viewer), and Discord badges at the top
- Add contributors section (Aymeric, Wassim) at the bottom
- Add Trendshift #1 trending badge at the bottom
2026-03-26 01:19:36 -04:00
a5378da020 feat: add STL and OBJ export formats (#175)
Extend the export manager to support STL and OBJ formats in addition to
the existing GLB export. Uses Three.js built-in STLExporter and
OBJExporter - no new dependencies.

STL is the standard format for 3D printing. OBJ is widely used in
rendering pipelines and supports basic materials. Both are requested
in the community discussion on #145.

Changes:
- export-manager.tsx: add STLExporter and OBJExporter, accept format param
- settings-panel: three format-specific export buttons (GLB, STL, OBJ)
- use-viewer store: update exportScene type to accept optional format

The format parameter defaults to 'glb', so existing callers (command
palette) continue to work without changes.

Relates to #145

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 00:30:34 -04:00
7d4c8b6bd4 fix: resolve state management issues and memory leaks (#152)
This commit fixes several issues in the core state management:

1. Fix deleteNodesAction recursive call issue
   - Previously, the function recursively called get().deleteNodes()
     inside the set() callback, which could cause state inconsistencies.
   - Now collects all descendant IDs first in a separate pass, then
     deletes them all in a single batch operation.

2. Fix memory leak in use-scene temporal tracking
   - Module-level variables (prevPastLength, prevFutureLength,
     prevNodesSnapshot) persisted across store re-creations.
   - Now cleared in unloadScene() to release stale node references.
   - Added clearTemporalTracking() helper function.

3. Remove unused variable in wall-system
   - Removed debug variable 'useFrameNb' that was declared but never used.

4. Fix requestAnimationFrame in updateNodesAction
   - Previously used RAF without cleanup, causing multiple queued
     callbacks when updates happened rapidly.
   - Now uses a single tracked RAF with cancellation support.

Co-authored-by: hobostay <hobostay@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:30:16 -04:00
Thiago LöpesandGitHub e4e64e22e3 fix: use WALL_MIN_LENGTH constant to prevent ghost walls (#168)
* Increase minimum wall length from 0.01 to 0.5

* fix: use WALL_MIN_LENGTH constant in wall-tool.tsx
2026-03-26 00:30:04 -04:00
04e9feb78e fix: remove unused @ts-expect-error directive (#150)
TypeScript now correctly types process.env, making the suppression
directive invalid and causing tsc --build to fail.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 00:29:57 -04:00
John Doe 9a0950dd90 style: reorder imports 2026-03-26 00:24:45 -04:00
PascalandGitHub 49c045e861 chore: add community templates, simplify setup, fix lockfile (#177) 2026-03-25 21:20:25 -07:00
John Doeandfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> b47d4a6a15 revert: remove test clone scene button from settings panel
Reverts changes from commit a87fe56d53
to remove the Test Clone Scene functionality from the settings panel.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-03-25 23:57:40 -04:00
John Doe 8731da9afa fix: childern <> parent link 2026-03-25 23:43:25 -04:00
John Doeandfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> a87fe56d53 fix: clear collections in setScene and apply cloned collections in test button
- setScene now clears collections to avoid stale references
- Test clone button applies cloned collections after setScene

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-03-25 22:33:07 -04:00
John Doe de9eb6fa78 feat: add scene graph cloning utility 2026-03-25 22:05:07 -04:00
yashinode 6d964e5e9f feat: add street view mode with FPS-style walkthrough
Adds a first-person walkthrough mode so you can explore your home
from the inside at eye level. WASD to move, mouse to look around,
Q/E to float up/down. Press ESC to exit.
2026-03-25 15:23:44 +00:00