Evaluators

Evaluators (or geometric evaluation strategies) allow users to change shape evaluation strategy, i.e. the algorithms that are used to evaluate curves, surfaces and volumes, take derivatives, knot and degree change operations and more. Therefore, the user can switch between the evaluation algorithms at runtime, implement and use different algorithms or extend existing ones.

Inheritance Diagram

Inheritance diagram of geomdl.evaluators

Abstract Base

class geomdl.evaluators.AbstractEvaluator(**kwargs)

Bases: object

Abstract base class for implementations of fundamental spline algorithms, such as evaluate and derivative.

Abstract Methods:

  • evaluate is used for computation of the complete spline shape
  • evaluate_single is used for computation of one single point on the spline shape
  • derivative_single is used for computation of derivatives at a single parametric coordinate

Please note that this class requires the keyword argument find_span_func to be set to a valid find_span function implementation. Please see helpers module for details.

derivatives_single(**kwargs)

Abstract method for computation of derivatives at a single parameter.

Note

This is an abstract method and it must be implemented in the subclass.

evaluate(**kwargs)

Abstract method for computation of points over a range of parameters.

Note

This is an abstract method and it must be implemented in the subclass.

evaluate_single(**kwargs)

Abstract method for computation of a single point at a single parameter.

Note

This is an abstract method and it must be implemented in the subclass.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.AbstractEvaluatorExtended(**kwargs)

Bases: geomdl.evaluators.AbstractEvaluator

Abstract base class for implementations of extended spline algorithms.

Abstract Methods:

  • evaluate is used for computation of the complete spline shape
  • evaluate_single is used for computation of one single point on the spline shape
  • derivative_single is used for computation of derivatives at a single parametric coordinate
  • insert_knot is used for implementation of knot insertion algorithm

Please note that this class requires the keyword argument find_span_func to be set to a valid find_span function implementation. Please see helpers module for details.

derivatives_single(**kwargs)

Abstract method for computation of derivatives at a single parameter.

Note

This is an abstract method and it must be implemented in the subclass.

evaluate(**kwargs)

Abstract method for computation of points over a range of parameters.

Note

This is an abstract method and it must be implemented in the subclass.

evaluate_single(**kwargs)

Abstract method for computation of a single point at a single parameter.

Note

This is an abstract method and it must be implemented in the subclass.

insert_knot(**kwargs)

Abstract method for implementation of knot insertion algorithm.

Note

This is an abstract method and it must be implemented in the subclass.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str

Curve Evaluators

class geomdl.evaluators.CurveEvaluator(**kwargs)

Bases: geomdl.evaluators.AbstractEvaluatorExtended

Sequential curve evaluation algorithms.

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A3.1: CurvePoint
  • Algorithm A3.2: CurveDerivsAlg1
  • Algorithm A5.1: CurveKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the curve.

evaluate_single(**kwargs)

Evaluates a single curve point.

insert_knot(**kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.CurveEvaluator2(**kwargs)

Bases: geomdl.evaluators.CurveEvaluator

Sequential curve evaluation algorithms (alternative).

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A3.1: CurvePoint
  • Algorithm A3.4: CurveDerivsAlg2
  • Algorithm A5.1: CurveKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

static derivatives_ctrlpts(**kwargs)

Computes the control points of all derivative curves up to and including the {degree}-th derivative.

Implementation of Algorithm A3.3 from The NURBS Book by Piegl & Tiller.

Output is PK[k][i], i-th control point of the k-th derivative curve where 0 <= k <= degree and r1 <= i <= r2-k.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the curve.

evaluate_single(**kwargs)

Evaluates a single curve point.

insert_knot(**kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.CurveEvaluatorRational(**kwargs)

Bases: geomdl.evaluators.CurveEvaluator

Sequential rational curve evaluation algorithms.

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A3.1: CurvePoint
  • Algorithm A4.2: RatCurveDerivs
  • Algorithm A5.1: CurveKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the rational curve.

evaluate_single(**kwargs)

Evaluates a single curve point.

insert_knot(**kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str

Surface Evaluators

class geomdl.evaluators.SurfaceEvaluator(**kwargs)

Bases: geomdl.evaluators.AbstractEvaluatorExtended

Sequential surface evaluation algorithms.

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A3.5: SurfacePoint
  • Algorithm A3.6: SurfaceDerivsAlg1
  • Algorithm A5.3: SurfaceKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the surface.

evaluate_single(**kwargs)

Evaluates a single surface point.

insert_knot(direction, **kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.SurfaceEvaluator2(**kwargs)

Bases: geomdl.evaluators.SurfaceEvaluator

Sequential surface evaluation algorithms.

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A3.5: SurfacePoint
  • Algorithm A3.7: SurfaceDerivCpts
  • Algorithm A3.8: SurfaceDerivsAlg2
  • Algorithm A5.3: SurfaceKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

static derivatives_ctrlpts(**kwargs)

Computes the control points of all derivative surfaces up to and including the {degree}-th derivative.

Output is PKL[k][l][i][j], i,j-th control point of the surface differentiated k times w.r.t to u and l times w.r.t v.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the surface.

evaluate_single(**kwargs)

Evaluates a single surface point.

insert_knot(direction, **kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.SurfaceEvaluatorRational(**kwargs)

Bases: geomdl.evaluators.SurfaceEvaluator

Sequential rational surface evaluation algorithms.

This evaluator implements the following algorithms from The NURBS Book:

  • Algorithm A4.3: SurfacePoint
  • Algorithm A4.4: RatSurfaceDerivs
  • Algorithm A5.3: SurfaceKnotIns

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the rational surface.

evaluate_single(**kwargs)

Evaluates a single surface point.

insert_knot(direction, **kwargs)

Inserts a knot multiple times.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str

Volume Evaluators

class geomdl.evaluators.VolumeEvaluator(**kwargs)

Bases: geomdl.evaluators.AbstractEvaluator

Sequential volume evaluation algorithms.

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivative at the given parametric coordinate.

evaluate(**kwargs)

Evaluates the volume.

evaluate_single(**kwargs)

Evaluates a single point.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str
class geomdl.evaluators.VolumeEvaluatorRational(**kwargs)

Bases: geomdl.evaluators.VolumeEvaluator

Sequential rational volume evaluation algorithms.

Please note that knot vector span finding function may be changed by setting find_span_func keyword argument during the initialization. By default, this function is set to helpers.find_span_linear(). Please see Helpers Module Documentation for more details.

derivatives_single(**kwargs)

Evaluates the derivatives at the input parameter.

evaluate(**kwargs)

Evaluates the rational volume.

evaluate_single(**kwargs)

Evaluates a single point.

name

Evaluator name.

Getter:Gets the name of the evaluator
Type:str