-
-
Notifications
You must be signed in to change notification settings - Fork 823
Alignments API
Overall goal: Keep it simple - develop an api for horizontal and vertical roadway/highway alignments. Add rail (i.e. cant) later knowing that doing so may require breaking changes to the api.
Namespace: api.alignment
Would it be better to have alignment and vertical profile class/object rather than a bunch of functions? One benefit would be to automatically end with the zero-length segments when the alignment is added to a model.
These are the lowest level creation, editing functions. The higher-level functions will be implemented by calling these functions.
def create_alignment()
Creates an IfcAlignment along with an empty IfcAlignmentHorizontal nested to the alignment with IfcRelNests. This is the first function to call because all the segment functions need the alignment to which segments are added. An IfcCompositeCurve geometric representation is also created. The composite curve does not contain any IfcCurveSegment. It is expected that you will call add_segment
to populate the alignment and end_alignment
to create the zero-length ending segment
def end_alignment(alignment)
Ends the alignment by adding the zero-length segment. If a geometric representation is associated with the alignment, the zero length segment is added as well. End point and tangent direction is computed from last segment. Use add_segment
to manually end an alignment.
def add_segment(alignment,segment_parameters)
Adds a segment to the alignment. An IfcCurveSegment is created and added to the IfcCompositeCurve.
alignment is an IfcAlignmentHorizontal, IfcAlignmentVertical, or IfcAlignmentCant.
segment_parameters are the IfcAlignmentSegment parameters
def edit_segment(segment,segment_parameters)
Revises the parameters of a previously defined segment.
Don’t love this function - how will the segments before and after this segment be adjusted to maintain end-start point continuity and tangential continuity?
def create_horizontal_alignment_from_tangents_and_radii(file,optional:name,optional:description,array[x,y] points, array[double] radii)
Adds a horizontal alignment to the file points = array of PB, PIs, EP (begin point, intersection points, end point) radii = array of curve radii (must be >=0, 0 means angle point), radii.size() = points.size() - 2)
Maybe this function returns an alignment object rather than building the alignment in the file. The returned alignment object can then modified with additional edits. Once editing is done, we would then call a function add_alignment_to_file(file,alignment)
or alignment.add_to_file(file)
. This could automatically add the zero-length segments, if not previously defined.
def add_alignment(file,optional:name,optional:description,array[x,y] points, array[double] radii, array[d,z] vpoints, array[double] vclength)
Maybe don’t want this function-see next function
Adds a horizontal and vertical aligment ot the file points = array of PB, PIs, EP radii = array of curve radii (must be >=0, 0 means angle point), radii.size() = points.size()-2) vpoints = array of VPB, VPIs, and VEP (vertical begin point, vertical PIs, vertical end point) vclength = array of vertical curve lengths (must be >= 0, 0 means angle point, vclength.size() = vpoints.size()-2)
def add_vertical_alignment_with_gradients_and_parabolic_transitions(file,optional:name,optional:description,alignment,array[d,z] vpoints, array[double] vclength)
Adds a profile to a previously defined alignment. Automatically creats IfcGradientCurve if alignment as an associated IfcCompositeCurve vpoints = array of VPB, VPIs, and VEP vclength = array of vertical curve lengths (must be >= 0, 0 means angle point, vclength.size() = vpoints.size()-2)
def create_alignment_representation(file,alignment)
Creates the geometric representation for horizontal and, if present, vertical alignment. Creates IfcCompositeCurve and 0 or more IfcGradientCurve. Does not create if they already exist. This would be a useful function for alignments read in from an IFC file that don't have geometric representations.
def remove_alignment(file,alignment)
Removes alignment from the file. Removes all nested alignment segments unless the segment is nested into other alignments. Removes IfcCompositeCurve and IfcCurveSegment if associated with the alignment (only removes IfcCurveSegment if not used by other IfcCompositeCurve). Removes all nested IfcGradientCurve, if not nested into other IfcGradientCurve.
def remove_profile(file,alignment,profile)
Removes a profile from an alignment. Removes geometric representation if applicable. Removes nested segments and IfcCurveSegment if not used by others.
We should probably have some edit functions, but I think this will be a little tricky with the geometry caching implemented in IFCOS. For now, I think editing should be done by remove and create. Maybe we need some get functions that return the point and radii arrays for a previously created alignment.
def add_stationing(file,alignment,start_station,optional:increment)
Creates an IfcReferent .STATION. with Pset_Stationing and positions it at the start of the alignment. If increment is provided, IfcReferent with .REFERENCEMARKER. are created along the alignment at the specified increment. Short IfcAnnotation lines perpendicular to the alignment are created for visual representation.
def add_alignment_referents(file,alignment)
Defines IfcReferent .REFERENCEMARKER. for key points along the horizontal alignment such as TS, SC, PC, CS, PT, and ST This isn't well thought out yet. Maybe do the same for vertical profile in the same or in a different function The remove functions defined above would remove IfcReferent entities if the parent alignment/profile are removed.