|
SFCGAL
2.3.0
|
Abstract base class for parametric curves. More...
#include <Curve.h>
Inherits SFCGAL::GeometryImpl< Derived, Base >.
Inherited by SFCGAL::GeometryImpl< NURBSCurve, Curve >.
Public Types | |
| enum | Continuity : std::uint8_t { Continuity::C0, Continuity::C1, Continuity::C2, Continuity::G1, Continuity::G2 } |
| Curve continuity types. More... | |
| using | FT = Kernel::FT |
| Floating-point type for curve calculations. More... | |
| using | Parameter = FT |
| Parameter type for curve parameterization. More... | |
Public Member Functions | |
| Curve () | |
| Default constructor. More... | |
| Curve (const Curve &other) | |
| Copy constructor. More... | |
| auto | operator= (const Curve &other) -> Curve & |
| Assignment operator. More... | |
| ~Curve () override | |
| Virtual destructor. More... | |
| auto | dimension () const -> int override |
| Return the topological dimension of this geometry. More... | |
| auto | coordinateDimension () const -> int override |
| Return the coordinate dimension of the curve. More... | |
| virtual auto | evaluate (Parameter parameter) const -> Point=0 |
| Evaluate the curve at parameter value. More... | |
| virtual auto | derivative (Parameter parameter, unsigned int order=1) const -> Point=0 |
| Compute the derivative of the curve at parameter value. More... | |
| virtual auto | tangent (Parameter parameter) const -> Point=0 |
| Compute the tangent unit vector at parameter value. More... | |
| virtual auto | normal (Parameter parameter) const -> Point=0 |
| Compute the normal vector at parameter value (for planar curves) More... | |
| virtual auto | binormal (Parameter parameter) const -> Point=0 |
| Compute the binormal vector at parameter value (for 3D curves) More... | |
| virtual auto | curvature (Parameter parameter) const -> FT=0 |
| Compute the curvature at parameter value. More... | |
| virtual auto | torsion (Parameter parameter) const -> FT=0 |
| Compute the torsion at parameter value (for 3D curves) More... | |
| virtual auto | frenetFrame (Parameter parameter) const -> std::tuple< Point, Point, Point >=0 |
| Get the Frenet-Serret frame at parameter value. More... | |
| virtual auto | toLineString (unsigned int numSegments=32) const -> std::unique_ptr< LineString >=0 |
| Convert curve to a LineString approximation. More... | |
| virtual auto | toLineStringAdaptive (FT tolerance=FT(1e-3), unsigned int minSegments=8, unsigned int maxSegments=256) const -> std::unique_ptr< LineString >=0 |
| Convert curve to LineString with adaptive sampling. More... | |
| virtual auto | parameterBounds () const -> std::pair< Parameter, Parameter >=0 |
| Get the parameter bounds of the curve. More... | |
| virtual auto | isPeriodic () const -> bool=0 |
| Check if the curve is periodic. More... | |
| virtual auto | isPlanar (std::vector< FT > *plane=nullptr) const -> bool=0 |
| Check if the curve is planar. More... | |
| virtual auto | isLinear () const -> bool=0 |
| Check if the curve is linear (straight line) More... | |
| virtual auto | degree () const -> unsigned int=0 |
| Get the degree of the curve. More... | |
| virtual auto | length (Parameter from=Parameter(-1), Parameter to=Parameter(-1), FT tolerance=FT(1e-6)) const -> FT=0 |
| Get the curve length. More... | |
| virtual auto | parameterAtLength (FT arcLength, FT tolerance=FT(1e-6)) const -> Parameter=0 |
| Find parameter value at given arc length from start. More... | |
| virtual auto | reparameterizeByArcLength () const -> std::unique_ptr< Curve >=0 |
| Reparameterize curve by arc length. More... | |
| virtual auto | split (Parameter parameter) const -> std::pair< std::unique_ptr< Curve >, std::unique_ptr< Curve >>=0 |
| Split curve at parameter value. More... | |
| virtual auto | subcurve (Parameter from, Parameter to) const -> std::unique_ptr< Curve >=0 |
| Extract subcurve between two parameters. More... | |
| virtual auto | reverse () const -> std::unique_ptr< Curve >=0 |
| Reverse the curve direction. More... | |
| virtual auto | join (const Curve &other, Continuity continuity=Continuity::C0, FT tolerance=FT(1e-6)) const -> std::unique_ptr< Curve >=0 |
| Join with another curve. More... | |
| virtual auto | closestPoint (const Point &point, Parameter *parameter=nullptr) const -> Point=0 |
| Project point onto curve. More... | |
| virtual auto | numControlPoints () const -> size_t |
| Get number of control points. More... | |
| virtual auto | isRational () const -> bool |
| Check if curve uses non-uniform rational weights. More... | |
| virtual auto | weight (size_t index) const -> FT |
| Return the rational weight of the curve's control point at the given index. More... | |
| virtual auto | controlPointN (size_t index) const -> const Point & |
| Return a read-only reference to the control point at the given index. More... | |
| virtual auto | controlPointN (size_t index) -> Point & |
| Return a modifiable reference to the control point at the given index. More... | |
| auto | startPoint () const -> Point |
| Get the start point of the curve. More... | |
| auto | endPoint () const -> Point |
| Get the end point of the curve. More... | |
| auto | midPoint () const -> Point |
| Get the midpoint of the curve. More... | |
| auto | isValidParameter (const Parameter ¶meter) const -> bool |
| Check if a parameter value is within curve bounds. More... | |
| auto | normalizeParameter (const Parameter ¶meter) const -> FT |
| Normalize parameter to [0,1] range. More... | |
| auto | denormalizeParameter (const FT &normalizedParameter) const -> Parameter |
| Denormalize parameter from [0,1] to actual range. More... | |
Abstract base class for parametric curves.
This class provides a common interface for parametric curves. All curves are represented as NURBS (Non-Uniform Rational B-Splines) which can degenerate to B-splines (uniform weights) or Bezier curves.
| using SFCGAL::Curve::FT = Kernel::FT |
Floating-point type for curve calculations.
| using SFCGAL::Curve::Parameter = FT |
Parameter type for curve parameterization.
|
strong |
Curve continuity types.
| Enumerator | |
|---|---|
| C0 |
Position continuity (sharp corners allowed) |
| C1 |
Tangent continuity. |
| C2 |
Curvature continuity. |
| G1 |
Geometric tangent continuity. |
| G2 |
Geometric curvature continuity. |
|
default |
Default constructor.
|
default |
Copy constructor.
| other | Curve to copy from |
|
overridedefault |
Virtual destructor.
Compute the binormal vector at parameter value (for 3D curves)
| parameter | Parameter value |
|
pure virtual |
Project point onto curve.
| point | Point to project |
| parameter | Output parameter at closest point |
|
inlinevirtual |
Return a read-only reference to the control point at the given index.
This method is part of the NURBS-specific interface. The base implementation always throws an Exception to indicate the operation is not supported for curve types that do not expose control points.
| index | Index of the control point. |
index. | Exception | if the curve type does not support control points or if index is out of range for implementations that override this method. |
|
inlinevirtual |
Return a modifiable reference to the control point at the given index.
Concrete NURBS-style curve implementations should override this to provide writable access to their control points. The base implementation throws an Exception indicating the operation is not supported for this curve type.
| index | Zero-based control point index. |
| Exception | If the curve type does not support control point access or if index is out of range. |
|
inlineoverride |
Return the coordinate dimension of the curve.
Computes 2 for non-3D curves or 3 for 3D curves, and adds 1 if the curve is measured.
Compute the curvature at parameter value.
| parameter | Parameter value |
|
pure virtual |
Get the degree of the curve.
Denormalize parameter from [0,1] to actual range.
| normalizedParameter | Parameter in [0,1] |
|
pure virtual |
Compute the derivative of the curve at parameter value.
| parameter | Parameter value |
| order | Derivative order (1 for first derivative, 2 for second, etc.) |
|
inlineoverride |
Return the topological dimension of this geometry.
For Curve objects this is always 1.
| auto SFCGAL::Curve::endPoint | ( | ) | const -> Point |
Get the end point of the curve.
|
pure virtual |
Get the Frenet-Serret frame at parameter value.
| parameter | Parameter value |
|
pure virtual |
Check if the curve is linear (straight line)
|
pure virtual |
Check if the curve is periodic.
|
pure virtual |
Check if the curve is planar.
| plane | Output parameter for the plane equation if planar |
|
inlinevirtual |
Check if curve uses non-uniform rational weights.
| Exception | if not implemented for curve type |
| auto SFCGAL::Curve::isValidParameter | ( | const Parameter & | parameter | ) | const -> bool |
Check if a parameter value is within curve bounds.
| parameter | Parameter to check |
|
pure virtual |
Join with another curve.
| other | Curve to join with |
| continuity | Desired continuity at join |
| tolerance | Tolerance for join |
|
pure virtual |
Get the curve length.
| from | Start parameter (default: curve start) |
| to | End parameter (default: curve end) |
| tolerance | Integration tolerance |
| auto SFCGAL::Curve::midPoint | ( | ) | const -> Point |
Get the midpoint of the curve.
Compute the normal vector at parameter value (for planar curves)
| parameter | Parameter value |
Normalize parameter to [0,1] range.
| parameter | Raw parameter value |
|
inlinevirtual |
Get number of control points.
| Exception | if not implemented for curve type |
|
pure virtual |
Find parameter value at given arc length from start.
| arcLength | Target arc length from curve start |
| tolerance | Tolerance for root finding |
|
pure virtual |
Get the parameter bounds of the curve.
|
pure virtual |
Reparameterize curve by arc length.
|
pure virtual |
Reverse the curve direction.
|
pure virtual |
Split curve at parameter value.
| parameter | Split location |
| auto SFCGAL::Curve::startPoint | ( | ) | const -> Point |
Get the start point of the curve.
|
pure virtual |
Extract subcurve between two parameters.
| from | Start parameter |
| to | End parameter |
Compute the tangent unit vector at parameter value.
| parameter | Parameter value |
|
pure virtual |
Convert curve to a LineString approximation.
| numSegments | Number of line segments to use |
|
pure virtual |
Convert curve to LineString with adaptive sampling.
| tolerance | Maximum deviation from actual curve |
| minSegments | Minimum number of segments |
| maxSegments | Maximum number of segments |
Compute the torsion at parameter value (for 3D curves)
| parameter | Parameter value |
|
inlinevirtual |
Return the rational weight of the curve's control point at the given index.
Default implementation throws an Exception indicating that weight access is not supported for this curve type; concrete NURBS-derived classes must override to provide valid weights.
| index | Index of the control point weight. |
| Exception | if this curve type does not support weights or if the index is out of range. |
1.8.10