Class CubicBezierCurve
Creates a curved geometry by replacing the segments of the input with Cubic Bezier Curves.
Inherited Members
Namespace: NetTopologySuite.Shape
Assembly: NetTopologySuite.dll
Syntax
public class CubicBezierCurve
Remarks
The Bezier control points are determined from the segments of the geometry and the alpha control parameter controlling curvedness, and the optional skew parameter controlling the shape of the curve at vertices. The Bezier Curves are created to be C2-continuous (smooth) at each input vertex.
Alternatively, the Bezier control points can be supplied explicitly.
The result is not guaranteed to be valid, since large alpha values may cause self-intersections.
Methods
| Improve this Doc View SourceCreate(Geometry, Geometry)
Creates a geometry of linearized Cubic Bezier Curves defined by the segments of the input and a list (or lists) of control points.
Declaration
public static Geometry Create(Geometry geom, Geometry controlPoints)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry defining the curve |
Geometry | controlPoints | A geometry containing the control point elements. |
Returns
Type | Description |
---|---|
Geometry | The linearized curved geometry |
Remarks
Typically the control point geometry is a LineString or MultiLineString containing an element for each line or ring in the input geometry. The list of control points for each linear element must contain two vertices for each segment (and thus
2 * npts - 2
).
Create(Geometry, Double)
Creates a geometry of linearized Cubic Bezier Curves defined by the segments of the input and a parameter controlling how curved the result should be.
Declaration
public static Geometry Create(Geometry geom, double alpha)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry defining the curve |
Double | alpha | A curvedness parameter (0 is linear, 1 is round, >1 is increasingly curved) |
Returns
Type | Description |
---|---|
Geometry | The linearized curved geometry |
Create(Geometry, Double, Double)
Creates a geometry of linearized Cubic Bezier Curves defined by the segments of the inputand a parameter controlling how curved the result should be, with a skew factor affecting the curve shape at each vertex.
Declaration
public static Geometry Create(Geometry geom, double alpha, double skew)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry defining the curve |
Double | alpha | The curvedness parameter (0 is linear, 1 is round, >1 is increasingly curved) |
Double | skew | The skew parameter (0 is none, positive skews towards longer side, negative towards shorter |
Returns
Type | Description |
---|---|
Geometry | The linearized curved geometry |
GetResult()
Gets the computed Bezier curve geometry
Declaration
public Geometry GetResult()
Returns
Type | Description |
---|---|
Geometry | The curved geometry |