You are here: Start » FIL.NET » Function Reference » Geometry 2D » Geometry 2D Normalizations » FIL.NormalizeSegmentOrientation_ByPointDistance
Changes orientation of the given segment according to distance to the given point.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
C++
C#
public static void NormalizeSegmentOrientation_ByPointDistance ( FilNet.Segment2D inSegment, FilNet.Point2D inReferencePoint, out FilNet.Segment2D outSegment )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inSegment | FilNet.Segment2D | |||
![]() | inReferencePoint | FilNet.Point2D | A point relative to which distances are measured. | ||
![]() | outSegment | FilNet.Segment2D | A segment in which the first point is closer to inReferencePoint. |
Description
This operation changes the orientation of the inSegment segment according to the distance between the input segment's vertices and given inReferencePoint. The resulting segment has the first vertex closer to the inReferencePoint.
Examples
Let's consider two cases with the same input segment, but different inReferencePoint.
The coordinates of the segment are as follows:
inSegment.Point1.X | 99,000 |
inSegment.Point1.Y | 100,000 |
inSegment.Point2.X | 200,000 |
inSegment.Point2.Y | 201,000 |
-
Let's assume the inReferencePoint to have coordinates X = 99, Y = 0.
The distance between the first vertex of the segment (X = 99, Y = 100) is equal to 100, whereas the distance between the second vertex of the segment (X = 200, Y = 201) is about 225. That means the first vertex is closer to the inReferencePoint, so the resulting segment will have the same coordinates as the input segment. -
Now, let's assume the inReferencePoint to have coordinates X = 300, Y = 201.
The distance between the first vertex of the segment (X = 99, Y = 100) is about 225, whereas the distance between the second vertex of the segment (X = 200, Y = 201) is equal to 100. That means the second vertex is closer to inReferencePoint, so the resulting segment will have reversed vertices. Their coordinates will be as follows:inSegment.Point2.X 200,000 inSegment.Point2.Y 201,000 inSegment.Point1.X 99,000 inSegment.Point1.Y 100,000