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:
Richard Brice
2025-07-08 10:09:14 -07:00
committed by GitHub
parent ad8d02bfed
commit 40f92d15c3
76 changed files with 3645 additions and 1839 deletions
@@ -123,6 +123,23 @@ def print_alignment(alignment, indent=0):
print_alignment(child, indent + 2)
def print_alignment_deep(alignment, indent=0):
"""
Debugging function to print alignment decomposition, including layout segments
"""
print(" " * indent, alignment)
for rel in alignment.IsNestedBy:
for child in rel.RelatedObjects:
print_alignment_deep(child, indent + 2)
if child.is_a("IfcAlignmentSegment"):
print(" " * (indent + 4), child.DesignParameters)
for agg in alignment.IsDecomposedBy:
for child in agg.RelatedObjects:
print_alignmen_deep(child, indent + 2)
def print_composite_curve(curve):
"""
Debugging function to print composite curve segments
@@ -131,3 +148,17 @@ def print_composite_curve(curve):
for segment in curve.Segments:
print(" " * 2, segment)
def print_composite_curve_deep(curve):
"""
Debugging function to print composite curve segments, including curve segment details
"""
print(str(curve)[0:100])
for segment in curve.Segments:
print(" " * 2, segment)
print(" " * 4, segment.ParentCurve)
print(" " * 4, segment.Placement)
print(" " * 4, segment.Placement.Location)
print(" " * 4, segment.Placement.RefDirection)