sympathor.path

class sympathor.path.SymbolicPath(path)[source]

Bases: sympathor.elements.SymbolicMixin, svg.path.path.Path

A symbolic path description extending svg.path.Path.

This class mates various symbolic elements by building a composite path description. Based on this composite path, properties and quantities of differential geometry can be derived, e.g. tangent and normal vectors, or the curvature. This class also implements a convenient path-level access to SVG transforms, which are simply delegated to each element.

Parameters

path (svg.path.Path) – An svg.path.Path object, e.g. parsed using svg.path.parse_path(), as done in sympathor.ParsePaths().

curvature(s=None)[source]

Obtain curvature along the path.

Parameters

s (float or list of float, optional) – The parameter value(s) at which the curvature should be evaluated.

Returns

point – Function of symbolic description of curvature if no parameter value was provided; otherwise an array of curvature values corresponding to the given parameter values.

Return type

casadi.Function or numpy.ndarray

length()[source]

Compute overall length of path.

Returns

length – Length of path

Return type

numpy.float

matrix(a, b, c, d, e, f)[source]
normal(s=None)[source]

Obtain normal vector along the path.

Parameters

s (float or list of float, optional) – The parameter value(s) at which the normal vector should be evaluated.

Returns

point – Function of symbolic description of normal vector if no parameter value was provided; otherwise an array of components of the normal vector corresponding to the given parameter values.

Return type

casadi.Function or numpy.ndarray

point(s=None)[source]

Obtain point along the path.

Parameters

s (float or list of float, optional) – The parameter value(s) at which the path should be sampled.

Returns

point – Function of symbolic description of point if no parameter value was provided; otherwise an array of point coordinates corresponding to the given parameter values.

Return type

casadi.Function or numpy.ndarray

rotate(theta, x=0, y=0)[source]
scale(x, y=None)[source]
set_natural_parametrization(new_state=True)[source]

Toggle natural parametrization of path.

Parameters

on (bool) – Activate natural parametrization

skewX(theta)[source]
skewY(theta)[source]
tangent(s=None)[source]

Obtain tangent vector along the path.

Parameters

s (float or list of float, optional) – The parameter value(s) at which the tangent vector should be evaluated.

Returns

point – Function of symbolic description of tangent vector if no parameter value was provided; otherwise an array of components of the tangent vector corresponding to the given parameter values.

Return type

casadi.Function or numpy.ndarray

translate(dx, dy=0)[source]