Curves (object)

The Curves geometry is a Curve container, which can hold one or multiple curves of various types. Currently supported types include linear, Bezier and NURBS curves. Bezier and NURBS can have rational weights, and NURBS can have explicit knots. All curves can be open or closed, and NURBS can be periodic.

Individual curves are assigned a curveIndex that allows to access their individual parameters. In order to ease the access to a single curve, the Curve class wraps the <Curves, curveIndex> pair, and provides the same methods in the context of that curve.

To increase performance with many curves, attributes of all curves, such as point positions, are regrouped in a single GeometryAttributes buffer. Similarly, the definitions of all curves is regrouped in big arrays, allowing to create and interactively draw thousands of curves. The Curves.getAttributeIndex method provides a mapping from a curve sub-point to a global GeometryAttributes index.

The draw sampling precision can be controlled by method Curves.setDrawSamplesPerSpan, and the default is 8 samples per span. GeometryAttribute values, such as UVs and colors, will be interpolated with curve interpolation, with the same weights as the points. To improve interactive display performance of deforming curves, regular sampled curve data can be created and cached with the method Curves.getUpdatedSampling. Curve interpolation weights are pre-computed and cached globally for optimal multithreaded computation speed.

Note: Methods that read Curve parameters, get or set their attributes are thread safe. Methods that modify the curve set or their topology (eg: Curve.addPoints) are not thread safe.

Next, we will give more details about the supported curve types.

Linear curves

A linear curve is defining line segments that join each curve points. An additional segment is added from the last to the first point if it is closed. The parametric domain of a linear curve goes from [0..number of segments-1] (Curves.getDomain).

Mathematically, tangents are constant over segments, and there is no curvature. However, in order to have more continuous values, smoothed tangents can be computed so they are interpolated between line segments. This behavior is enabled by default, but can be changed with the method Curves.smoothLinearCurveTangents.

Bezier curves

Bezier curves are defined as pieces, and the curve shape for each of these pieces is influenced by N points (N = order = curve degree + 1). Each piece corresponds to one curve span, and the curve’s parametric domain is defined from [0.. number of pieces-1] (Curves.getDomain).

An open Bezier curve of degree D (D = order-1) with N pieces has D*N+1 points. A closed Bezier curve of degree D with N pieces has D*N points. Note that, while it is possible to create a Bezier curve with any number of points, last points that are not forming a complete piece are ignored until more points are added to complete it.

While the curve is continuous inside a piece, curve’s smoothness at the pieces’ boundary depends on the alignment of previous and next points, which can be interpreted as “tangent points”.

NURBS curves

NURBS (Non-Uniform Rational B-Spline) curves are a superset of Bezier curves, which can define a curve that can be smooth over an arbitrary number of points (no intrinsic concept of “pieces” like Bezier curves).

Similarly to the Bezier curve, each NURBS curve span (curve section) is influenced by order (degree of the curve + 1) points. When moving from a span to the next one, the set of influencing points changes. For example, if the current span was influenced by points [A,B,C,D], the next span will be influenced by points [B,C,D,E]. At the span boundary, the weight of A becomes zero, while the weight of E becomes non-zero.

There exists three forms of NURBS:

  • An open curve (curveForm_open) will clamp the curve to the first and last point positions. Curve’s evaluated position at the beginning of the parametric domain will be the same as point 0, and its position at the end of the parametric domain will be the same as point N-1. Unless specific conditions are set, the curve will not pass by other points, and will evolve between them. The number of curve spans (sections) can be computed as the number of points (P) minus degree (D): P - D. For example, a cubic open curve (degree 3) of 5 points will have 2 spans.
  • A closed curve (curveForm_closed) will clamp the curve start and end at point 0. Curve’s evaluated position at the beginning and the end of the parametric domain will be the same as point 0. Unless the first and last points are properly aligned, the curve will not be smooth at point 0. Unless specific conditions are set, the curve will not pass by other points, and will evolve between them. The number of curve spans (sections) can be computed as the number of points (P) minus degree (D) plus one: P - D + 1. For example, a cubic closed curve (degree 3) of 5 points will have 2 spans. Note: As opposed to Maya, the closed curve points don’t include the repeated point.
  • A periodic curve (curveForm_periodic) will be defined as if the points defined a circular list. As such, the curve will be smooth everywhere, since it is not clamped to end points. Unless specific conditions are set, the curve will pass by no points, and will evolve between them. The number of curve spans (sections) is equal to the number of points (exluding the repeated points). For example, a cubic periodic curve (degree 3) of 5 points will have 5 spans. Note: As opposed to Maya, the periodic curve points don’t include the D repeated points.

Additionally to points, NURBS curves’ definition include a notion of a knot vector. In most cases, the default knot vector is desired and the user doesn’t have to worry about the notion of knots. Knot values will be automatically created internally to match curve’s number of points and form (open, closed, periodic). Non-default knot values is mostly useful for preserving curve definition when importing from other software. The knot vector defines the parametric interval for each span. For example, this can allow to have the “U” parameter change more slowly depending on the knot vector (eg: knots [-2, -1, 0, 0.5, 2.0, 3.0...]). The number of knots depends strictly of the number of points and the degree of the curve:

  • Open curve: the number of knots (K) equals the number of points (P) plus degree (D) - 1: K = P + D - 1
  • Closed curve: the number of knots equals the number of points (P) plus degree (D) - 2: K = P + D - 2 Note: As opposed to Maya, the closed curve points don’t include the repeated point.
  • Closed curve: the number of knots equals the number of points (P) plus 2*degree (2*D) - 1: K = P + 2*D - 1 Note: As opposed to Maya, the periodic curve points don’t include the D repeated point.

Note: Non-uniform knots are often used to express a Bezier in NURBS form. While this will work, it is better to create a Bezier curve instead, for optimal performance.

Rational curves

NURBS and Bezier curves can have rational weights. By default, points are associated with a weight of 1.0. However, it is possible to assign a different weight to each point (Curves.setPointPosition( UInt32, UInt32, Vec3_d, Float32 )). The weight is interpreted relatively to other points that influence a span. Points of higher weight will attract the curve closer to them, while points with smaller weight will have less influence on curve’s trajectory.

The rational weights for all curves are stored in a ScalarAttribute named “rationalWeights”. This attribute is created only if a weight != 1.0 is set.

A homogeneous coordinate is a 4D coordinate where XYZ are pre-multiplied with the weight: (w*x, w*y, w*z, w).

Before setting rational weights != 1.0 in parallel, ensure that the “rationalWeights” ScalarAttribute exists by calling ensureRationalWeightsAttributeExists before the parallel evaluation.

Curves Curves Curves BaseGeometry BaseGeometry Curves->BaseGeometry Geometry Geometry Curves->Geometry StatisticSourceWithAutoRegisterMember StatisticSourceWithAutoRegisterMember BaseGeometry->StatisticSourceWithAutoRegisterMember ThreadsafeMetaDataOwner ThreadsafeMetaDataOwner BaseGeometry->ThreadsafeMetaDataOwner Versioned Versioned BaseGeometry->Versioned

