Constructor PolylineF
| Edit this page View SourcePolylineF()
Creates an empty polyline. (Invalid)
Declaration
public PolylineF()
Remarks
You shouldn't use an empty polyline for any meaningful operations. Useful only for initialization or placeholder purposes.
PolylineF(Vector3[])
Creates a polyline and automatically checks if it is closed.
Declaration
public PolylineF(Vector3[] vertices)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3[] | vertices | Array of vertices defining the polyline |
Remarks
Calculating closedness involves checking the distance between the first and last vertex. This is a simple check but may be inefficient for very large polylines. If you already know the polyline's closedness, consider using the constructor that accepts an explicit closedness parameter.
PolylineF(ReadOnlySpan<Vector3>)
Creates a polyline and automatically checks if it is closed.
Declaration
public PolylineF(ReadOnlySpan<Vector3> vertices)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | vertices | Span of vertices defining the polyline |
Remarks
Calculating closedness involves checking the distance between the first and last vertex. This is a simple check but may be inefficient for very large polylines. If you already know the polyline's closedness, consider using the constructor that accepts an explicit closedness parameter.
PolylineF(Vector3[], bool)
Creates a polyline with the given vertices and explicit closedness.
Declaration
public PolylineF(Vector3[] vertices, bool isClosed)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3[] | vertices | Array of vertices defining the polyline |
| bool | isClosed | Whether the polyline is closed |
Remarks
This constructor does not check if the first and last vertices are the same when isClosed is true. Use this constructor when you already know the closedness of the polyline to avoid unnecessary computations.
PolylineF(ReadOnlySpan<Vector3>, bool)
Creates a polyline with the given vertices and explicit closedness.
Declaration
public PolylineF(ReadOnlySpan<Vector3> vertices, bool isClosed)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<Vector3> | vertices | Array of vertices defining the polyline |
| bool | isClosed | Whether the polyline is closed |
Remarks
This constructor does not check if the first and last vertices are the same when isClosed is true. Use this constructor when you already know the closedness of the polyline to avoid unnecessary computations.