Class TPiecewiseCubicBezier
Unit
Declaration
type TPiecewiseCubicBezier = class(TControlPointsCurve)
Description
Piecewise (composite) cubic Bezier curve. Each segment (ControlPoints[i]..ControlPoints[i+1]) is a cubic Bezier curve (Bezier with 4 control points, 2 points in the middle are auto-calculated for max smoothness).
This is a cubic B-spline. Which is equivalent to C2 continuous composite Bézier curves. See https://en.wikipedia.org/wiki/Spline_%28mathematics%29 . Aka Cubic B-Spline (piecewise C2-Smooth Cubic Bezier).
ControlPoints.Count may be 1 (in general, for TControlPointsCurve, it must be >= 2).
Source: castlescript/castlecurves.pas (line 213).
Hierarchy
- TObject
- TCurve
- TControlPointsCurve
- TPiecewiseCubicBezier
Overview
Constants
| Public | DefaultSegments = 32; |
Fields
| Public | ControlPoints: TVector3List; |
Methods
| Protected | procedure LoadFromElement(const E: TDOMElement); virtual; |
| Protected | procedure SaveToStream(const Stream: TStream); virtual; |
| Public | constructor Create; |
| Public | function Point(const t: Float): TVector3; virtual; abstract; |
| Public | function Point2D(const t: Float): TVector2; |
| Public | function PointOfSegment(const i, Segments: Cardinal): TVector3; |
| Public | class function LoadFromFile(const Url: String): TCurve; |
| Public | function BoundingBox: TBox3D; virtual; abstract; |
| Public | function GeometryNode(const Segments: Cardinal = DefaultSegments): TAbstractGeometryNode; |
| Protected | procedure LoadFromElement(const E: TDOMElement); override; |
| Protected | procedure SaveToStream(const Stream: TStream); override; |
| Public | function BoundingBox: TBox3D; override; |
| Public | procedure UpdateControlPoints; virtual; |
| Public | constructor Create; |
| Public | constructor CreateFromEquation(CasScriptCurve: TCasScriptCurve; ControlPointsCount: Cardinal); |
| Public | destructor Destroy; override; |
| Public | function ConvexHull: TVector3List; |
| Public | constructor Create; |
| Public | destructor Destroy; override; |
| Public | procedure UpdateControlPoints; override; |
| Public | function Point(const t: Float): TVector3; override; |
| Public | function BoundingBox: TBox3D; override; |
Properties
| Public | property TBegin: Single read FTBegin write FTBegin default 0; |
| Public | property TEnd: Single read FTEnd write FTEnd default 1; |
Description
Constants
| Public | DefaultSegments = 32; |
|
This item has no description. | |
Fields
| Public | ControlPoints: TVector3List; |
|
This item has no description. | |
Methods
| Protected | procedure LoadFromElement(const E: TDOMElement); virtual; |
|
This item has no description. | |
| Protected | procedure SaveToStream(const Stream: TStream); virtual; |
|
This item has no description. | |
| Public | constructor Create; |
|
This item has no description. | |
| Public | function Point(const t: Float): TVector3; virtual; abstract; |
|
Curve function, for each parameter value determine the 3D point. This determines the actual shape of the curve. This is the simplest approach to calculate points on a curve. | |
| Public | function Point2D(const t: Float): TVector2; |
|
This item has no description. | |
| Public | function PointOfSegment(const i, Segments: Cardinal): TVector3; |
|
Curve function to work with rendered line segments begin/end points. This is simply a more specialized version of Point, it scales the argument such that you get Point(TBegin) for I = 0 and you get Point(TEnd) for I = Segments. | |
| Public | class function LoadFromFile(const Url: String): TCurve; |
|
Load the first curve defined in given XML file. Hint: use https://castle-engine.io/curves_tool to design curves visually. | |
| Public | function BoundingBox: TBox3D; virtual; abstract; |
|
This item has no description. | |
| Public | function GeometryNode(const Segments: Cardinal = DefaultSegments): TAbstractGeometryNode; |
|
Represent this curve as an X3D geometry node, that you can use to visualize this. | |
| Protected | procedure LoadFromElement(const E: TDOMElement); override; |
|
This item has no description. | |
| Protected | procedure SaveToStream(const Stream: TStream); override; |
|
This item has no description. | |
| Public | function BoundingBox: TBox3D; override; |
|
Bounding box of the curve. In this class, it is simply a | |
| Public | procedure UpdateControlPoints; virtual; |
|
Always after changing ControlPoints or TBegin or TEnd and before calling Point (or anything that uses Point, like BoundingBox) call this method. It recalculates necessary things. ControlPoints.Count must be >= 2. When overriding: always call inherited first. | |
| Public | constructor Create; |
|
Constructor. | |
| Public | constructor CreateFromEquation(CasScriptCurve: TCasScriptCurve; ControlPointsCount: Cardinal); |
|
Calculate initial control points by sampling given TCasScriptCurve, with analytical curve equation. TBegin and TEnd are copied from CasScriptCurve. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | function ConvexHull: TVector3List; |
|
Calculate the convex hull. Caller is responsible for freeing the result. | |
| Public | constructor Create; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | procedure UpdateControlPoints; override; |
|
This item has no description. Showing description inherited from TControlPointsCurve.UpdateControlPoints. Always after changing ControlPoints or TBegin or TEnd and before calling Point (or anything that uses Point, like BoundingBox) call this method. It recalculates necessary things. ControlPoints.Count must be >= 2. When overriding: always call inherited first. | |
| Public | function Point(const t: Float): TVector3; override; |
|
This item has no description. Showing description inherited from TCurve.Point. Curve function, for each parameter value determine the 3D point. This determines the actual shape of the curve. This is the simplest approach to calculate points on a curve. | |
| Public | function BoundingBox: TBox3D; override; |
|
This item has no description. Showing description inherited from TControlPointsCurve.BoundingBox.
Bounding box of the curve. In this class, it is simply a | |
Properties
| Public | property TBegin: Single read FTBegin write FTBegin default 0; |
|
The valid range of curve function argument. Must be | |
| Public | property TEnd: Single read FTEnd write FTEnd default 1; |
|
This item has no description. | |
Generated by PasDoc 0.17.0.snapshot.