Members

GeometryAttributes attributes Container for all attributes.
String debugName Name that will be printed in descriptions.
UInt32 structureVersion Version of the geometry structure itself, excluding the GeometryAttributes content.
Boolean computeGPUBoundingVolume If positions are on the GPU: if true, the bounding volume is computed, else an infinite bbox is returned.
ThreadsafeMetaDataContainer metaData Container for holding various user data (Geometry specific), such as the BoundingBox cache data, or raycast acceleration structures and data (Octree).
CurvesStructure data  
UInt32 memType  
Ref<Vec3Attribute> positionsAttribute  
Ref<Vec3_dAttribute> positionsAttribute_d  
Ref<ScalarAttribute> weightsAttribute  
UInt32 drawSamplesPerSpan  
Float32 drawThickness  
UInt32 topoChangesBracket  
Curves_lengthComputeCache lengthComputeCache  
LockedInitialize lengthComputeCacheInit  

Methods

  Curves ( in Boolean float64Positions )
  Curves ( in Curves other )
  Curves ( in String debugName )
  Curves ()
UInt32 allCurvesPointRange ? ()
  applyTransform ! ( in Mat44 transform )
  applyTransform ! ( in Xfo transform )
Curves clone ? ()
  convertToCPU ! ()
  convertToGPU ! ()
  copy ! ( in Curves src )
  copy ! ( in Geometry src )
  copyCurve ! ( in Ref<Curves> sourceCurves, in UInt32 sourceCurveIndex, in UInt32 targetCurveIndex, in Boolean createMissingSourceAttributes )
  copyCurve ! ( in UInt32 sourceCurveIndex, in UInt32 targetCurveIndex )
UInt32 curveCount ? ()
Size elementCount ? ()
  endStructureChanges ! ()
Vec3[] getAllPointPositions ? ()
LocalBoundingVolume getBoundingVolume ? ()
Vec3 getCurvatureAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3 getCurvatureAtParam ? ( in UInt32 curveIndex, in Float32 param )
Curve getCurve ? ( in UInt32 curveIndex )
UInt8 getCurveType ? ( in UInt32 curveIndex )
String getCurveTypeString ? ( in UInt32 curveIndex )
String getDebugName ? ()
UInt8 getDegree ? ( in UInt32 curveIndex )
Vec3 getDerivativeAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3 getDerivativeAtParam ? ( in UInt32 curveIndex, in Float32 param )
  getDerivativesAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam, io Vec3 dU, io Vec3 dUU )
  getDerivativesAtParam ? ( in UInt32 curveIndex, in Float32 param, io Vec3 dU, io Vec3 dUU )
Vec2 getDomain ? ( in UInt32 curveIndex )
LocalBoundingVolume getElementBoundingVolume ? ( in Size index )
UInt32 getMemType ? ()
Ref<ThreadsafeMetaDataContainer> getMetaData ? ()
Vec3 getNormalAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3 getNormalAtParam ? ( in UInt32 curveIndex, in Float32 param )
UInt8 getOrder ? ( in UInt32 curveIndex )
  getPointIndicesAndWeightsAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights )
  getPointIndicesAndWeightsAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights, io LocalL8ScalarArray derivativePointWeights )
  getPointIndicesAndWeightsAtParam ? ( in UInt32 curveIndex, in Float32 param, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights )
  getPointIndicesAndWeightsAtParam ? ( in UInt32 curveIndex, in Float32 param, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights, io LocalL8ScalarArray derivativePointWeights )
Vec3 getPointPosition ? ( in Size point )
Vec3 getPositionAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3_d getPositionAtNormalizedParam_d ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3 getPositionAtParam ? ( in UInt32 curveIndex, in Float32 param )
Vec3_d getPositionAtParam_d ? ( in UInt32 curveIndex, in Float32 param )
UInt32 getStructureVersion ? ()
  getTangentAndCurvatureAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam, io Vec3 tangent, io Vec3 curvature )
  getTangentAndCurvatureAtParam ? ( in UInt32 curveIndex, in Float32 param, io Vec3 tangent, io Vec3 curvature )
Vec3 getTangentAtNormalizedParam ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Vec3 getTangentAtParam ? ( in UInt32 curveIndex, in Float32 param )
UInt32 getVersion ? ()
Boolean hasFloat64Positions ? ()
  incrementPointPositionsVersion ! ()
Boolean isRemoved ? ( in UInt32 curveIndex )
UInt32 mergeCurves ! ( in Curves sourceCurves[], in Boolean createMissingSourceAttributes )
UInt32 mergeCurves ! ( in Ref<Curves> sourceCurves, in Boolean createMissingSourceAttributes )
Size pointCount ? ()
Curve pushCurve ! ( in Curve sourceCurve, in Boolean createMissingSourceAttributes )
UInt32 pushCurve ! ( in Ref<Curves> sourceCurves, in UInt32 sourceCurveIndex, in Boolean createMissingSourceAttributes )
  reservePoints ! ( in UInt32 curveIndex, in UInt32 pointCount )
  setAllPointPositions ! ( in Vec3 positions[] )
  setCurveCount ! ( in Size curveCount )
  setDrawSamplesPerSpan ! ( in UInt32 samples )
  setDrawThickness ! ( in UInt32 pixels )
  setPointPosition ! ( in Size point, in Vec3 position )
  smoothLinearCurveTangents ! ( in Boolean enable )
Boolean smoothedLinearCurveTangents ? ()

NURBS methods

Curve addNURBS ! ( in UInt32 pointCount, in UInt8 degree, in UInt8 curveForm )
Curve addNURBS ! ( in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
Curve addNURBS ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm )
Curve addNURBS ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
Curve addNURBS ! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm )
Curve addNURBS ! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
UInt32 addNURBSIndex ! ( in UInt32 pointCount, in UInt8 degree, in UInt8 curveForm )
UInt32 addNURBSIndex ! ( in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
UInt32 addNURBSIndex ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm )
UInt32 addNURBSIndex ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
UInt32 addNURBSIndex ! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm )
UInt32 addNURBSIndex ! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )
Float32 getNURBSKnot ? ( in UInt32 curveIndex, in UInt32 knotIndex )
UInt32 getNURBSKnotCount ? ( in UInt32 curveIndex )
Float32[] getNURBSKnots ? ( in UInt32 curveIndex )
Boolean isPeriodic ? ( in UInt32 curveIndex )
  setNURBSKnot ! ( in UInt32 curveIndex, in UInt32 knotIndex, in Float32 knotValue )

Attributes methods

Ref<GeometryAttributes> getAttributes ? ()

Bezier methods

