mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
See #1227. Fix slicing normal calculation for AXIS3 elements.
This commit is contained in:
@@ -463,10 +463,19 @@ def get_material_style(
|
||||
return style
|
||||
|
||||
|
||||
def get_reference_line(wall: ifcopenshell.entity_instance, fallback_length: float = 1.0):
|
||||
def get_reference_line(wall: ifcopenshell.entity_instance, fallback_length: float = 1.0) -> list[npt.NDArray]:
|
||||
"""Fetch the reference axis that goes in the +X direction
|
||||
|
||||
A base line will then be offset from this reference line based on the
|
||||
material usage. From that base line, the layer thicknesses will offset
|
||||
again, and be extruded to form the body representation.
|
||||
|
||||
:param wall: ifcopenshell.entity_instance
|
||||
:param fallback_length: If there is no reference axis, assume it starts at
|
||||
the object placement (i.e. 0.0, 0.0) and extends for this fallback
|
||||
length along the +X axis.
|
||||
:return: A list of two 2D coordinates representing the start and end of the
|
||||
axis. The axis always goes in the +X direction.
|
||||
"""
|
||||
if axis := ifcopenshell.util.representation.get_representation(wall, "Plan", "Axis", "GRAPH_VIEW"):
|
||||
for item in ifcopenshell.util.representation.resolve_representation(axis).Items:
|
||||
|
||||
Reference in New Issue
Block a user