DeepSDFStruct.torch_spline#

Functions

bspline_basis(t, p, queries)

generate_bbox_spline(bounds)

Takes bounding box and generates a spline box.

torch_spline_1D(knot_vectors, ...)

torch_spline_3D(knot_vectors, ...)

Evaluate a 3D B-spline volume at query points.

Classes

TorchSpline(spline[, device, dtype])

V2: uses custom torch spline as spline backend

class DeepSDFStruct.torch_spline.TorchSpline(spline, device='cpu', dtype=torch.float32)#

Bases: torch.nn.modules.module.Module

V2: uses custom torch spline as spline backend

Parameters:

spline (splinepy.bspline.BSpline)

forward(queries)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:

queries (torch.Tensor)

spline: BSpline#
DeepSDFStruct.torch_spline.bspline_basis(t, p, queries)#
Parameters:

queries (torch._VariableFunctionsClass.tensor)

DeepSDFStruct.torch_spline.generate_bbox_spline(bounds)#

Takes bounding box and generates a spline box.

Parameters:

bounds ((2, 3) array-like) –

[[xmin, ymin, zmin],

[xmax, ymax, zmax]]

Returns:

spline – BSpline representing the bounding box.

Return type:

splinepy.BSpline

DeepSDFStruct.torch_spline.torch_spline_1D(knot_vectors, control_points, degrees, queries)#
Parameters:

queries (torch._VariableFunctionsClass.tensor)

DeepSDFStruct.torch_spline.torch_spline_3D(knot_vectors, control_points, degrees, queries)#

Evaluate a 3D B-spline volume at query points.

Parameters:
  • tx – knot vectors for x, y, z

  • ty – knot vectors for x, y, z

  • tz – knot vectors for x, y, z

  • px – degrees

  • py – degrees

  • pz – degrees

  • cp – control points, shape (nx, ny, nz, d)

  • qx – query coordinates, shape (N,)

  • qy – query coordinates, shape (N,)

  • qz – query coordinates, shape (N,)

Returns:

evaluated spline, shape (N, d)

Return type:

y