Curve addBezier ! ( in UInt32 pieceCount, in UInt8 degree, in Boolean isClosed )
Curve addBezier ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in Boolean isClosed )
Curve addBezier ! ( in Vec3 pointPositions<>, in UInt8 degree, in Boolean isClosed )
UInt32 addBezierIndex ! ( in UInt32 pieceCount, in UInt8 degree, in Boolean isClosed )
UInt32 addBezierIndex ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in Boolean isClosed )
UInt32 addBezierIndex ! ( in Vec3 pointPositions<>, in UInt8 degree, in Boolean isClosed )
Curve addCubicBezier ! ( in UInt32 pieceCount, in Boolean isClosed )
Curve addCubicBezier ! ( in Vec3 pointPositions<>, in Boolean isClosed )
Curve addCubicBezier ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )
UInt32 addCubicBezierIndex ! ( in UInt32 pieceCount, in Boolean isClosed )
UInt32 addCubicBezierIndex ! ( in Vec3 pointPositions<>, in Boolean isClosed )
UInt32 addCubicBezierIndex ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )
Curve addQuadraticBezier ! ( in UInt32 pieceCount, in Boolean isClosed )
Curve addQuadraticBezier ! ( in Vec3 pointPositions<>, in Boolean isClosed )
Curve addQuadraticBezier ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )
UInt32 addQuadraticBezierIndex ! ( in UInt32 pieceCount, in Boolean isClosed )
UInt32 addQuadraticBezierIndex ! ( in Vec3 pointPositions<>, in Boolean isClosed )
UInt32 addQuadraticBezierIndex ! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )

Debugging methods

String getCurveDesc ? ( in UInt32 curveIndex, in Boolean withAttributes, in Boolean useUnitTestPrint )
String getCurveDescInternal ? ( in UInt32 curveIndex, in Boolean withAttributes, in Boolean useUnitTestPrint, in String indent )
String getDesc ? ( in Boolean withAttributes )
String getDesc ? ( in Boolean withAttributes, in Boolean useUnitTestPrint )

Length methods

Float32 getCurveLength ? ( in UInt32 curveIndex )
Float32 getLengthFromParameter ? ( in UInt32 curveIndex, in Float32 param )
Float32 getLengthRatioFromNormalizedParameter ? ( in UInt32 curveIndex, in Float32 normalizedParam )
Float32 getNormalizedParameterFromLengthRatio ? ( in UInt32 curveIndex, in Float32 ratio )
Float32 getParameterFromLength ? ( in UInt32 curveIndex, in Float32 length )
  setLengthComputeParameters ! ( in Boolean preciseMode, in UInt32 initialSamplesPerSpan, in Float32 preciseModeTolerance )

Linear methods

Curve addLinearCurve ! ( in UInt32 pointCount, in Boolean isClosed )
Curve addLinearCurve ! ( in Vec3 pointPositions<>, in Boolean isClosed )
UInt32 addLinearCurveIndex ! ( in UInt32 pointCount, in Boolean isClosed )
UInt32 addLinearCurveIndex ! ( in Vec3 pointPositions<>, in Boolean isClosed )

Modeling methods

UInt32 addPoints ! ( in UInt32 curveIndex, in UInt32 addedPointCount )
UInt32 addPoints ! ( in UInt32 curveIndex, in Vec3 pointPositions<> )
UInt32 addPoints ! ( in UInt32 curveIndex, in Vec3 pointPositions<>, in Float32 rationalWeights<> )
  beginStructureChanges ! ()
  closeCurve ! ( in UInt32 curveIndex )
  openCurve ! ( in UInt32 curveIndex )
  openOrCloseCurve ! ( in UInt32 curveIndex, in Boolean open )
  removeCurve ! ( in UInt32 curveIndex )

Point methods

  ensureRationalWeightsAttributeExists ! ()
UInt32 getAttributeIndex ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
UInt32 getFirstPointIndex ? ( in UInt32 curveIndex )
Vec4 getHomogeneousPointPosition ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
Vec4_d getHomogeneousPointPosition_d ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
UInt32 getPointCount ? ( in UInt32 curveIndex )
UInt32 getPointCount ? ( in UInt32 curveIndex, in Boolean includeRepeatedPoints )
UInt32 getPointIndex ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
Vec3 getPointPosition ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
Vec3_d getPointPosition_d ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
  getPointRange ? ( in UInt32 curveIndex, io UInt32 firstPoint, io UInt32 pointsEnd )
Float32 getRationalWeight ? ( in UInt32 curveIndex, in UInt32 curvePointIndex )
Boolean isRational ? ( in UInt32 curveIndex )
  setPointPosition ! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3 position )
  setPointPosition ! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3 position, in Float32 rationalWeight )
  setPointPosition_d ! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3_d position )
  setPointPosition_d ! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3_d position, in Float32 rationalWeight )
  setRationalWeight ! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Float32 weight )

Primitives methods

Curve addLine ! ( in Vec3 start, in Vec3 end )
Curve addLinearArc ! ( in Xfo xfo, in Scalar radius, in Vec2 angleMinMax, in Integer detail )
Curve addLinearCircle ! ( in Xfo xfo, in Scalar radius, in Size detail )
  addLinearSphere ! ( in Xfo xfo, in Scalar radius, in Size detail )
UInt32 addRectangle ! ( in Xfo xfo, in Scalar length, in Scalar width )

Sampling methods

Ref<Curves_samplingData> getUpdatedSampling ? ( in Boolean computeSampledTangents )
Ref<GeometryAttribute> updateAttributeSampling ! ( io Ref<Curves_samplingData> samplingData, in Ref<GeometryAttribute> attribute )

Topology methods

Boolean isClosed ? ( in UInt32 curveIndex )
Boolean isOpen ? ( in UInt32 curveIndex )

Methods in detail

Curves ( in Boolean float64Positions )

Constructor.

float64Positions If true, positions will use a Float64 precision (Vec3_d)


Curves ( in Curves other )

copy constructor


Curves ( in String debugName )

Constructor taking the string to be used as the name.

debugName the name displayed in debugging


Curves ()

Constructor. By default, the Curves points (CVs) use a Float32 precision.


UInt32 Curves.allCurvesPointRange? ()

Returns the total number of points for all curves.


Curves.applyTransform! ( in Mat44 transform )

Geometry interface: transforms the positions of the geometry


Curves.applyTransform! ( in Xfo transform )

Geometry interface: transforms the positions of the geometry


Curves Curves.clone? ()

clone method


Curves.convertToCPU! ()


Curves.convertToGPU! ()


Curves.copy! ( in Curves src )

Copies the content from the source Curves.


Curves.copy! ( in Geometry src )

Copies the content from the source Geometry.


Curves.copyCurve! ( in Ref<Curves> sourceCurves, in UInt32 sourceCurveIndex, in UInt32 targetCurveIndex, in Boolean createMissingSourceAttributes )

Copies a curve from the source curves. The source curves can be this or another object.

