Polyline3D Type
A mutable 3D Polyline. If the last point is the same as the first point, the Polyline3D is closed.
Record fields
Record Field |
Description
|
Gets the internal list of all Points of the Polyline3D. This is not a copy, so changes to the list will be reflected in the Polyline3D.
|
Instance members
Instance member |
Description
|
|
Gets the a bounding box of the Polyline3D
|
Full Usage:
this.CloseIfOpen
Parameters:
float
|
Close the Polyline2D if it is not already closed. If the ends are closer than the tolerance. The last point is set to equal the first point. Else the start point is added to the end of the Polyline2D.
|
|
Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
|
|
|
Returns the distance of the test point to the closest point on the Polyline3D.
|
|
Creates a copy of the Polyline3D
|
Gets last or end point of the Polyline3D
|
|
|
Returns the point at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 . If the parameter is within 1e-6 of an integer value, the integer value is used as parameter.
|
Full Usage:
this.IsAlmostClosed
Parameters:
float
Returns: bool
|
Tests if Polyline3D is closed within given tolerance.
|
Full Usage:
this.IsClosed
Returns: bool
Modifiers: inline |
Tests if Polyline3D start and end points are exactly the same.
|
Full Usage:
this.IsCounterClockwiseIn2D
Returns: bool
|
Test if Polyline3D is CounterClockwise when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is positive the Polyline3D is CCW.
|
Full Usage:
this.Length
Returns: float
|
Gets the length of the Polyline3D
|
Full Usage:
this.PointCount
Returns: int
Modifiers: inline |
Gets the count of points in the Polyline3D
|
|
Returns new Polyline3D in reversed Order.
|
Full Usage:
this.ReverseInPlace
|
Reverse order of the Polyline3D in place. |
|
Gets first point of the Polyline3D
|
|
Returns the Unitized Tangent at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
Static members
Static member |
Description
|
Full Usage:
Polyline3D.closestParameter pl pt
Parameters:
Polyline3D
pt : Pnt
Returns: float
Modifiers: inline |
Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at point count.
|
Full Usage:
Polyline3D.closestPoint pl pt
Parameters:
Polyline3D
pt : Pnt
Returns: Pnt
Modifiers: inline |
Returns the point on the Polyline3D that is the closest point to the given point.
|
|
|
Full Usage:
Polyline3D.createDirectlyUnsafe points
Parameters:
ResizeArray<Pnt>
Returns: Polyline3D
|
Create a new Polyline3D by using the provided ResizeArray directly. All later changes to the ResizeArray will be reflected in the Polyline3D.
|
|
Create a new empty Polyline3D without any points. But predefined capacity.
|
Full Usage:
Polyline3D.distanceTo pl pt
Parameters:
Polyline3D
pt : Pnt
Returns: float
Modifiers: inline |
Returns the distance of the test point to the closest point on the Polyline3D.
|
|
|
Full Usage:
Polyline3D.evaluateAt t pl
Parameters:
float
pl : Polyline3D
Returns: Pnt
Modifiers: inline |
Returns the point at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at point count.
|
|
Returns the index of an outer corner and. a normal vector corresponding to an Counter-Clockwise view on the loop. This is used to calculate the RefNormal vector for the offset function. The input vectors are the vectors for each segment of the polyline. From first and second point up to last and first point.
|
Full Usage:
Polyline3D.map mapping pl
Parameters:
Pnt -> Pnt
pl : Polyline3D
Returns: Polyline3D
|
Apply a mapping function to each point in the 3D Polyline. Returns new Polyline3D.
|
Full Usage:
Polyline3D.move v pl
Parameters:
Vec
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Move a Polyline3D by a vector. (same as Polyline3D.translate)
|
Full Usage:
Polyline3D.moveX distance pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Returns a Polyline3D moved by a given distance in X direction.
|
Full Usage:
Polyline3D.moveY distance pl
Parameters:
double
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Returns a Polyline3D moved by a given distance in Y direction.
|
Full Usage:
Polyline3D.moveZ distance pl
Parameters:
double
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Returns a Polyline3D moved by a given distance in Z direction.
|
Full Usage:
Polyline3D.offset (polyLine, offsetDistance, ?normalDistance, ?loop, ?refNormal)
Parameters:
Polyline3D
-
A 3D Polyline.
offsetDistance : float
-
The offset distance for all segments of the polyline. A positive distance offsets inwards in corners, a negative offset outwards.
?normalDistance : float
-
Optional, The normal distance defined as a perpendicular offset for all corners.
?loop : bool
-
Consider last point and first point to be from a closed loop, even if they are not at the same location.
?refNormal : Vec
-
Optional. An approximate orientation Normal to help find the correct offset side,
if given it doesn't need to be calculated anymore. This speeds up the algorithm.
To be in Z Axis orientation for Counter-Clockwise loops in 2D.
Returns: Polyline3D
A list of points that has the same length as the input list.
|
Offsets a Polyline in 3D space by finding the local offset in each corner. Auto detects if given points are from a closed Polyline (first point = last point) and loops them. Does not fail on colinear or duplicate points.
|
Full Usage:
Polyline3D.offset (polyLine, offsetDistances, ?normalDistances, ?loop, ?refNormal, ?obliqueOffsets)
Parameters:
Polyline3D
-
A 3D Polyline.
offsetDistances : float seq
-
The parallel offset distances for each segment of the polyline.
A positive distance offsets inwards in corners, a negative offset outwards.
For open and closed polylines this list of distances must have one item less than number of points in the polyline.
Except if the polyline is open and the loop parameter is set to true. Then points and distances list shall have the same count.
A empty list for no offset or singleton for constant offset is allowed too.
?normalDistances : float
-
Optional. Normal distances defined as a perpendicular offset at each corner.
Unlike offsetDistances this list of distances must have the same item count as number of points in the polyline.
Except if the input polyline is already closed. Then distances list shall have one less. (independent of 'loop' parameter)
A empty list for no normal offset or singleton for constant offset is allowed too.
?loop : bool
-
Optional. Consider last point and first point to be from a closed loop, even if they are not at the same location.
?refNormal : Vec
-
Optional. An approximate orientation Normal to help find the correct offset side,
if given it doesn't need to be calculated anymore. This speeds up the algorithm.
To be in Z Axis orientation for Counter-Clockwise loops in 2D.
?obliqueOffsets : bool
-
Optional. When two adjacent segments are colinear but have different offset distances there is no solution with a parallel offset.
By default an exception is raised. Set this to true to create and averaged oblique offset instead of failing.
Returns: Polyline3D
A list of points that has the same length as the input list.
|
Offsets a Polyline in 3D space by finding the local offset in each corner. Auto detects if given points are from a closed Polyline (first point = last point) and loops them. Does not fail on colinear or duplicate points.
|
Full Usage:
Polyline3D.offsetCore (pts, offD, normD, referenceNormal, fixColinearLooped, allowObliqueOffsetOnColinearSegments)
Parameters:
ResizeArray<Pnt>
offD : IList<float>
normD : ResizeArray<float>
referenceNormal : Vec
fixColinearLooped : bool
allowObliqueOffsetOnColinearSegments : bool
Returns: ResizeArray<Pnt>
|
The inner core routine of Points.offset. This function considers input a closed polyline. Start point and end point may not be equal, all arrays must be of the same length. 'referenceNormal' to be in Z Axis for Counter-Clockwise loops in 2D or if it is Vec.Zero it wil be calculated add hoc.
|
Full Usage:
Polyline3D.pointsUnsafeInternal p
Parameters:
Polyline3D
Returns: ResizeArray<Pnt>
Modifiers: inline |
Gets the internal list of all Points of the Polyline3D. This is not a copy, so changes to the list will be reflected in the Polyline3D.
|
|
|
|
Reverse order of the Polyline3D in place.
|
Full Usage:
Polyline3D.rotate r pl
Parameters:
Rotation2D
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
|
Full Usage:
Polyline3D.rotateWithCenter cen r pl
Parameters:
Pnt
r : Rotation2D
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Rotation a Polyline3D round given Center point an a local Z-axis.
|
Full Usage:
Polyline3D.segment a b pl
Parameters:
float
b : float
pl : Polyline3D
Returns: Polyline3D
|
Returns new Polyline3D from point at Parameter a to point at Parameter b. if 'a' is bigger 'b' then the new Polyline3D is in opposite direction. If a parameter is within 1e-4 of an integer value, the integer value is used as parameter.
|
|
|
Full Usage:
Polyline3D.transform m pl
Parameters:
Matrix
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
|
Full Usage:
Polyline3D.translate v pl
Parameters:
Vec
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Move a Polyline3D by a vector. (same as Polyline3D.move)
|