Prerequisites
Make sure you’ve completed the installation steps and have both@pascal-app/core and @pascal-app/viewer installed.
Create your first scene
1
Set up the Viewer component
The When you run this, you’ll see an empty 3D scene with a default Site → Building → Level hierarchy. The camera can be controlled with mouse drag (orbit) and scroll (zoom).
Viewer component provides a complete 3D rendering environment with WebGPU, camera controls, lighting, and systems. It fills its parent container, so make sure to set width and height.App.tsx
2
Create a wall
Let’s add a wall to the scene. We’ll use the You should now see a 3D wall rendered in the scene! The wall is 5 meters long, 0.15 meters thick, and 3 meters high.
useScene store to create nodes and the WallNode schema to validate our data.App.tsx
The
WallSystem automatically generates geometry for the wall based on the start/end points, thickness, and height. The geometry is created in the render loop after the node is marked dirty.3
Add multiple walls to create a room
Let’s create a simple rectangular room by adding four walls:You now have a complete room with four walls! Notice how the walls automatically miter at the corners - this is handled by the
App.tsx
WallSystem.4
Add a floor slab
Let’s add a floor to our room using a Your room now has a floor! The
SlabNode:App.tsx
SlabSystem generates geometry from the polygon points.5
Update nodes reactively
Pascal Editor’s state management is reactive. Let’s add a button to change wall height:Click the button and watch the walls grow! The
App.tsx
WallSystem automatically regenerates geometry when nodes are updated.Understanding the code
Node creation pattern
All nodes follow this pattern:- Parse with schema -
WallNode.parse({ ... })validates the data and generates an ID - Create in store -
scene.createNode(node, parentId)adds it to the scene - System generates geometry -
WallSystemdetects the dirty node and creates Three.js geometry
Accessing state
There are two ways to access state: In React components (subscribes to changes):Scene hierarchy
Nodes are stored flat but organized hierarchically:Next steps
Core concepts
Deep dive into nodes, systems, and state management
Node types
Explore all available node types and their properties
Event handling
Learn how to handle user interactions with the event bus
Custom systems
Build your own geometry systems
Common patterns
Finding nodes by type
Listening to node events
Changing viewer settings
Batch node updates
Batch operations are more efficient than individual updates as they trigger a single state update.