createMissingSourceAttributes If a source attribute doesn’t exist on this container, create it. If false, that source attribute is ignored.


Curves.copyCurve! ( in UInt32 sourceCurveIndex, in UInt32 targetCurveIndex )


UInt32 Curves.curveCount? ()

Returns the number of curves.

注釈

If a curve was removed (Curves.removeCurve) within the current structure change bracket (Curves.beginStructureChanges) then the includes removed curves (their indices have not been replaced yet).


Size Curves.elementCount? ()

Geometry interface: returns the number of curves.


Curves.endStructureChanges! ()

Marks the end of structural changes for the curves. If some point or curve indices is unused, this might recompact the indices for all curves to maximize memory usage.

注釈

The CurvesStructureChangeBracket wraps a being/endStructureChanges using its constructor and destructor, which can reduce unbalanced bracket errors.

注釈

Structure change brackets can be nested, in which case only the outer Curves.endStructureChanges will compile the changes.


Vec3[] Curves.getAllPointPositions? ()

Geometry interface: returns all point positions, for all curves.


LocalBoundingVolume Curves.getBoundingVolume? ()

Returns the bounding volume of the geometry, as computed from the positions attribute. This function will cache the bounding box given a specific version of the positions attribute, and will update it lazily, in a thread-safe fashion. The internal cache is stored in the BaseGeometry.metaData container.


Vec3 Curves.getCurvatureAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns the curvature vector (normal * arcLength) at this normalized parameter. If no curvature (eg: linear curve), :ref:`Vec3 <vec3>`() is returned. The arc length can be computed as curvature.length(), or SCALAR_INFINITE if length is 0. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getCurvatureAtParam? ( in UInt32 curveIndex, in Float32 param )

Returns the curvature vector (normal * arcLength) at this parameter. If no curvature (eg: linear curve), Vec3 <vec3>`() is returned. The arc length can be computed as curvature.length(), or SCALAR_INFINITE if length is 0. The param should be within the range [domainStart .. domainEnd], as returned by :kl-ref:`Curves.getDomain.


Curve Curves.getCurve? ( in UInt32 curveIndex )

Returns a Curve accessor for the sub-curve of index curveIndex. The Curve keeps an owning reference to the Curves container.


UInt8 Curves.getCurveType? ( in UInt32 curveIndex )

Returns the curve type: curveType_linear, curveType_bezier or curveType_NURBS


String Curves.getCurveTypeString? ( in UInt32 curveIndex )

Returns the curve type as a String: “linear”, “Bezier” or “NURBS”.


String Curves.getDebugName? ()

Returns the debug name used when constructing the geometry.


UInt8 Curves.getDegree? ( in UInt32 curveIndex )

Returns the degree of the curve. The order is equal to curve’s order - 1. A higher degree allows a smoother curve, but implies more complex computations. For NURBS and Bezier curves, the most common degree is 3.


Vec3 Curves.getDerivativeAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns the curve derivative vector at this normalized parameter (relative to normalized param units). The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getDerivativeAtParam? ( in UInt32 curveIndex, in Float32 param )

Returns the curve derivative vector at this parameter (relative to param units). The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


Curves.getDerivativesAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam, io Vec3 dU, io Vec3 dUU )

Returns the curve first and second derivative vectors at this normalized parameter (relative to normalized param units). The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Curves.getDerivativesAtParam? ( in UInt32 curveIndex, in Float32 param, io Vec3 dU, io Vec3 dUU )

Returns the curve first and second derivative vectors at this parameter (relative to param units). The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


Vec2 Curves.getDomain? ( in UInt32 curveIndex )

Returns the curve domain start and end. This is the range of parameter (“t” or “u”) at which the curve can be evaluated. For NURBS, the domain depends on the knot values and its form. For linear and Bezier curves, the domain depends on the number of spans (curve segments or pieces). See Curves for more details.

注釈

For all curve types, it is possible that the domain doesn’t start at 0, if the curve was imported or if a NURBS has explicit knot values.


LocalBoundingVolume Curves.getElementBoundingVolume? ( in Size index )

Geometry interface: return the bounding volume of a curve, by including its points (conservative bounding box).


UInt32 Curves.getMemType? ()

Returns the memory location id. CPU = 0, GPU = 1, VSM = 2;

注釈

GPU support for Curves is not implemented, however its data structure was written to allow this eventually.


Ref<ThreadsafeMetaDataContainer> Curves.getMetaData? ()

Returns the metaData container for this Geometry.


Vec3 Curves.getNormalAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns the unit curve normal on the curve evaluated at this normalized parameter. The curve normal is computed as the normalized curvature vector. As such, it can be unstable along the curve, depending on curvature changes, and is ill-defined on straight segments. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getNormalAtParam? ( in UInt32 curveIndex, in Float32 param )

Returns the unit curve normal on the curve evaluated at this parameter. The curve normal is computed as the normalized curvature vector. As such, it can be unstable along the curve, depending on curvature changes, and is ill-defined on straight segments. The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


UInt8 Curves.getOrder? ( in UInt32 curveIndex )

Returns the order of the curve. The order is equal to curve’s degree + 1. The order also corresponds to the number of weighted points that influence the curve at a specific parameter. A higher order allows a smoother curve, but implies more complex computations. For NURBS and Bezier curves, the most common order is 4.


Curves.getPointIndicesAndWeightsAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights )

Returns the array of point indices and associated weights that correspond to curve’s evaluation basis at this normalized parameter. These can be used to evaluate any curve attribute from a convex (linear) combination of point values. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Curves.getPointIndicesAndWeightsAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights, io LocalL8ScalarArray derivativePointWeights )

Returns the array of point indices and associated weights and derivative weights that correspond to curve’s evaluation basis at this normalized parameter. These can be used to evaluate any curve attribute and its derivative from a convex (linear) combination of point values. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Curves.getPointIndicesAndWeightsAtParam? ( in UInt32 curveIndex, in Float32 param, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights )

Returns the array of point indices and associated weights that correspond to curve’s evaluation basis at this parameter. These can be used to evaluate any curve attribute from a convex (linear) combination of point values.


Curves.getPointIndicesAndWeightsAtParam? ( in UInt32 curveIndex, in Float32 param, io LocalL8UInt32Array pointIndices, io LocalL8ScalarArray pointWeights, io LocalL8ScalarArray derivativePointWeights )

Returns the array of point indices and associated weights and derivative weights that correspond to curve’s evaluation basis at this parameter. These can be used to evaluate any curve attribute and its derivative from a convex (linear) combination of point values. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getPointPosition? ( in Size point )

Returns the position of a point, based on a global indexing (for all curves).


Vec3 Curves.getPositionAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns a position on the curve evaluated at this normalized parameter. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3_d Curves.getPositionAtNormalizedParam_d? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns a double precision position on the curve evaluated at this normalized parameter. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getPositionAtParam? ( in UInt32 curveIndex, in Float32 param )

