All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzc_reparametrization.h File Reference

Implements curve reparametrization by curve length. More...

Functions

kzsError kzcReparametrizationCreateLinear (const struct KzcMemoryManager *memoryManager, kzFloat curveLength, struct KzcReparametrization **out_reparametrization)
 Creates a linear curve length reparametrization by curve length. More...
 
kzsError kzcReparametrizationCreateFromSpline (const struct KzcMemoryManager *memoryManager, const struct KzcSpline *spline, kzUint minimumSamples, kzUint maximumSubdivisions, kzFloat relativeErrorMagnitude, struct KzcReparametrization **out_reparametrization)
 Creates a curve length reparametrization for a spline by sampling. More...
 
kzsError kzcReparametrizationDelete (struct KzcReparametrization *reparametrization)
 Deletes a reparametrization. More...
 
kzFloat kzcReparametrizationGetPhaseParameter (const struct KzcReparametrization *reparametrization, kzFloat lengthParameter)
 Returns the phase that matches the given curve length in [0, length]. More...
 
kzFloat kzcReparametrizationGetLengthParameter (const struct KzcReparametrization *reparametrization, kzFloat phaseParamter)
 Returns the curve length that matches the given phase in [0, 1]. More...
 
kzFloat kzcReparametrizationGetCurveLength (const struct KzcReparametrization *reparametrization)
 Returns the curve length of the curve. More...
 
kzUint kzcReparametrizationGetSampleCount (const struct KzcReparametrization *reparametrization)
 Returns number of sample points the reparametrization uses. More...
 
kzFloat kzcReparametrizationGetLengthSampleByIndex (const struct KzcReparametrization *reparametrization, kzUint index)
 Returns length parameter by index. More...
 

Detailed Description

Implements curve reparametrization by curve length.

Copyright 2008-2020 by Rightware. All rights reserved.

Function Documentation

kzsError kzcReparametrizationCreateLinear ( const struct KzcMemoryManager memoryManager,
kzFloat  curveLength,
struct KzcReparametrization **  out_reparametrization 
)

Creates a linear curve length reparametrization by curve length.

kzsError kzcReparametrizationCreateFromSpline ( const struct KzcMemoryManager memoryManager,
const struct KzcSpline spline,
kzUint  minimumSamples,
kzUint  maximumSubdivisions,
kzFloat  relativeErrorMagnitude,
struct KzcReparametrization **  out_reparametrization 
)

Creates a curve length reparametrization for a spline by sampling.

First splits the curve into secant lines by sampling at 'minimumSamples' points. After that subdivides the secants as long as the relative error estimate is over 'relativeErrorMagnitude' and 'maximumSubdivisions' depth is not reached.

kzsError kzcReparametrizationDelete ( struct KzcReparametrization reparametrization)

Deletes a reparametrization.

kzFloat kzcReparametrizationGetPhaseParameter ( const struct KzcReparametrization reparametrization,
kzFloat  lengthParameter 
)

Returns the phase that matches the given curve length in [0, length].

kzFloat kzcReparametrizationGetLengthParameter ( const struct KzcReparametrization reparametrization,
kzFloat  phaseParamter 
)

Returns the curve length that matches the given phase in [0, 1].

kzFloat kzcReparametrizationGetCurveLength ( const struct KzcReparametrization reparametrization)

Returns the curve length of the curve.

kzUint kzcReparametrizationGetSampleCount ( const struct KzcReparametrization reparametrization)

Returns number of sample points the reparametrization uses.

Can in some cases be used as an approximation for complexity of the curve.

kzFloat kzcReparametrizationGetLengthSampleByIndex ( const struct KzcReparametrization reparametrization,
kzUint  index 
)

Returns length parameter by index.