ifcopenshell.api.geometry.add_railing_representation¶
Module Contents¶
- class ifcopenshell.api.geometry.add_railing_representation.RailingSupport¶
Pure-geometry description of a single wall-mount support.
A support consists of:
A 3-point polyline (base at the handrail, mid-arc, floor end) swept into a cylinder of radius
arc_radius.A short disk extrusion (wall-attachment plate) at the floor end.
All values are in IFC project units.
- arc_polyline: numpy.ndarray¶
- arc_radius: float¶
- disk_depth: float¶
- disk_position: numpy.ndarray¶
- disk_radius: float¶
- disk_z_rotation: float¶
- class ifcopenshell.api.geometry.add_railing_representation.WallMountedHandrailGeometry¶
Pure-geometry description of a wall-mounted handrail.
Decoupled from any IFC entity creation. The shared data structure is consumed by the IFC-representation wrapper and by viewport-only previews in authoring add-ons that need to update mesh state without mutating the IFC file.
All values are in IFC project units.
- handrail_arc_point_indices: list[int]¶
- handrail_polyline: numpy.ndarray¶
- handrail_radius: float¶
- supports: list[RailingSupport] = []¶
- ifcopenshell.api.geometry.add_railing_representation.add_railing_representation(file: ifcopenshell.file, *, context: ifcopenshell.entity_instance, railing_path: ifcopenshell.util.shape_builder.SequenceOfVectors, use_manual_supports: bool = False, support_spacing: float | None = None, railing_diameter: float | None = None, clear_width: float | None = None, terminal_type: TERMINAL_TYPE = '180', height: float | None = None, looped_path: bool = False, unit_scale: float | None = None) ifcopenshell.entity_instance¶
Units are expected to be in IFC project units.
- Parameters:
context – IfcGeometricRepresentationContext for the representation.
railing_path – A list of points coordinates for the railing path, coordinates are expected to be at the top of the railing, not at the center. If not provided, default path [(0, 0, 1), (1, 0, 1), (2, 0, 1)] (in meters) will be used
use_manual_supports – If enabled, supports are added on every vertex on the edges of the railing path. If disabled, supports are added automatically based on the support spacing. Default to False.
support_spacing – Distance between supports if automatic supports are used. Defaults to 1m.
railing_diameter – Railing diameter. Defaults to 50mm.
clear_width – Clear width between the railing and the wall. Defaults to 40mm.
terminal_type – type of the cap, or “NONE” for no cap. Defaults to “180”.
height – defaults to 1m
looped_path – Whether to end the railing on the first point of railing_path. Defaults to False.
unit_scale – The unit scale as calculated by ifcopenshell.util.unit.calculate_unit_scale. If not provided, it will be automatically calculated for you.
- Returns:
IfcShapeRepresentation for a railing.
- ifcopenshell.api.geometry.add_railing_representation.compute_wall_mounted_handrail_geometry(*, railing_path: ifcopenshell.util.shape_builder.SequenceOfVectors, support_spacing: float, railing_diameter: float, clear_width: float, height: float, use_manual_supports: bool = False, terminal_type: TERMINAL_TYPE = '180', looped_path: bool = False, unit_scale: float = 1.0) WallMountedHandrailGeometry¶
Compute pure geometric data for a wall-mounted handrail.
The result can be wrapped into an
IfcShapeRepresentationby the railing-representation API, or converted directly to a Blender bmesh (or any other viewport mesh) for a live preview that does not mutate the IFC file.Geometric inputs (
railing_path,support_spacing,railing_diameter,clear_width,height) are expected in IFC project units.unit_scaleis used only to convert hard-coded millimetre constants (fillet radius, support rod radius, etc.) into project units.Constraints:
railing_pathmust contain at least 2 points.railing_diametermust be > 0.heightmust be ≥railing_diameter / 2(otherwise theTO_FLOOR/TO_END_POST_AND_FLOORcaps extrude upward instead of down).clear_widthmust be > 0 (otherwise the support wraps backward into the wall).
- Parameters:
railing_path – Sequence of 3D points along the top of the handrail (not the centre).
support_spacing – Distance between automatic supports.
railing_diameter – Handrail tube diameter.
clear_width – Clear gap between the wall and the handrail tube.
height – Total railing height (top of handrail to floor).
use_manual_supports – If true, one support is placed on every non-collinear vertex of
railing_path; if false, supports are distributed automatically bysupport_spacing.terminal_type – Style of the terminal end cap, or
"NONE"for no cap. Ignored whenlooped_path=True(no open ends to cap).looped_path – If true, the railing closes on its first point.
unit_scale – Output of
ifcopenshell.util.unit.calculate_unit_scale(). Defaults to 1.0 (i.e. inputs are already in metres).
- ifcopenshell.api.geometry.add_railing_representation.DEFAULT_CLEAR_WIDTH_MM = 40¶
- ifcopenshell.api.geometry.add_railing_representation.DEFAULT_HEIGHT_MM = 1000¶
- ifcopenshell.api.geometry.add_railing_representation.DEFAULT_RAILING_DIAMETER_MM = 50¶
- ifcopenshell.api.geometry.add_railing_representation.DEFAULT_SUPPORT_SPACING_MM = 1000¶
- ifcopenshell.api.geometry.add_railing_representation.HANDRAIL_FILLET_RADIUS_MM = 100¶
- ifcopenshell.api.geometry.add_railing_representation.SUPPORT_ARC_RADIUS_MM = 10¶
- ifcopenshell.api.geometry.add_railing_representation.SUPPORT_DISK_DEPTH_MM = 20¶
- ifcopenshell.api.geometry.add_railing_representation.TERMINAL_RADIUS_MM = 150¶
- ifcopenshell.api.geometry.add_railing_representation.TERMINAL_TYPE¶