Returns a position on the curve evaluated at this parameter. The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


Vec3_d Curves.getPositionAtParam_d? ( in UInt32 curveIndex, in Float32 param )

Returns a double precision position on the curve evaluated at this parameter. The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


UInt32 Curves.getStructureVersion? ()

Returns the version of the geometry structure including the the attribute set (but not attribute values). For Curves, this includes the knot values of NURBS curve, and also the open/closed state.


Curves.getTangentAndCurvatureAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam, io Vec3 tangent, io Vec3 curvature )

Returns the unit tangent and the curvature vector (normal * arcLength) at this normalized parameter. If no curvature (eg: linear curve), curvature is set to Vec3(). The arc length can be computed as curvature.length(), or SCALAR_INFINITE if length is 0. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.

注釈

This function has the same cost as Curves.getCurvatureAtNormalizedParam since the tangent is computed internally anyway


Curves.getTangentAndCurvatureAtParam? ( in UInt32 curveIndex, in Float32 param, io Vec3 tangent, io Vec3 curvature )

Returns the unit tangent and the curvature vector (normal * arcLength) at this parameter. If no curvature (eg: linear curve), curvature is set to Vec3(). The arc length can be computed as curvature.length(), or SCALAR_INFINITE if length is 0. The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.

注釈

This function has the same cost as Curves.getCurvatureAtParam since the tangent is computed internally anyway


Vec3 Curves.getTangentAtNormalizedParam? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns the unit tangent at this normalized parameter. The normalizedParam should be within the range [0..1], which will be remapped linearly from domainStart to domainEnd.


Vec3 Curves.getTangentAtParam? ( in UInt32 curveIndex, in Float32 param )

Returns the unit tangent at this parameter. The param should be within the range [domainStart .. domainEnd], as returned by Curves.getDomain.


UInt32 Curves.getVersion? ()

Returns the version of the geometry including attribute values


Boolean Curves.hasFloat64Positions? ()

Returns true if the curves stores its positions in Float64 (double precision Vec3_d), otherwise they are stored in Float32 (single precision Vec3).


Curves.incrementPointPositionsVersion! ()

Helper for incrementing the version of the positions attribute after value changes. See Attribute versioning for more information.


Boolean Curves.isRemoved? ( in UInt32 curveIndex )

Returns true if the curve has been removed by method Curves.removeCurve (invalid curve index).


UInt32 Curves.mergeCurves! ( in Curves sourceCurves[], in Boolean createMissingSourceAttributes )

Appends all source curves at our last index.

createMissingSourceAttributes If a source attribute doesn’t exist on this container, create it. If false, that source attribute is ignored.


UInt32 Curves.mergeCurves! ( in Ref<Curves> sourceCurves, in Boolean createMissingSourceAttributes )

Appends all source curves at our last index.

createMissingSourceAttributes If a source attribute doesn’t exist on this container, create it. If false, that source attribute is ignored.


Size Curves.pointCount? ()

Returns the number of points, based on a global indexing (for all curves).


Curve Curves.pushCurve! ( in Curve sourceCurve, in Boolean createMissingSourceAttributes )

Push source curve to our last index.

createMissingSourceAttributes If a source attribute doesn’t exist on this container, create it. If false, that source attribute is ignored.


UInt32 Curves.pushCurve! ( in Ref<Curves> sourceCurves, in UInt32 sourceCurveIndex, in Boolean createMissingSourceAttributes )

Push source curve to our last index.

createMissingSourceAttributes If a source attribute doesn’t exist on this container, create it. If false, that source attribute is ignored.


Curves.reservePoints! ( in UInt32 curveIndex, in UInt32 pointCount )

Pre-allocates point space for this curve so that Curves.addPoints doesn’t need to resize the memory vector.


Curves.setAllPointPositions! ( in Vec3 positions[] )

Geometry interface: sets all point positions, for all curves


Curves.setCurveCount! ( in Size curveCount )

Changes the curve count. If size is increasing, undefined empty curves are added (type = curveType_none). If decreasing, last curves are removed.


Curves.setDrawSamplesPerSpan! ( in UInt32 samples )

Sets the number of curve samples per span created for the drawing. This has no impact on linear curves (1 sample per point).


Curves.setDrawThickness! ( in UInt32 pixels )

Sets the draw thickness, in pixels, to be used by the drawing.


Curves.setPointPosition! ( in Size point, in Vec3 position )

Sets the positions of a point, based on a global indexing (for all curves).

注釈

Once positions have been set, call Curves.incrementPositionsVersion (see Attribute versioning)


Curves.smoothLinearCurveTangents! ( in Boolean enable )

If enabled, linear curve tangents will be interpolated from mid-segments. This will also have an effect on the derivatives and the normal.


Boolean Curves.smoothedLinearCurveTangents? ()

Returns true if the curve tangents are interpolated from mid-segments. This will also has an effect on the derivatives and the normal.


NURBS methods

