# NurbsCurveResult

from pandac.PandaModules import NurbsCurveResult

Class : NurbsCurveResult
Description : The result of a NurbsCurveEvaluator. This object represents a curve in a particular coordinate space. It can return the point and/or tangent to the curve at any point.
This is not related to NurbsCurve, CubicCurveseg or any of the ParametricCurve-derived objects in this module. It is a completely parallel implementation of NURBS curves, and will probably eventually replace the whole ParametricCurve class hierarchy.

## Inheritance:

NurbsCurveResult: ReferenceCount
ReferenceCount: MemoryBase
MemoryBase:

## Methods of NurbsCurveResult:

adaptiveSample
evalExtendedPoint
evalExtendedPoints
evalPoint
evalSegmentExtendedPoint
evalSegmentExtendedPoints
evalSegmentPoint
evalSegmentTangent
evalTangent
getEndT
getNumSamples
getNumSegments
getSamplePoint
getSampleT
getSegmentT
getStartT

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

adaptiveSample void NurbsCurveResult::adaptive_sample(float tolerance); Description: Determines the set of subdivisions necessary to approximate the curve with a set of linear segments, no point of which is farther than tolerance units from the actual curve. After this call, you may walk through the resulting set of samples with get_num_samples(), get_sample_t(), and get_sample_point().

evalExtendedPoint float NurbsCurveResult::eval_extended_point(float t, int d); Description: Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension.

evalExtendedPoints bool NurbsCurveResult::eval_extended_points(float t, int d, void *result[](unsigned int size), int num_values); Description: Simultaneously performs eval_extended_point on a contiguous sequence of dimensions. The dimensions evaluated are d through (d + num_values - 1); the results are filled into the num_values elements in the indicated result array.

evalPoint bool NurbsCurveResult::eval_point(float t, LVecBase3f &point); Description: Computes the point on the curve corresponding to the indicated value in parametric time. Returns true if the t value is valid, false otherwise.

evalSegmentExtendedPoint float NurbsCurveResult::eval_segment_extended_point(int segment, float t, int d) const; Description: Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension.

evalSegmentExtendedPoints void NurbsCurveResult::eval_segment_extended_points(int segment, float t, int d, void *result[](unsigned int size), int num_values) const; Description: Simultaneously performs eval_extended_point on a contiguous sequence of dimensions. The dimensions evaluated are d through (d + num_values - 1); the results are filled into the num_values elements in the indicated result array.

evalSegmentPoint void NurbsCurveResult::eval_segment_point(int segment, float t, LVecBase3f &point) const; Description: Evaluates the point on the curve corresponding to the indicated value in parametric time within the indicated curve segment. t should be in the range [0, 1]. The curve is internally represented as a number of connected (or possibly unconnected) piecewise continuous segments. The exact number of segments for a particular curve depends on the knot vector, and is returned by get_num_segments(). Normally, eval_point() is used to evaluate a point along the continuous curve, but when you care more about local continuity, you can use eval_segment_point() to evaluate the points along each segment.

evalSegmentTangent void NurbsCurveResult::eval_segment_tangent(int segment, float t, LVecBase3f &tangent) const; Description: As eval_segment_point, but computes the tangent to the curve at the indicated point. The tangent vector will not necessarily be normalized, and could be zero, particularly at the endpoints.

evalTangent bool NurbsCurveResult::eval_tangent(float t, LVecBase3f &tangent); Description: Computes the tangent to the curve at the indicated point in parametric time. This tangent vector will not necessarily be normalized, and could be zero. See also eval_point().

getEndT float NurbsCurveResult::get_end_t(void) const; Description: Returns the last legal value of t on the curve.

getNumSamples int NurbsCurveResult::get_num_samples(void) const; Description: Returns the number of sample points generated by the previous call to adaptive_sample().

getNumSegments int NurbsCurveResult::get_num_segments(void) const; Description: Returns the number of piecewise continuous segments within the curve. This number is usually not important unless you plan to call eval_segment_point().

getSamplePoint LPoint3f const &NurbsCurveResult::get_sample_point(int n) const; Description: Returns the point on the curve of the nth sample point generated by the previous call to adaptive_sample(). For tangents, or extended points, you should use get_sample_t() and pass it into eval_tangent() or eval_extended_point().

getSampleT float NurbsCurveResult::get_sample_t(int n) const; Description: Returns the t value of the nth sample point generated by the previous call to adaptive_sample().

getSegmentT float NurbsCurveResult::get_segment_t(int segment, float t) const; Description: Accepts a t value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding t value in the entire curve (as in eval_point()).

getStartT float NurbsCurveResult::get_start_t(void) const; Description: Returns the first legal value of t on the curve. Usually this is 0.0.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.