# panda3d.core.CurveFitter¶

class CurveFitter

Inheritance diagram

__init__() → None
__init__(param0: CurveFitter) → None
reset() → None

Removes all the data points previously added to the CurveFitter, and initializes it for a new curve.

addXyz(t: float, xyz: LVecBase3) → None

Adds a single sample xyz.

addHpr(t: float, hpr: LVecBase3) → None

Adds a single sample hpr.

addXyzHpr(t: float, xyz: LVecBase3, hpr: LVecBase3) → None

Adds a single sample xyz & hpr simultaneously.

getNumSamples() → int

Returns the number of sample points that have been added.

getSampleT(n: int) → float

Returns the parametric value of the nth sample added.

getSampleXyz(n: int) → LVecBase3

Returns the point in space of the nth sample added.

Return type

LVecBase3

getSampleHpr(n: int) → LVecBase3

Returns the orientation of the nth sample added.

Return type

LVecBase3

getSampleTangent(n: int) → LVecBase3

Returns the tangent associated with the nth sample added. This is only meaningful if computeTangents() has already been called.

Return type

LVecBase3

removeSamples(begin: int, end: int) → None

Eliminates all samples from index begin, up to but not including index end, from the database.

sample(curves: ParametricCurveCollection, count: int) → None

Generates a series of data points by sampling the given curve (or xyz/hpr curves) the indicated number of times. The sampling is made evenly in parametric time, and then the timewarps, if any, are applied.

wrapHpr() → None

Resets each HPR data point so that the maximum delta between any two consecutive points is 180 degrees, which should prevent incorrect HPR wrapping.

sortPoints() → None

Sorts all the data points in order by parametric time, in case they were added in an incorrect order.

desample(factor: float) → None

Removes sample points in order to reduce the complexity of a sampled curve. Keeps one out of every factor samples. Also keeps the first and the last samples.

computeTangents(scale: float) → None

Once a set of points has been built, and prior to calling MakeHermite() or MakeNurbs(), ComputeTangents() must be called to set up the tangents correctly (unless the tangents were defined as the points were added).

makeHermite() → ParametricCurveCollection

Converts the current set of data points into a Hermite curve.

Return type

ParametricCurveCollection

makeNurbs() → ParametricCurveCollection

Converts the current set of data points into a NURBS curve. This gives a smoother curve than produced by MakeHermite().

Return type

ParametricCurveCollection

output(out: ostream) → None
write(out: ostream) → None
static getClassType() → TypeHandle
Return type

TypeHandle