Overview
TheRoofNode represents a gable roof structure. It is defined by a ridge line with configurable left and right slope widths, creating an asymmetric or symmetric pitched roof.
Key features:
- Gable roof geometry with ridge line
- Configurable left and right slope widths
- Adjustable peak height and roof length
- Position and rotation control
Type Signature
/home/daytona/workspace/source/packages/core/src/schema/nodes/roof.ts
Fields
Inherited from BaseNode
Unique roof identifier.Format:
roof_{randomString}Example: "roof_a1b2c3d4e5f6g7h8"Always set to
"roof".Default: "roof"Optional name for the roof.Example:
"Main Building Roof", "Gable Roof A"Reference to the parent building or level’s ID.Example:
"building_abc123"Default: nullControls roof visibility.Default:
trueOptional camera viewpoint for the roof.
Custom metadata for the roof.Default:
{}Roof-Specific Fields
Center position of the roof in 3D space.Format:
[x, y, z] in metersDefault: [0, 0, 0]Example: [10, 3, 5]The Y coordinate should typically be set to the top of the walls where the roof begins.Rotation around the Y axis in radians.Default:
0Example: 0 (no rotation), Math.PI / 2 (90° rotation)This controls the orientation of the ridge line.Length of the roof along the ridge direction in meters.Default:
4Example: 8 (8-meter long ridge)This determines how long the roof extends along the ridge line.Height of the roof peak from the base in meters.Default:
1.5Example: 2.0 (2-meter peak height)This defines the vertical distance from the base (eaves) to the ridge (peak).Horizontal width of the left slope in meters, measured from the ridge to the eave.Default:
1.5Example: 2.5 (2.5-meter left slope)This is the horizontal projection of the left slope, not the actual slant length.Horizontal width of the right slope in meters, measured from the ridge to the eave.Default:
1.5Example: 2.5 (2.5-meter right slope)This is the horizontal projection of the right slope, not the actual slant length. For a symmetric gable roof, set leftWidth equal to rightWidth.Example
Usage
Creating a Symmetric Gable Roof
Creating an Asymmetric Gable Roof
Creating a Steep Pitched Roof
Creating a Shallow Pitched Roof
Rotated Roof
Roof Geometry
The roof is rendered as a gable (two-slope) structure:- Ridge: Peak line running along the length
- Left Slope: Plane from ridge to left eave
- Right Slope: Plane from ridge to right eave
- Total Width:
leftWidth + rightWidth
Calculating Roof Pitch
The pitch (slope angle) of each side can be calculated:Coordinate System
Roofs use 3D coordinates:- X axis: horizontal (left-right)
- Y axis: vertical (up-down)
- Z axis: horizontal (front-back)
- Rotation: around Y axis (vertical)
Related
- BaseNode - Inherited base fields
- BuildingNode - Parent node containing roofs
- LevelNode - Levels that roofs cover