desc.geometry.SplineXYZCurve

class desc.geometry.SplineXYZCurve(X, Y, Z, knots=None, method='cubic', name='')Source

Curve parameterized by spline knots in X,Y,Z.

Parameters:
  • X (array-like) – Points for X, Y, Z describing the curve. If the endpoint is included (ie, X[0] == X[-1]), then the final point will be dropped.

  • Y (array-like) – Points for X, Y, Z describing the curve. If the endpoint is included (ie, X[0] == X[-1]), then the final point will be dropped.

  • Z (array-like) – Points for X, Y, Z describing the curve. If the endpoint is included (ie, X[0] == X[-1]), then the final point will be dropped.

  • knots (ndarray or "arclength") – arbitrary curve parameter values to use for spline knots, should be a monotonic, 1D ndarray of same length as the input X,Y,Z. If None, defaults to using an linearly spaced points in [0, 2pi) as the knots. If supplied, should lie in [0,2pi]. Alternatively, the string “arclength” can be supplied to use the normalized distance between points.

  • method (str) –

    method of interpolation

    • 'nearest': nearest neighbor interpolation

    • 'linear': linear interpolation

    • 'cubic': C1 cubic splines (aka local splines)

    • 'cubic2': C2 cubic splines (aka natural splines)

    • 'catmull-rom': C1 cubic centripetal “tension” splines

    • 'cardinal': C1 cubic general tension splines. If used, default tension of c = 0 will be used

    • 'monotonic': C1 cubic splines that attempt to preserve monotonicity in the data, and will not introduce new extrema in the interpolated points

    • 'monotonic-0': same as ‘monotonic’ but with 0 first derivatives at both endpoints

  • name (str) – name for this curve

Methods

compute(names[, grid, params, transforms, ...])

Compute the quantity given by name on grid.

copy([deepcopy])

Return a (deep)copy of this object.

eq(other)

Compare equivalence between DESC objects.

flip(normal)

Flip the curve about the plane with specified normal.

from_values(coords[, knots, method, name, basis])

Create SplineXYZCurve from coordinate values.

load(load_from[, file_format])

Initialize from file.

rotate([axis, angle])

Rotate the curve by a fixed angle about axis in xyz coordinates.

save(file_name[, file_format, file_mode])

Save the object.

to_FourierXYZ([N, grid, s, name])

Convert Curve to FourierXYZCurve representation.

to_SplineXYZ([knots, grid, method, name])

Convert Curve to SplineXYZCurve.

translate([displacement])

Translate the curve by a rigid displacement in x, y, z.

Attributes

N

Number of knots in the spline.

X

Coordinates for X.

Y

Coordinates for Y.

Z

Coordinates for Z.

knots

Knots for spline.

method

Method of interpolation to use.

name

Name of the curve.