Curve Curves.addNURBS! ( in UInt32 pointCount, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointCount exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve, it implicitly wraps over points [0 .. degree-1].

pointCount Point count without the implicit repeated points (in the case of closed / periodic).
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


Curve Curves.addNURBS! ( in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms.

degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


Curve Curves.addNURBS! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve, it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


Curve Curves.addNURBS! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms. For an open curve, pointPositions.size() = knots.size() - degree + 1. For a closed curve, pointPositions.size() = knots.size() - degree. For a periodic curve, pointPositions.size() = knots.size() - degree*2 - 1. param rationalWeights Rational weights for the curve points

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve, it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


Curve Curves.addNURBS! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve, it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve, also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


Curve Curves.addNURBS! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns the added Curve. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve, it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve, also indicates the number of points for the curve. For an open curve, pointPositions.size() = knots.size() - degree + 1. For a closed curve, pointPositions.size() = knots.size() - degree. For a periodic curve, pointPositions.size() = knots.size() - degree*2 - 1. param degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


UInt32 Curves.addNURBSIndex! ( in UInt32 pointCount, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointCount exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve,it implicitly wraps over points [0 .. degree-1].

pointCount Point count without the implicit repeated points (in the case of closed / periodic).
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


UInt32 Curves.addNURBSIndex! ( in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms.

degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


UInt32 Curves.addNURBSIndex! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve,it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


UInt32 Curves.addNURBSIndex! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms. For an open curve, pointPositions.size() = knots.size() - degree + 1. For a closed curve, pointPositions.size() = knots.size() - degree. For a periodic curve, pointPositions.size() = knots.size() - degree*2 - 1. param rationalWeights Rational weights for the curve points

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve,it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


UInt32 Curves.addNURBSIndex! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve,it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve, also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.


UInt32 Curves.addNURBSIndex! ( in Vec3 pointPositions<>, in UInt8 degree, in UInt8 curveForm, in Float32 knots<> )

Adds a NURBS curve, and returns its curve index. If the curve is closed or periodic, pointPositions exclude repeated end point (implicitly point 0). This method is useful for specifying non-uniform knot values. See Curves for more information about NURBS knots and forms.

注釈

For a closed NURBS curve, it implicitly wraps over point 0. For a periodic NURBS curve,it implicitly wraps over points [0 .. degree-1].

pointPositions Point positions of the curve, also indicates the number of points for the curve. For an open curve, pointPositions.size() = knots.size() - degree + 1. For a closed curve, pointPositions.size() = knots.size() - degree. For a periodic curve, pointPositions.size() = knots.size() - degree*2 - 1. param degree Degree of the curve (order - 1). Must be between 1 and 7.
curveForm Must be curveForm_open, curveForm_closed or curveForm_periodic.
knots Knot sequence vector. Values must be in increasing order. For an open and closed curve, the first and last degree knots must be identical (multiplicity = degree). For a periodic curve, the intervals between the first and last order knots must be the same.


Float32 Curves.getNURBSKnot? ( in UInt32 curveIndex, in UInt32 knotIndex )

Returns a knot value for this NURBS curve.

knotIndex Knot index, between 0 and Curves.getNURBSKnotCount-1


UInt32 Curves.getNURBSKnotCount? ( in UInt32 curveIndex )

Returns the number of knots for this NURBS curve.


Float32[] Curves.getNURBSKnots? ( in UInt32 curveIndex )

Returns the knot vector for this NURBS curve.


Boolean Curves.isPeriodic? ( in UInt32 curveIndex )

NURBS CURVES Returns true if it is a NURBS curve of periodic form.


Curves.setNURBSKnot! ( in UInt32 curveIndex, in UInt32 knotIndex, in Float32 knotValue )

Sets a knot value for this NURBS curve.

注釈

Since knots are set one by one, no validation is made to the knot vector as it can be in an intermediary state

knotIndex Knot index, between 0 and Curves.getNURBSKnotCount-1


Attributes methods

Ref<GeometryAttributes> Curves.getAttributes? ()

Returns the GeometryAttributes container for this Curves.


Bezier methods

Curve Curves.addBezier! ( in UInt32 pieceCount, in UInt8 degree, in Boolean isClosed )

BEZIER CURVES Adds a bezier curve, and returns the added Curve. See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.
degree Degree of the curve (order - 1). Must be between 2 and 7.


Curve Curves.addBezier! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in Boolean isClosed )

Adds a bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude the repeated end point (repeated point is implicit). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

degree Degree of the curve (order - 1). Must be between 2 and 7.
pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


Curve Curves.addBezier! ( in Vec3 pointPositions<>, in UInt8 degree, in Boolean isClosed )

Adds a bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude the repeated end point (repeated point is implicit). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 2 and 7.


UInt32 Curves.addBezierIndex! ( in UInt32 pieceCount, in UInt8 degree, in Boolean isClosed )

Adds a bezier curve, and returns its curve index. See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.
degree Degree of the curve (order - 1). Must be between 2 and 7.


UInt32 Curves.addBezierIndex! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in UInt8 degree, in Boolean isClosed )

Adds a bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude the repeated end point (repeated point is implicit). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

degree Degree of the curve (order - 1). Must be between 2 and 7.
pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


UInt32 Curves.addBezierIndex! ( in Vec3 pointPositions<>, in UInt8 degree, in Boolean isClosed )

Adds a bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude the repeated end point (repeated point is implicit). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.
degree Degree of the curve (order - 1). Must be between 2 and 7.


Curve Curves.addCubicBezier! ( in UInt32 pieceCount, in Boolean isClosed )

Adds a cubic bezier curve, and returns the added Curve. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.


Curve Curves.addCubicBezier! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a cubic bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.


Curve Curves.addCubicBezier! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )

Adds a cubic bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


UInt32 Curves.addCubicBezierIndex! ( in UInt32 pieceCount, in Boolean isClosed )

Adds a cubic bezier curve, and returns its curve index. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.


UInt32 Curves.addCubicBezierIndex! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a cubic bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.


UInt32 Curves.addCubicBezierIndex! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )

Adds a cubic bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


Curve Curves.addQuadraticBezier! ( in UInt32 pieceCount, in Boolean isClosed )

Adds a quadratic bezier curve, and returns the added Curve. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.


Curve Curves.addQuadraticBezier! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a quadratic bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.


Curve Curves.addQuadraticBezier! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )

Adds a quadratic bezier curve, and returns the added Curve. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


UInt32 Curves.addQuadraticBezierIndex! ( in UInt32 pieceCount, in Boolean isClosed )

Adds a quadratic bezier curve, and returns its curve index. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.

pieceCount Number of Bezier pieces. Point count will be pieceCount*degree + 1 for an open curve, and pieceCount*degree for a closed curve.


UInt32 Curves.addQuadraticBezierIndex! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a quadratic bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve, also indicates the number of points for the curve.


UInt32 Curves.addQuadraticBezierIndex! ( in Vec3 pointPositions<>, in Float32 rationalWeights<>, in Boolean isClosed )

Adds a quadratic bezier curve, and returns its curve index. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.

注釈

End points that are not forming a full Bezier piece are ignored until more points are added to complete that piece.

pointPositions Point positions of the curve (3D coordinates, not in homogeneous coordinates), also indicates the number of points for the curve.
rationalWeights Rational weights for the curve points


Debugging methods

String Curves.getCurveDesc? ( in UInt32 curveIndex, in Boolean withAttributes, in Boolean useUnitTestPrint )

Returns a String description of a curve

withAttributes Include the attribute values in the description.
useUnitTestPrint use the unitTestPrint method to ensure that the values are consistent accross platforms (used in unit testing).


String Curves.getCurveDescInternal? ( in UInt32 curveIndex, in Boolean withAttributes, in Boolean useUnitTestPrint, in String indent )

Returns a String description of a curve

withAttributes Include the attribute values in the description.
useUnitTestPrint use the unitTestPrint method to ensure that the values are consistent accross platforms (used in unit testing).


String Curves.getDesc? ( in Boolean withAttributes )

Returns a String description of the Curves

withAttributes Prints all attribute values


String Curves.getDesc? ( in Boolean withAttributes, in Boolean useUnitTestPrint )

Returns a String description of the curves

withAttributes Include the attribute values in the description.
useUnitTestPrint use the unitTestPrint method to ensure that the values are consistent accross platforms (used in unit testing).


Length methods

Float32 Curves.getCurveLength? ( in UInt32 curveIndex )

Returns the computation of the curve length.

注釈

This computation can be relatively costly, as it cannot be done analytically. The computation is cached along with a table that maps length to parameter values. The computation speed and precision of length-related methods is controlled by parameters of Curves.setLengthComputeParameters


