Skip to main content

Import

Example

Notes

  • Profile points are [x, z] in metres. pitch and ridgeDirection are in degrees. elevation is the height of the eave.
  • A flat roof can have holes. A pitched roof cannot.
  • A hip roof needs a convex footprint.
  • overhang moves the roof edge outward. thickness is measured at a right angle to the roof plane.
  • massStyle fills the volume below the roof planes.
  • The pitch setter keeps the value between 5 and 75 degrees.
  • Start the geometry kernel before you create this object. See Floorkit.
  • This object is live geometry. To save a building, write it in a building model.
Inheritance: extends OPElement implements IShape, IPlaceable, PlanVectorExportable

Constructor

string
string
ElementType.ROOF
PolygonProfile
Wall-line footprint in the world XZ plane (the eave ring is this ring offset outward by overhang). Holes are honored by FLAT only; pitched types throw on holes.
RoofType
number
Slope in degrees from horizontal (GABLE/HIP/SHED). Clamped to 5–75.
number
Horizontal eave overhang beyond the footprint (m).
number
Plate thickness measured perpendicular to the roof plane (m).
number
World Y of the eave (wall plate top).
number
Plan direction of the ridge in degrees (GABLE: edges within 45° of this direction slope; SHED: the high side faces this direction’s left). Defaults to the direction of the footprint’s longest edge.
boolean
When true, build the filled “attic mass” under the roof planes instead of a constant-thickness plate — half the boolean work, and exactly what massing shells need.
number
RoofMaterial
PropertySets

Properties

ElementType
string
Map<string, OPGeometry>
Map<string, OPGeometry>
boolean
boolean
boolean
RoofOptions
string
RoofProfile
RoofType
number
number
number
number
number | undefined
boolean
number
RoofMaterial
boolean
boolean
boolean

Methods

editableSchema

Self-describing editable surface; a host inspector renders this generically.

move

Translate this element by delta (world-space, meters).

rotate

Rotate this element by angleDeg around axis (default Y-up), pivoted at anchor (default the element’s own centroid).

setOPGeometry

getExportRoots

Vector-export roots (RFC §7).

toDrawing

Plan footprint region plus the ridge line (gable) / slope arrow (shed), emitted parametrically.

setOPMaterial

getOPConfig

setOPConfig

beginEdit

Start one live edit; a second beginEdit before endEdit keeps the first start.

endEdit

End the live edit; its exact undo and redo, or undefined when no option changed.

getEditAnchors

Draggable handles: one grip per footprint vertex (move on the XZ plane) and an eave-elevation grip at the footprint centroid (raise/lower along +Y).

applyEditAnchor

dispose

Types

RoofOptions

RoofProfile

Polygon profile for a Roof — alias of PolygonProfile.

RoofType

RoofMaterial

Last modified on October 11, 2026