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.

equiv(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.

pack_params(p)

Convert a dictionary of parameters into a single array.

rotate([axis, angle])

Rotate the curve by a fixed angle about axis in X, Y, Z 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.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

N

Number of knots in the spline.

X

Coordinates for X.

Y

Coordinates for Y.

Z

Coordinates for Z.

dim_x

total number of optimizable parameters.

dimensions

dictionary of integers of sizes of each optimizable parameter.

knots

Knots for spline.

method

Method of interpolation to use.

name

Name of the curve.

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

dictionary of arrays of optimizable parameters.

rotmat

Rotation matrix of curve in X, Y, Z.

shift

Displacement of curve in X, Y, Z.

x_idx

arrays of indices for each parameter in concatenated array.