Float32 Curves.getLengthFromParameter? ( in UInt32 curveIndex, in Float32 param )

Returns the curve length corresponding to the parameter, where domainStart is mapped to 0, and domainEnd is mapped to length. Values outside of domainStart..domainEnd will be clamped to that range.

注釈

This computation can be relatively costly, as it cannot be done analytically. The computation is cached along with a table that maps length to parameter values. The computation speed and precision of length-related methods is controlled by parameters of Curves.setLengthComputeParameters


Float32 Curves.getLengthRatioFromNormalizedParameter? ( in UInt32 curveIndex, in Float32 normalizedParam )

Returns the curve length ratio (0..1) corresponding to the normalized parameter (0..1). Values outside of 0..1 will be clamped to that range.

注釈

This computation can be relatively costly, as it cannot be done analytically. The computation is cached along with a table that maps length to parameter values. The computation speed and precision of length-related methods is controlled by parameters of Curves.setLengthComputeParameters


Float32 Curves.getNormalizedParameterFromLengthRatio? ( in UInt32 curveIndex, in Float32 ratio )

Returns the normalized parameter (0..1) corresponding to the curve length ratio (0..1). Values outside of 0..1 will be clamped to that range.

注釈

This computation can be relatively costly, as it cannot be done analytically. The computation is cached along with a table that maps length to parameter values. The computation speed and precision of length-related methods is controlled by parameters of Curves.setLengthComputeParameters


Float32 Curves.getParameterFromLength? ( in UInt32 curveIndex, in Float32 length )

Returns the parameter corresponding to the curve length, where 0 is mapped to domainStart, and length is mapped to domainEnd. Values outside of 0..length will be clamped to that range.

注釈

This computation can be relatively costly, as it cannot be done analytically. The computation is cached along with a table that maps length to parameter values. The computation speed and precision of length-related methods is controlled by parameters of Curves.setLengthComputeParameters


Curves.setLengthComputeParameters! ( in Boolean preciseMode, in UInt32 initialSamplesPerSpan, in Float32 preciseModeTolerance )

Sets the computation strategy for curve length related methods:

preciseMode If true, the length computation and conversion will be more costly and precise, based on preciseModeTolerance
initialSamplesPerSpan Initial sampling per span used to compute the length (optimized). If preciseMode is true, additional sampling will be done if required.
preciseModeTolerance If preciseMode is true, the total curve length will be accurate to at least the passed-in precision, which is a ratio of the actual curve length.


Linear methods

Curve Curves.addLinearCurve! ( in UInt32 pointCount, in Boolean isClosed )

LINEAR CURVES Adds a linear curve, and returns its curve index. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.


Curve Curves.addLinearCurve! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a linear curve, and returns the added curve. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.


UInt32 Curves.addLinearCurveIndex! ( in UInt32 pointCount, in Boolean isClosed )

Adds a linear curve, and returns its curve index. If the curve is closed, the pointCount excludes repeated end point count (repeated point is implicit). See Curves for more information about various curve types.


UInt32 Curves.addLinearCurveIndex! ( in Vec3 pointPositions<>, in Boolean isClosed )

Adds a linear curve, and returns its curve index. If the curve is closed, pointPositions exclude repeated end point (implicitly point 0). See Curves for more information about various curve types.


Modeling methods

UInt32 Curves.addPoints! ( in UInt32 curveIndex, in UInt32 addedPointCount )

Adds points to the curve, and returns the first added point index.

注釈

For some curve types, such as Beziers, added point will have an effect only if a full piece is formed (eg: degree points; see Curves)


UInt32 Curves.addPoints! ( in UInt32 curveIndex, in Vec3 pointPositions<> )

Adds points to the curve, and returns the first added point index.

注釈

For some curve types, such as Beziers, added point will have an effect only if a full piece is formed (eg: degree points; see Curves)


UInt32 Curves.addPoints! ( in UInt32 curveIndex, in Vec3 pointPositions<>, in Float32 rationalWeights<> )

Adds points to the curve, and returns the first added point index.

注釈

For some curve types, such as Beziers, added point will have an effect only if a full piece is formed (eg: degree points; see Curves)

pointPositions Positions, in actual 3D coordinates (not in homogeneous coordinates)
rationalWeights Rational weights for the curve points


Curves.beginStructureChanges! ()

Signals the beginning of structural changes for the curves, like adding points or removing curve. Structure change brackets will delay the recompaction of point and curve indices, which might happen if some indices are unused after the changes.

注釈

The CurvesStructureChangeBracket wraps a being/endStructureChanges using its constructor and destructor, which can reduce unbalanced bracket errors.

注釈

Structure change brackets can be nested, in which case only the outer Curves.endStructureChanges will compile the changes.


Curves.closeCurve! ( in UInt32 curveIndex )

Closes the curve (or does nothing is already closed).

  • For a linear curve, this only results in a removed segment between the last and first point.
  • For a Bezier curve, the last point (end of last piece) is removed so the piece ends with the first point (shared with the 1st piece).
  • For a NURBS curve, the last point is removed so the curve ends with the first point (shared).

注釈

If a NURBS curve is in periodic form, it is first converted to closed form without changing the point positions (the curve shape changes).


Curves.openCurve! ( in UInt32 curveIndex )

Opens the curve (or does nothing is already open).

  • For a linear curve, this only results in a removed segment between the last and first point.
  • For a Bezier and NURBS curve, the a last point is added, and it position is copied from the first point. The curve is then topologically

open, even if visually it is not open until a different position is assigned to the last point.

注釈

If a NURBS curve is in periodic form, it is first converted to closed form without changing the point positions (the curve shape changes).


Curves.openOrCloseCurve! ( in UInt32 curveIndex, in Boolean open )

Opens or closes the curve.

  • For a linear curve, this only results in an added or removed segment between the last and first point.
  • For a Bezier curve:
  • When closing, the last point (end of last piece) is removed so the piece ends with the first point (shared with the 1st piece).
  • When opening, the a last point is added, and it position is copied from the first point. The curve is then topologically

open, even if visually it is not open until a different position is assigned to the last point.

  • For a NURBS curve:
  • When closing, the last point is removed so the curve ends with the first point (shared).
  • When opening, the a last point is added, and it position is copied from the first point. The curve is then topologically

open, even if visually it is not open until a different position is assigned to the last point.

注釈

If a NURBS curve is in periodic form, it is first converted to closed form without changing the point positions (the curve shape changes).


Curves.removeCurve! ( in UInt32 curveIndex )

Removes the curve. If the caller didn’t open a structure change bracket (Curves.beginStructureChanges or CurvesStructureChangeBracket), the curve index will be replaced by the last valid one if applicable, so that all indices are used. If there a structure change bracket, this index replacement will be delayed until the last bracket is closed.


Point methods

Curves.ensureRationalWeightsAttributeExists! ()

If the “rationalWeights” ScalarAttribute doesn’t exist, it will create one. This must be called before setting positions with rational weights is called in parallel.


