Skip to content

Extensions

Mixins injected into generated models. See Extensions.

Geometry

Surface geometry

Base mixin providing geometry properties from vertices_as_tuples.

area property

area: float

Surface area in m².

normal property

normal: tuple[float, float, float]

Outward unit normal vector.

centroid property

centroid: tuple[float, float, float]

Centroid (arithmetic mean of vertices).

tilt property

tilt: float

Tilt angle in degrees — 0 = up, 90 = vertical wall, 180 = down.

azimuth property

azimuth: float

Azimuth in degrees, clockwise from north (N=0, E=90, S=180, W=270).

perimeter property

perimeter: float

Polygon perimeter in m.

bounding_box property

bounding_box: tuple[
    tuple[float, float, float], tuple[float, float, float]
]

Axis-aligned bounding box ((xmin, ymin, zmin), (xmax, ymax, zmax)).

is_convex property

is_convex: bool

Whether the planar polygon is convex.

Geometry functions

Pure geometry functions for 3-D polygons (Newell's method).

polygon_normal

polygon_normal(
    vertices: Sequence[Vertex3D],
) -> tuple[float, float, float]

Compute the surface normal of a 3-D polygon using Newell's method.

Returns the unit normal vector. For a degenerate polygon (all collinear vertices) the zero vector (0, 0, 0) is returned.

polygon_area_3d

polygon_area_3d(vertices: Sequence[Vertex3D]) -> float

Compute the area of a planar 3-D polygon using Newell's method.

The polygon does not need to be convex.

polygon_centroid

polygon_centroid(
    vertices: Sequence[Vertex3D],
) -> tuple[float, float, float]

Compute the centroid (arithmetic mean of vertices) of a 3-D polygon.

polygon_tilt

polygon_tilt(vertices: Sequence[Vertex3D]) -> float

Compute the tilt angle (degrees) between outward normal and +Z axis.

0° means the surface faces straight up (roof/ceiling exterior), 90° is vertical (wall), and 180° faces straight down (floor exterior). Returns 0.0 for degenerate polygons. Range [0, 180].

polygon_azimuth

polygon_azimuth(vertices: Sequence[Vertex3D]) -> float

Compute the surface azimuth (degrees), clockwise from north (+Y).

Follows the EnergyPlus convention: N=0, E=90, S=180, W=270. The angle is derived from the projection of the outward normal onto the XY plane. Purely horizontal surfaces have an undefined azimuth and return 0.0. Range [0, 360).

polygon_perimeter

polygon_perimeter(vertices: Sequence[Vertex3D]) -> float

Compute the perimeter of a closed polygon as the sum of edge lengths.

Returns 0.0 for degenerate inputs with fewer than 3 vertices.

polygon_bounding_box

polygon_bounding_box(
    vertices: Sequence[Vertex3D],
) -> tuple[Vertex3D, Vertex3D]

Compute the axis-aligned bounding box of a 3-D polygon.

Returns ((xmin, ymin, zmin), (xmax, ymax, zmax)). For an empty vertex list both corners are the origin (0, 0, 0).

polygon_is_convex

polygon_is_convex(vertices: Sequence[Vertex3D]) -> bool

Return True if the planar polygon is convex.

Walks each vertex triple and projects the cross product of the incoming/outgoing edges onto the polygon normal. Collinear triples (zero cross product) are tolerated — only a sign flip among non-zero projections indicates a reflex vertex. Degenerate polygons (fewer than 3 vertices, or a zero normal) return False.

Construction

ConstructionLayersMixin

Ordered layer access and window/opaque classification.

layers property

layers: list[MaterialNameTarget]

Materials from outside to inside (see construction_layers).

is_window_construction property

is_window_construction: bool

Whether every layer is a window material (glazing, gas or shading).

is_opaque_construction property

is_opaque_construction: bool

Whether no layer is a window material.

Construction functions

Material classification and layer resolution for layered constructions.

is_window_material

is_window_material(material: IDFBaseModel) -> bool

Whether material is a window-material layer (glazing, gas or shading).

construction_layers

construction_layers(
    construction: Construction,
) -> list[MaterialNameTarget]

Resolve the layers of a bound construction.

Parameters:

Name Type Description Default
construction Construction

Construction bound to an IDF container.

required

Returns:

Type Description
list[MaterialNameTarget]

Materials from outside to inside; repeated names yield repeated

list[MaterialNameTarget]

entries and empty layer fields are skipped.

Raises:

Type Description
RuntimeError

If the construction is not bound to an IDF.

LookupError

If a layer name does not resolve to any material.