Polyline3D Type
A class holding a list of 3D points representing a mutable 3D Polyline. If the last point is the same as the first point, the Polyline3D is closed. The source-of-truth storage is an interleaved float buffer: x0, y0, z0, x1, y1, z1, ...
Constructors
| Constructor |
Description
|
|
Create a new Polyline3D by copying the provided sequence of points into a flat array.
|
|
Create a new empty Polyline3D with predefined point count capacity.
|
Instance members
| Instance member |
Description
|
|
Adds a point to the end of the Polyline3D.
|
Full Usage:
this.AddXYZ
Parameters:
float
y : float
z : float
|
Adds a point from x, y, and z coordinates.
|
Full Usage:
this.AreaIn2D
Returns: float
|
Calculates the area of the Polyline3D when projected in 2D. Z values are ignored. The segment from the last point to the first point is included in the area calculation. For self intersecting Polylines the result is invalid.
|
Full Usage:
this.AsFSharpCode
Returns: string
|
Format this 3D polyline into an F# code string that can be used to recreate the polyline.
|
|
Converts the float buffer of the Polyline3D into a list of Points. Use .XYZs to access the live internal buffer.
|
Full Usage:
this.AsString
Returns: string
|
Format Polyline3D into string including its length.
|
|
Returns the average normal vector of the Polyline3D. It is calculated by summing up the cross products of all segments around the center point. Does not check for bad input, may be zero length if points are colinear.
|
|
Gets the bounding box of the Polyline3D.
|
|
Returns the average center of all points of the Polyline3D.
|
|
Creates a copy of the Polyline3D. Same as polyline.Duplicate()
|
Full Usage:
this.CloseInPlace
Parameters:
float
|
Close the Polyline3D if it is not already closed. If the ends are closer than the tolerance, the last point is set equal to the first point. Otherwise the start point is added to the end of the Polyline3D. The default tolerance is 1e-6
|
|
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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 . 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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
Full Usage:
this.ClosestParameterXYZ
Parameters:
float
y : float
z : float
Returns: float
|
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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
|
|
|
Returns the index into the Polylines point list of the point that is closest to the given point.
|
|
Returns the distance of the test point to the closest point on the Polyline3D.
|
Full Usage:
this.DistanceToXYZ
Parameters:
float
y : float
z : float
Returns: float
|
Returns the distance of the test point to the closest point on the Polyline3D.
|
|
Creates a copy of the Polyline3D Same as polyline.Clone()
|
Gets or sets last or end point of the Polyline3D This is the point at index Points.Count - 1. Same as Polyline3D.LastPoint
|
|
|
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 from 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.
|
|
Gets or sets the first point of the Polyline3D. This is the point at index 0. Same as Polyline3D.Start
|
|
Gets the first segment of the Polyline3D.
|
|
Gets the point at the given position. (does Pnt(xyzs.[position * 3], xyzs.[position * 3 + 1], xyzs.[position * 3 + 2]) internally)
|
|
|
Full Usage:
this.GetX
Parameters:
int
Returns: float
|
Gets the x coordinate of the point at the given position. (does xyzs.[position * 3] internally)
|
Full Usage:
this.GetY
Parameters:
int
Returns: float
|
Gets the y coordinate of the point at the given position. (does xyzs.[position * 3 + 1] internally)
|
Full Usage:
this.GetZ
Parameters:
int
Returns: float
|
Gets the z coordinate of the point at the given position. (does xyzs.[position * 3 + 2] internally)
|
Full Usage:
this.IsAlmostClosed
Parameters:
float
Returns: bool
|
Tests if Polyline3D is closed within given tolerance. Returns False if the Polyline3D has less than 3 points.
|
Full Usage:
this.IsClockwiseIn2D
Returns: bool
|
Test if Polyline3D is Clockwise 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 negative the Polyline3D is Clockwise.
|
Full Usage:
this.IsClosed
Returns: bool
|
Tests if Polyline3D start and end points are exactly the same. Returns False if the Polyline3D has less than 3 points.
|
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.
|
|
Gets or sets the last point of the Polyline3D. This is the point at index Points.Count - 1. Same as Polyline3D.End
|
|
Gets the last segment of the Polyline3D.
|
Full Usage:
this.Length
Returns: float
|
Gets the length of the Polyline3D Returns 0.0 if there are less than 2 points.
|
|
|
|
|
|
|
|
|
Full Usage:
this.PointCount
Returns: int
|
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. |
|
Multiplies (or applies) a Quaternion to the Polyline3D. The polyline is rotated around the World Origin.
|
|
|
|
Rotation a Polyline3D round given center point an a local Z-axis.
|
|
Multiplies (or applies) a Quaternion to the Polyline3D to rotate around a given center point.
|
|
Scales the 3D polyline by a given factor. Scale center is World Origin 0,0,0
|
|
Scales the 3D polyline by a given factor on a given center point
|
|
Gets or sets the second last point of the Polyline3D.
|
|
Gets or sets the second point of the Polyline3D. This is the point at index 1.
|
Full Usage:
this.SegmentCount
Returns: int
|
Gets the count of segments in the Polyline3D This is poly.Points.Count - 1
|
|
Returns the line vectors of all segments of the Polyline3D as a list of Vec. The length of the list is one less than the point count.
|
Full Usage:
this.SegmentVectorsXYZ
Returns: ResizeArray<float>
|
Returns the line vectors of all segments of the Polyline3D as a flat list of x, y, and z components. The length of the list is 3 less than the xyzs count, so one less vector than points in the polyline.
|
|
Returns all segments of the Polyline3D as a list of Line3D.
|
|
Sets the point at given position to the given point. ( sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)
|
Full Usage:
this.SetPointXYZ
Parameters:
int
x : float
y : float
z : float
|
Sets the x, y, and z coordinates of the point at the given index. NOTE: setting the first or last point on a closed Polyline3D might open it. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally )
|
Full Usage:
this.SetPointXYZClosed
Parameters:
int
x : float
y : float
z : float
|
Sets the x, y, and z coordinates of the point at the given position. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the position is out of range. (sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)
|
Full Usage:
this.SignedAreaIn2D
Returns: float
|
Calculates the signed area of the Polyline3D 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. Raises an error on an empty Polyline3D.
|
|
Gets or sets first point of the Polyline3D This is the point at index 0. Same as Polyline3D.FirstPoint
|
|
|
|
|
Full Usage:
this.XYZs
Returns: ResizeArray<float>
|
Gets the X, Y and Z interleaved ResizeArray of the Polyline3D: x0, y0, z0, x1, y1, z1, ... This is the live internal buffer, so changes to the list will be reflected in the Polyline3D.
|
Static members
| Static member |
Description
|
|
Adds a point to the end of the Polyline3D.
|
Full Usage:
Polyline3D.addXYZ x y z p
Parameters:
float
y : float
z : float
p : Polyline3D
Modifiers: inline |
Adds a point from x, y, and z coordinates.
|
|
Calculates the area of the Polyline3D when projected in 2D. Z values are ignored. The segment from the last point to the first point is included in the area calculation. For self intersecting Polylines the result is invalid.
|
Full Usage:
Polyline3D.asFSharpCode pl
Parameters:
Polyline3D
Returns: string
Modifiers: inline |
Format this 3D polyline into an F# code string that can be used to recreate the polyline.
|
Full Usage:
Polyline3D.asPoints p
Parameters:
Polyline3D
Returns: ResizeArray<Pnt>
Modifiers: inline |
Converts the float buffer of the Polyline3D into a list of Points. Use .XYZs to access the live internal buffer.
|
|
|
|
Returns the average normal vector of the Polyline3D. It is calculated by summing up the cross products of all segments around the center point. Does not check for bad input, may be zero length if points are colinear.
|
|
|
|
|
|
|
Full Usage:
Polyline3D.close toleranceForAddingPoint pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Returns a new closed Polyline3D. If the first and last point are within the tolerance of each other, the last point is set equal to the first point. Otherwise one point is added. Raises an error if the Polyline3D has fewer than 3 points, same as CloseInPlace.
|
Full Usage:
Polyline3D.closeInPlace toleranceForAddingPoint pl
Parameters:
float
-
The tolerance used to decide whether to snap the last point to the first point.
pl : Polyline3D
-
The Polyline3D to close.
Returns: Polyline3D
A reference to the same Polyline3D as the input
|
Closes the Polyline3D in place by adding a point. If the first and last point are within the given tolerance of each other, the last point is set equal to the first point instead.
|
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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
Full Usage:
Polyline3D.closestParameterXYZ pl x y z
Parameters:
Polyline3D
x : float
y : float
z : float
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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
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.closestPointIndex pl pt
Parameters:
Polyline3D
pt : Pnt
Returns: int
Modifiers: inline |
Returns the index into the Polyline3D's point list of the point that is closest to the given point.
|
Full Usage:
Polyline3D.createDirectly xyzs
Parameters:
ResizeArray<float>
Returns: Polyline3D
|
Create a new Polyline3D by using the provided X, Y and Z interleaved ResizeArray directly. Unsafe because later changes to the ResizeArray will be reflected in the Polyline3D.
|
Full Usage:
Polyline3D.createEmpty capacity
Parameters:
int
Returns: Polyline3D
Modifiers: inline |
Create a new empty Polyline3D without any points. But predefined capacity.
|
Full Usage:
Polyline3D.createFrom2DXYMembers xyObjs
Parameters:
^T seq
Returns: Polyline3D
Modifiers: inline Type parameters: ^T, ^a, ^b (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float)) |
Creates a Polyline3D from a list of objects with X and Y members (uppercase), using 0.0 for Z.
|
Full Usage:
Polyline3D.createFrom2DxyMembers xyObjs
Parameters:
^T seq
Returns: Polyline3D
Modifiers: inline Type parameters: ^T, ^a, ^b (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float)) |
Creates a Polyline3D from a list of objects with x and y members (lowercase), using 0.0 for z.
|
|
|
|
Creates a closed Polyline3D starting at the Origin, going to x, then x+y, then y and back to origin.
|
Full Usage:
Polyline3D.createFromXYZMembers xyzObjs
Parameters:
^T seq
Returns: Polyline3D
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (member get_Z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float)) |
Creates a Polyline3D from a list of objects with X, Y, and Z members (uppercase).
|
Full Usage:
Polyline3D.createFromxyzMembers xyzObjs
Parameters:
^T seq
Returns: Polyline3D
Modifiers: inline Type parameters: ^T, ^a, ^b, ^c (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (member get_z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float)) |
Creates a Polyline3D from a list of objects with x, y, and z members (lowercase).
|
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.distanceToXYZ pl x y z
Parameters:
Polyline3D
x : float
y : float
z : float
Returns: float
Modifiers: inline |
Returns the distance of the test point to the closest point on the Polyline3D.
|
Full Usage:
Polyline3D.duplicate pl
Parameters:
Polyline3D
Returns: Polyline3D
Modifiers: inline |
|
|
Gets the last or end point of the Polyline3D This is the point at index Points.Count - 1. Same as Polyline3D.LastPoint
|
Full Usage:
Polyline3D.ensureClockwiseIn2D pl
Parameters:
Polyline3D
Returns: Polyline3D
Modifiers: inline |
Tests if the Polyline3D is Clockwise when projected in 2D (Z values are ignored). Returns the same instance if the Polyline3D is already Clockwise, otherwise returns a new reversed Polyline3D.
|
Full Usage:
Polyline3D.ensureClockwiseInPlaceIn2D pl
Parameters:
Polyline3D
Returns: Polyline3D
Modifiers: inline |
Tests if the Polyline3D is Clockwise when projected in 2D (Z values are ignored). If not reverse the Polyline3D in place. Always returns the same instance.
|
Full Usage:
Polyline3D.ensureCounterClockwiseIn2D pl
Parameters:
Polyline3D
Returns: Polyline3D
Modifiers: inline |
Tests if the Polyline3D is Counter Clockwise when projected in 2D (Z values are ignored). Returns the same instance if the Polyline3D is already Counter Clockwise, otherwise returns a new reversed Polyline3D.
|
Full Usage:
Polyline3D.ensureCounterClockwiseInPlaceIn2D pl
Parameters:
Polyline3D
Returns: Polyline3D
Modifiers: inline |
Tests if the Polyline3D is Counter Clockwise when projected in 2D (Z values are ignored). If not reverse the Polyline3D in place. Always returns the same instance.
|
Full Usage:
Polyline3D.equals pl1 pl2
Parameters:
Polyline3D
-
The first Polyline3D instance.
pl2 : Polyline3D
-
The second Polyline3D instance.
Returns: bool
True if the two Polyline3D instances are equal, otherwise false.
|
Tests if two Polyline3D have the same point count and if their corresponding points are exactly equal.
|
Full Usage:
Polyline3D.equalsTol tol pl1 pl2
Parameters:
float
-
The tolerance value for comparing the coordinates.
pl1 : Polyline3D
-
The first Polyline3D instance.
pl2 : Polyline3D
-
The second Polyline3D instance.
Returns: bool
|
Tests if two Polyline3D have the same point count and if their corresponding points are equal within a given tolerance.
|
|
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 from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .
|
|
Gets the first point of the Polyline3D. This is the point at index 0. Same as Polyline3D.Start
|
Full Usage:
Polyline3D.firstSegment pl
Parameters:
Polyline3D
Returns: Line3D
Modifiers: inline |
|
Full Usage:
Polyline3D.getPt position p
Parameters:
int
p : Polyline3D
Returns: Pnt
Modifiers: inline |
Gets the point at the given position. (does Pnt(xyzs.[position * 3], xyzs.[position * 3 + 1], xyzs.[position * 3 + 2]) internally)
|
Full Usage:
Polyline3D.getSegment i pl
Parameters:
int
pl : Polyline3D
Returns: Line3D
Modifiers: inline |
|
Full Usage:
Polyline3D.getX position p
Parameters:
int
p : Polyline3D
Returns: float
Modifiers: inline |
Gets the x coordinate of the point at the given index. (does xyzs.[position * 3] internally)
|
Full Usage:
Polyline3D.getXYZs p
Parameters:
Polyline3D
Returns: ResizeArray<float>
Modifiers: inline |
Gets the X, Y and Z interleaved ResizeArray of the Polyline3D: x0, y0, z0, x1, y1, z1, ... This is the live internal buffer, so changes to the list will be reflected in the Polyline3D.
|
Full Usage:
Polyline3D.getY position p
Parameters:
int
p : Polyline3D
Returns: float
Modifiers: inline |
Gets the y coordinate of the point at the given index. (does xyzs.[position * 3 + 1] internally)
|
Full Usage:
Polyline3D.getZ position p
Parameters:
int
p : Polyline3D
Returns: float
Modifiers: inline |
Gets the z coordinate of the point at the given index. (does xyzs.[position * 3 + 2] internally)
|
Full Usage:
Polyline3D.isAlmostClosed tolerance pl
Parameters:
float
pl : Polyline3D
Returns: bool
Modifiers: inline |
Tests if Polyline3D is closed within given tolerance. Returns False if the Polyline3D has less than 3 points.
|
Full Usage:
Polyline3D.isClockwiseIn2D pl
Parameters:
Polyline3D
Returns: bool
Modifiers: inline |
Test if Polyline3D is Clockwise 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 negative the Polyline3D is Clockwise.
|
|
Tests if Polyline3D start and end points are exactly the same. Returns False if the Polyline3D has less than 3 points.
|
Full Usage:
Polyline3D.isCounterClockwiseIn2D pl
Parameters:
Polyline3D
Returns: bool
Modifiers: inline |
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:
Polyline3D.iter action pl
Parameters:
float -> float -> float -> unit
-
A function that takes the X, Y and Z coordinates of a point.
pl : Polyline3D
-
The Polyline3D to iterate over.
Modifiers: inline |
Iterate over each point in the Polyline3D.
|
Full Usage:
Polyline3D.iterLineSegments action pl
Parameters:
Line3D -> unit
-
A function that takes a Line3D representing the segment.
pl : Polyline3D
-
The Polyline3D to iterate over.
Modifiers: inline |
Iterate over each segment in the Polyline3D.
|
Full Usage:
Polyline3D.iterPnt action pl
Parameters:
Pnt -> unit
-
A function that takes a point.
pl : Polyline3D
-
The Polyline3D to iterate over.
|
Iterate over each point in the Polyline3D.
|
Full Usage:
Polyline3D.iterPntSkipLast action pl
Parameters:
Pnt -> unit
-
A function that takes a point.
pl : Polyline3D
-
The Polyline3D to iterate over.
Modifiers: inline |
Iterate over each point in the Polyline3D except the last point.
|
Full Usage:
Polyline3D.iterSegments action pl
Parameters:
float -> float -> float -> float -> float -> float -> unit
-
A function that takes startX, startY, startZ, endX, endY, and endZ coordinates of a segment.
pl : Polyline3D
-
The Polyline3D to iterate over.
Modifiers: inline |
Iterate over each segment in the Polyline3D.
|
Full Usage:
Polyline3D.iterSkipLast action pl
Parameters:
float -> float -> float -> unit
-
A function that takes the X, Y and Z coordinates of a point.
pl : Polyline3D
-
The Polyline3D to iterate over.
Modifiers: inline |
Iterate over each point in the Polyline3D except the last point.
|
Full Usage:
Polyline3D.iteri action pl
Parameters:
int -> float -> float -> float -> unit
-
A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point.
pl : Polyline3D
-
The Polyline3D to iterate over.
|
Iterate over each point in the Polyline3D with index.
|
Full Usage:
Polyline3D.iteriPnt action pl
Parameters:
int -> Pnt -> unit
-
A function that takes the position ( = array index/3) of the point and the point itself.
pl : Polyline3D
-
The Polyline3D to iterate over.
|
Iterate over each point in the Polyline3D with index.
|
|
Gets the last point of the Polyline3D. This is the point at index Points.Count - 1. Same as Polyline3D.End
|
|
|
|
Gets the length of the Polyline3D. The sum of the lengths of all segments.
|
Full Usage:
Polyline3D.map mapping pl
Parameters:
float -> float -> float -> Pnt
-
A function that takes the X, Y and Z coordinates of a point and returns a new point.
pl : Polyline3D
-
The Polyline3D to map over.
Returns: Polyline3D
A new Polyline3D with the mapped points.
|
Apply a mapping function to each point in the 3D Polyline. Returns new Polyline3D.
|
Full Usage:
Polyline3D.mapPnt mapping pl
Parameters:
Pnt -> Pnt
-
A function that takes a point and returns a new point.
pl : Polyline3D
-
The Polyline3D to map over.
Returns: Polyline3D
A new Polyline3D with the mapped points.
|
Apply a mapping function to each point in the 3D Polyline. Returns new Polyline3D.
|
Full Usage:
Polyline3D.mapi mapping pl
Parameters:
int -> float -> float -> float -> Pnt
-
A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point and returns a new point.
pl : Polyline3D
-
The Polyline3D to map over.
Returns: Polyline3D
A new Polyline3D with the mapped points.
|
Apply a mapping function to each point in the 3D Polyline with index. Returns new Polyline3D.
|
Full Usage:
Polyline3D.mapiPnt mapping pl
Parameters:
int -> Pnt -> Pnt
-
A function that takes the position ( = array index/3) of the point and the point itself, and returns a new point.
pl : Polyline3D
-
The Polyline3D to map over.
Returns: Polyline3D
A new Polyline3D with the mapped points.
|
Apply a mapping function to each point in the Polyline3D with point position (not float index). Returns new Polyline3D.
|
|
Move a Polyline3D by a vector. (same as Polyline3D.translate)
|
Full Usage:
Polyline3D.moveX distance pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Returns a Polyline3D moved by a given distance in X direction.
|
Full Usage:
Polyline3D.moveY distance pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Returns a Polyline3D moved by a given distance in Y direction.
|
Full Usage:
Polyline3D.moveZ distance pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Returns a Polyline3D moved by a given distance in Z direction.
|
Full Usage:
Polyline3D.offset (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, ?loop)
Parameters:
Polyline3D
-
A 3D Polyline, open or closed.
inPlaneOffsetDistance : float
-
The offset distance in the local plane defined by two segments.
A positive distance offsets to the inside of the polyline.
A negative distance offsets to the outside.
No matter how the polyline is oriented.
perpendicularOffsetDistance : float
-
The offset distance perpendicular to the local plane.
A positive distance offsets in the direction of the computed normal.
For a counterclockwise polyline in xy-plane this is Upwards.
A negative distance offsets in the opposite direction.
?loop : bool
-
Optional, defaults to false.
Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.
Returns: Polyline3D
A new 3D polyline.
|
Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.
|
Full Usage:
Polyline3D.offset' inPlaneOffsetDistance perpendicularOffsetDistance polyLine
Parameters:
float
-
The offset distance in the local plane defined by two segments.
A positive distance offsets to the inside of the polyline.
A negative distance offsets to the outside.
No matter how the polyline is oriented.
perpendicularOffsetDistance : float
-
The offset distance perpendicular to the local plane.
A positive distance offsets in the direction of the computed normal.
For a counterclockwise polyline in xy-plane this is Upwards.
A negative distance offsets in the opposite direction.
polyLine : Polyline3D
-
A 3D Polyline, open or closed.
Returns: Polyline3D
A new 3D polyline.
|
Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.
|
Full Usage:
Polyline3D.offsetVar (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)
Parameters:
Polyline3D
-
A 3D Polyline, open or closed.
inPlaneOffsetDistances : ResizeArray<float>
-
The offset distances in the local plane defined by two segments. One distance per segment.
A positive distance offsets to the inside of the polyline.
A negative distance offsets to the outside.
No matter how the polyline is oriented.
perpendicularOffsetDistances : ResizeArray<float>
-
The offset distances perpendicular to the local plane. One distance per segment.
A positive distance offsets in the direction of the computed normal.
For a counterclockwise polyline in xy-plane this is Upwards.
A negative distance offsets in the opposite direction.
?loop : bool
-
Optional, defaults to false.
Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
?varDistParallelBehaviour : VarDistParallel
-
Optional, defaults to Fail.
The behavior to use when colinear segments with different offset distances are found.
?considerColinearBelow : MeasureProduct<cosine, MeasureOne>
-
Optional, defaults to 2.5 degrees in cosine measure.
The cosine of the angle below which segments are considered colinear.
?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne>
-
Optional, defaults to 175 degrees in cosine measure.
The cosine of the angle above which a U-turn is considered to fail.
Returns: Polyline3D
A new 3D polyline.
|
Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.
|
Full Usage:
Polyline3D.offsetVarWithRef (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, refNormal, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)
Parameters:
Polyline3D
-
A 3D Polyline, open or closed.
inPlaneOffsetDistances : IList<float>
-
The offset distances in the local plane defined by two segments. One distance per segment.
A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up).
A negative distance offsets to the outside.
perpendicularOffsetDistances : IList<float>
-
The offset distances perpendicular to the local plane. One distance per segment.
A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.
refNormal : UnitVec
-
A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.
?loop : bool
-
Optional, defaults to false.
Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
?varDistParallelBehaviour : VarDistParallel
-
Optional, defaults to Fail.
The behavior to use when colinear segments with different offset distances are found.
?considerColinearBelow : MeasureProduct<cosine, MeasureOne>
-
Optional, defaults to 2.5 degrees in cosine measure.
The cosine of the angle below which segments are considered colinear.
?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne>
-
Optional, defaults to 175 degrees in cosine measure.
The cosine of the angle above which a U-turn is considered to fail.
Returns: Polyline3D
A new 3D polyline.
|
Offsets a Polyline in 3D space by finding the local plane in each corner. Takes a reference normal for orienting the perpendicular offset and determining inside/outside. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. This function raises an Exception on duplicate points and 180 degree U-turns.
|
Full Usage:
Polyline3D.offsetWithRef (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, refNormal, ?loop)
Parameters:
Polyline3D
-
A 3D Polyline, open or closed.
inPlaneOffsetDistance : float
-
The offset distance in the local plane defined by two segments.
A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up).
A negative distance offsets to the outside.
perpendicularOffsetDistance : float
-
The offset distance perpendicular to the local plane.
A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.
refNormal : UnitVec
-
A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.
?loop : bool
-
Optional, defaults to false.
Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.
Returns: Polyline3D
A new 3D polyline.
|
Offsets a Polyline in 3D space by finding the local plane in each corner. Takes a reference normal for orienting the perpendicular offset and determining inside/outside. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. This function raises an Exception on duplicate points and 180 degree U-turns.
|
|
|
Full Usage:
Polyline3D.removeDuplicateAndColinearPoints angleTolerance distanceTolerance pl
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
distanceTolerance : float
pl : Polyline3D
Returns: Polyline3D
|
Removes consecutive duplicate points and colinear points from the Polyline3D within given tolerances. This algorithm allows the last and first point to be identical if the Polyline3D is closed. Colinear points are removed when the angle between segments is smaller than the cosine threshold (e.g. cosine of 0.5 degrees ). If the Polyline3D is closed and starts and ends with colinear segments, the first point is replaced with the last non-colinear point. So the joint of the loop is now moved to the last non-colinear point. So that there are no colinear segments even between start and end. Raises an error if all points are within the distanceTolerance of the first point.
|
Full Usage:
Polyline3D.removeDuplicatePoints distanceTolerance pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Removes consecutive duplicate points from the Polyline3D within a given tolerance. This algorithm allows the last and first point to be identical if the Polyline3D is closed.
|
Full Usage:
Polyline3D.removeDuplicatePointsFaithfully distanceTolerance pl
Parameters:
float
-
The distance within which points are considered duplicates.
pl : Polyline3D
-
A 3D Polyline, open or closed.
Returns: Polyline3D
|
Removes consecutive duplicate points from the Polyline3D within a given tolerance. This algorithm ensures to keep edges in their position by re-intersecting segments at their closest approach if points are closer than the distanceTolerance but not identical. The position of start and end point is NOT changed. Use Polyline3D.close to ensure start and end point are identical.
|
Full Usage:
Polyline3D.removeUTurns minCos polyLine
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
-
The angle between segments so that they are considered a U-turn.
For example, for 179.9 degrees use 'Cosine.``179.9``'.
polyLine : Polyline3D
-
A 3D Polyline, open or closed.
Returns: Polyline3D
If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list.
If U-turns are present, a new ResizeArray of points is returned with simple U-turns removed.
|
Removes simple sharp U-Turns from a Polyline The Offset3D module also has a removeUTurns function that takes precomputed unit vectors and is therefore more efficient. For nested U-turns and colinear points in U-turns segments use 'removeUTurnsDeeply'. That function calls repeatedly until no more U-turns are present.
|
Full Usage:
Polyline3D.removeUTurnsDeeply minCos polyLine
Parameters:
float<MeasureProduct<cosine, MeasureOne>>
-
The angle between segments so that they are considered a U-turn.
For example, for 179.9 degrees use 'Cosine.``179.9``'.
polyLine : Polyline3D
-
A 3D Polyline, open or closed.
Returns: Polyline3D
If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list.
If U-turns are present, a new ResizeArray of points is returned with all U-turns removed.
|
Removes all sharp U-Turns from a Polyline recursively until no more U-turns are present. This function calls 'removeUTurns' repeatedly until no more U-turns are present. Use this function when you have nested U-turns and colinear points in U-turns segments.
|
|
|
Full Usage:
Polyline3D.reverseInPlace p
Parameters:
Polyline3D
-
The Polyline3D to reverse.
Returns: Polyline3D
A reference to the same Polyline3D as the input
|
Reverse order of the Polyline3D in place.
|
Full Usage:
Polyline3D.rotate q pl
Parameters:
Quaternion
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Multiplies (or applies) a Quaternion to the Polyline3D. The polyline is rotated around the World Origin.
|
Full Usage:
Polyline3D.rotateOnZ r pl
Parameters:
Rotation2D
pl : Polyline3D
Returns: Polyline3D
|
|
Full Usage:
Polyline3D.rotateOnZWithCenter cen r pl
Parameters:
Pnt
r : Rotation2D
pl : Polyline3D
Returns: Polyline3D
|
Rotation a Polyline3D round given center point an a local Z-axis.
|
Full Usage:
Polyline3D.rotateWithCenter cen q pl
Parameters:
Pnt
q : Quaternion
pl : Polyline3D
Returns: Polyline3D
|
Multiplies (or applies) a Quaternion to the Polyline3D to rotate around a given center point.
|
Full Usage:
Polyline3D.scale factor pl
Parameters:
float
pl : Polyline3D
Returns: Polyline3D
|
Scales the Polyline3D by a given factor. Scale center is World Origin 0,0,0 Returns a new Polyline3D.
|
Full Usage:
Polyline3D.scaleOn cen factor pl
Parameters:
Pnt
factor : float
pl : Polyline3D
Returns: Polyline3D
Modifiers: inline |
Scales the 3D polyline by a given factor on a given center point
|
Full Usage:
Polyline3D.secondLastPoint pl
Parameters:
Polyline3D
Returns: Pnt
Modifiers: inline |
|
|
|
|
|
Full Usage:
Polyline3D.segmentVectors pl
Parameters:
Polyline3D
Returns: ResizeArray<Vec>
Modifiers: inline |
Returns the line vectors of all segments of the Polyline3D as a list of Vec. The length of the list is one less than the point count.
|
Full Usage:
Polyline3D.segmentVectorsXYZ p
Parameters:
Polyline3D
Returns: ResizeArray<float>
Modifiers: inline |
Returns the line vectors of all segments of the Polyline3D as a flat list of x, y, and z components. The length of the list is 3 less than the xyzs count, so one less vector than points in the polyline.
|
Full Usage:
Polyline3D.segments pl
Parameters:
Polyline3D
Returns: ResizeArray<Line3D>
Modifiers: inline |
Returns all segments of the Polyline3D as a list of Line3D.
|
Full Usage:
Polyline3D.setPnt position pt p
Parameters:
int
pt : Pnt
p : Polyline3D
Modifiers: inline |
Sets the point at given position to the given point. ( sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)
|
Full Usage:
Polyline3D.setPointXYZ x y z position p
Parameters:
float
y : float
z : float
position : int
p : Polyline3D
Modifiers: inline |
Sets the x, y, and z coordinates of the point at the given index. NOTE: setting the first or last point on a closed Polyline3D might open it. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally )
|
Full Usage:
Polyline3D.setPointXYZClosed x y z position p
Parameters:
float
y : float
z : float
position : int
p : Polyline3D
Modifiers: inline |
Sets the x, y, and z coordinates of the point at the given index. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the index is out of range. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally)
|
Full Usage:
Polyline3D.signedAreaIn2D pl
Parameters:
Polyline3D
Returns: float
Modifiers: inline |
Calculates the signed area of the Polyline3D 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:
Polyline3D.subPolyline 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 than 'b' then the new Polyline3D is in opposite direction. If the start parameter is less than 1e-4 below the next integer it snaps up to that vertex. If the end parameter is less than 1e-4 above the previous integer it snaps down to that vertex. Raises an error if a parameter is outside the domain of the Polyline3D (0.0 to points.Count - 1.0).
|
|
|
Full Usage:
Polyline3D.transformRigid m pl
Parameters:
RigidMatrix
pl : Polyline3D
Returns: Polyline3D
|
Multiplies (or applies) a RigidMatrix to the Polyline3D.
|
|
Move a Polyline3D by a vector. (same as Polyline3D.move)
|
Full Usage:
Polyline3D.tryFind condition pl
Parameters:
float -> float -> float -> bool
-
A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
pl : Polyline3D
-
The Polyline3D to search through.
Returns: Pnt option
Some(Pnt) if a point satisfying the condition is found, otherwise None.
Modifiers: inline |
Find the first point in the Polyline3D that satisfies a given condition. Returns Some(point) if found, otherwise None.
|
Full Usage:
Polyline3D.tryFindIndex condition pl
Parameters:
float -> float -> float -> bool
-
A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
pl : Polyline3D
-
The Polyline3D to search through.
Returns: int option
Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.
Modifiers: inline |
Find the index of the first point in the Polyline3D that satisfies a given condition. Returns Some(index) if found, otherwise None.
|
Full Usage:
Polyline3D.tryFindLast condition pl
Parameters:
float -> float -> float -> bool
-
A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
pl : Polyline3D
-
The Polyline3D to search through.
Returns: Pnt option
Some(Pnt) if a point satisfying the condition is found, otherwise None.
Modifiers: inline |
Find the last point in the Polyline3D that satisfies a given condition. Returns Some(point) if found, otherwise None.
|
Full Usage:
Polyline3D.tryFindLastIndex condition pl
Parameters:
float -> float -> float -> bool
-
A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
pl : Polyline3D
-
The Polyline3D to search through.
Returns: int option
Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.
Modifiers: inline |
Find the index of the last point in the Polyline3D that satisfies a given condition. Returns Some(index) if found, otherwise None.
|
Euclid