UInt32 Curves.getAttributeIndex? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns the global attribute index for a curve’s sub-point. This index corresponds to this point’s values in the GeometryAttributes container.

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


UInt32 Curves.getFirstPointIndex? ( in UInt32 curveIndex )

Returns the first “global” point index for that curve, which corresponds to its index in the GeometryAttributes. Other curve points use the next indices: [ Curves.getFirstPointIndex(C) .. Curves.getPointCount(C)-1 ]


Vec4 Curves.getHomogeneousPointPosition? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns a 4D point in homogeneous coordinate, which is (x*W, y*W, z*W, W), where W is the rational weight.

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Vec4_d Curves.getHomogeneousPointPosition_d? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns a 4D point in homogeneous coordinate in double precision, which is (x*W, y*W, z*W, W), where W is the rational weight.

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


UInt32 Curves.getPointCount? ( in UInt32 curveIndex )

Returns the number of points (control vertices) for the curve.


UInt32 Curves.getPointCount? ( in UInt32 curveIndex, in Boolean includeRepeatedPoints )

Returns the point (control vertices) count for the curve.

includeRepeatedPoints If true, the point count will include repeated points, which is one additional point for a closed curve, and (order-1) points for a periodic NURBS curve.


UInt32 Curves.getPointIndex? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns the global point index for a curve’s sub-point. This index corresponds to this point’s position in the GeometryAttributes container.

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Vec3 Curves.getPointPosition? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns the point position. If there is a rational weight, it will be divided by that weight (converted from homogeneous).

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Vec3_d Curves.getPointPosition_d? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns the point position. If there is a rational weight, it will be divided by that weight (converted from homogeneous).

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Curves.getPointRange? ( in UInt32 curveIndex, io UInt32 firstPoint, io UInt32 pointsEnd )

Returns the point index range correponding to curve’s points. Last point index is pointsEnd - 1 (if > 0 points).


Float32 Curves.getRationalWeight? ( in UInt32 curveIndex, in UInt32 curvePointIndex )

Returns the rational weight for curve’s point. By default, rational weights are 1.0.

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Boolean Curves.isRational? ( in UInt32 curveIndex )

Returns true if the curve has at least one rational weight != 1.0.


Curves.setPointPosition! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3 position )

Sets the position of a curve point.

注釈

Once point positions have been set, call Curves.incrementPointPositionsVersion (see Attribute versioning)

注釈

If positions are stored as Vec3_d (Float64), a conversion will be applied.

注釈

This function is threadsafe if the curves structure and attribute sharing layout is not modified by another thread.

参考

Curves.hasFloat64Positions, Curves.setPointPosition( UInt32, UInt32, Vec3_d )

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Curves.setPointPosition! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3 position, in Float32 rationalWeight )

Sets the position of a curve point. The position is the actual 3D position and not an homogeneous coordinate; it will be made an homogeneous coordinate internally.

注釈

Once point positions have been set, call Curves.incrementPointPositionsVersion (see Attribute versioning)

注釈

If positions are stored as Vec3_d (Float64), a conversion will be applied.

注釈

This function is threadsafe if the curves structure and attribute sharing layout is not modified by another thread.

参考

Curves.hasFloat64Positions, Curves.setPointPosition( UInt32, UInt32, Vec3_d, Float32 )

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Curves.setPointPosition_d! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3_d position )

Sets the position of the point in double precision (Float64).

注釈

If positions are stored as Vec3 (Float32), a conversion will be applied.

注釈

Once point positions have been set, call Curves.incrementPointPositionsVersion (see Attribute versioning)

注釈

This function is threadsafe if the curves structure and attribute sharing layout is not modified by another thread.

参考

Curves.hasFloat64Positions, Curves.setPointPosition( Size, Vec3 )

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Curves.setPointPosition_d! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Vec3_d position, in Float32 rationalWeight )

Sets the position of the point in double precision (Float64), along with its rational weight. The position is the actual 3D position and not an homogeneous coordinate; it will be made an homogeneous coordinate internally.

注釈

If positions are stored as Vec3 (Float32), a conversion will be applied.

注釈

Once point positions have been set, call Curves.incrementPointPositionsVersion (see Attribute versioning)

注釈

This function is threadsafe if the curves structure and attribute sharing layout is not modified by another thread.

参考

Curves.hasFloat64Positions, Curves.setPointPosition( Size, Vec3 )

curvePointIndex Curve’s sub-point index, ranging from 0 to Curves.getPointCount - 1


Curves.setRationalWeight! ( in UInt32 curveIndex, in UInt32 curvePointIndex, in Float32 weight )

Sets the rational weight of a curve point. This only has an impact on curves that support rational weights (rational Beziers and NURBS).

注釈

Once weights have been set, call Curves.incrementPointPositionsVersion (see Attribute versioning)

注釈

This function is threadsafe if the curves structure and attribute sharing layout is not modified by another thread, and if Curves.ensureWeightsAttributeExists has been called.

参考

Curves.hasFloat64Positions, Curves.setPointPosition( Size, Vec3_d )


Primitives methods

Curve Curves.addLine! ( in Vec3 start, in Vec3 end )

Adds a linear segment from start position to end position.


Curve Curves.addLinearArc! ( in Xfo xfo, in Scalar radius, in Vec2 angleMinMax, in Integer detail )

adds a line arc around the Y axis given a transform for the arc, a radius, a angular min and max as a Vec3 and a detail setting. the detail describes the number of line segments of the circle (minimum of 3).

angleMinMax [minAngle, maxAngle], in radians


Curve Curves.addLinearCircle! ( in Xfo xfo, in Scalar radius, in Size detail )

Adds a transformed closed circle.


Curves.addLinearSphere! ( in Xfo xfo, in Scalar radius, in Size detail )

Adds a sphere made of 3 circles, one in each axis plane


UInt32 Curves.addRectangle! ( in Xfo xfo, in Scalar length, in Scalar width )

Adds a transformed rectangle


Sampling methods

Ref<Curves_samplingData> Curves.getUpdatedSampling? ( in Boolean computeSampledTangents )

Returns an updated sampling cache, based on Curves.drawSamplesPerSpan.

computeSampledTangents If true, a ‘tangents’ sampled attribute will be created and updated. Once created, it will always be updated even if computeSampledTangents is passed as false.


Ref<GeometryAttribute> Curves.updateAttributeSampling! ( io Ref<Curves_samplingData> samplingData, in Ref<GeometryAttribute> attribute )

注釈

samplingData must be up-to-date with the Curves (see Curves.updateSampling)


Topology methods

Boolean Curves.isClosed? ( in UInt32 curveIndex )

Returns true if the curve is closed (starts and ends at its first point).


Boolean Curves.isOpen? ( in UInt32 curveIndex )

Returns true if the curve is open (starts at its first point, ends at its last point).