mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Alignment api update (#6817)
* Some basic COGO survey points functions * Update alignment api Includes defining alignment segment by segment, automatic geometry definitions, and automatric stationing and referents * Fixes bonsai import alignment from csv * Adds DMS angle conversion functions to COGO api * Updated per @civilx64 review comments * Fixes problem with segment representations * Fixes problem with segment transition codes * Allows for compound vertical and horizontal curves * Implements callbacks for referent naming * Renames angle_from_bearing to bearing2dd for consistency with ifcopenshell.util.geolocation.dms2dd. Removes angle_from_dms because it duplicates dms2dd * Documents register_referent_name_callback * Fixes all sorts of problems with Cant/SegRefCurve implementation * refactor referent unit tests to use a fixture for test setup * lint with black --------- Co-authored-by: Scott Lecher <civilx64@gmail.com>
This commit is contained in:
@@ -45,6 +45,10 @@ def get_basis_curve(alignment: entity_instance) -> entity_instance:
|
||||
representation.RepresentationIdentifier == "FootPrint" and representation.RepresentationType == "Curve2D"
|
||||
):
|
||||
axis = representation
|
||||
break
|
||||
return None if axis.Items == None or len(axis.Items) == 0 else axis.Items[0]
|
||||
|
||||
return None if axis == None or axis.Items == None or len(axis.Items) == 0 else axis.Items[0]
|
||||
if axis == None and 0 < len(alignment.Decomposes):
|
||||
parent_alignment = alignment.Decomposes[0].RelatingObject
|
||||
return get_basis_curve(parent_alignment)
|
||||
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user