DeepSDFStruct.export_knot_grid#

Functions

export_control_lattice_paramspace(spline[, ...])

Export control-lattice Greville abscissae (parametric space) as a .vtp point cloud with id/i/j/k metadata.

export_control_lattice_physical(...[, ...])

Export a deformed control lattice in physical space: points plus lines connecting (i,j,k) neighbors along each grid axis.

export_control_points(control_points, file_path)

Export control points as a VTP point cloud.

export_control_volume_physical(...[, ...])

Export a deformed control lattice as a StructuredGrid (.vts) — a solid hexahedral volume.

export_design_volume_paramspace(spline[, ...])

Export the parametric design volume as a pyvista StructuredGrid (.vts).

export_knot_grid_paramspace(spline[, filename])

Export the tensor-product knot grid of a splinepy BSpline as a line network (PolyData) for ParaView.

DeepSDFStruct.export_knot_grid.export_control_lattice_paramspace(spline, filename='control_lattice_paramspace.vtp', locked_idx=None, order='F')#

Export control-lattice Greville abscissae (parametric space) as a .vtp point cloud with id/i/j/k metadata. If locked_idx is given, adds a locked int32 point array (0 = free, 1 = locked) so ParaView can color free vs. locked control points.

Parameters:
  • spline (splinepy.BSpline)

  • filename (str) – Output file path (.vtp).

  • locked_idx (array-like or torch.Tensor, optional) – Indices of locked control points. If None or empty, the locked array is omitted.

  • order (str) – Flattening order for control point indices (‘F’ or ‘C’).

DeepSDFStruct.export_knot_grid.export_control_lattice_physical(control_points, n_per_dim, filename, order='F', boundary_only=False)#

Export a deformed control lattice in physical space: points plus lines connecting (i,j,k) neighbors along each grid axis.

Parameters:
  • control_points (torch.Tensor or np.ndarray) – Shape (N, 3) where N == prod(n_per_dim).

  • n_per_dim (sequence of 3 ints) – (n0, n1, n2) grid shape of the control lattice.

  • filename (str or Path) – Output .vtp file path.

  • order (str) – Flattening order for control point indices (‘F’ or ‘C’).

  • boundary_only (bool) – If True, keep only the points and edges on the six outer faces of the lattice (the “boundary cage”). Point indices are remapped so id still refers to the original full-lattice index.

DeepSDFStruct.export_knot_grid.export_control_points(control_points, file_path)#

Export control points as a VTP point cloud.

Parameters:
  • control_points (torch.Tensor or np.ndarray) – Shape (N, 3)

  • file_path (str or Path) – Output .vtp file path

DeepSDFStruct.export_knot_grid.export_control_volume_physical(control_points, n_per_dim, filename, undeformed=None, order='F')#

Export a deformed control lattice as a StructuredGrid (.vts) — a solid hexahedral volume. In ParaView, render directly (adjust opacity) or apply Extract Surface to see only the six boundary faces. Color by any point array; displacement_mag is a natural choice.

Parameters:
  • control_points (torch.Tensor or np.ndarray) – Shape (N, 3) where N == prod(n_per_dim). Ordering must be F-order (i varies fastest), matching VTK’s StructuredGrid convention.

  • n_per_dim (sequence of 3 ints) – (n0, n1, n2) grid shape of the control lattice.

  • filename (str or Path) – Output .vts file path.

  • undeformed (torch.Tensor or np.ndarray, optional) – Same shape as control_points. If provided, adds displacement (vector) and displacement_mag (scalar) point arrays.

  • order (str) – Flattening order (‘F’ required — VTK StructuredGrid uses F-order).

DeepSDFStruct.export_knot_grid.export_design_volume_paramspace(spline, filename='design_volume_paramspace.vts')#

Export the parametric design volume as a pyvista StructuredGrid (.vts). Points are placed at every unique knot intersection, so the volume shows the knot subdivision structure. Natural companion to export_knot_grid_paramspace (wireframe) and export_control_lattice_paramspace (Greville points) when you want a solid, colorable volume in ParaView.

Parameters:
  • spline (splinepy.BSpline)

  • filename (str or Path) – Output .vts file path.

DeepSDFStruct.export_knot_grid.export_knot_grid_paramspace(spline, filename='knot_grid_paramspace.vtp')#

Export the tensor-product knot grid of a splinepy BSpline as a line network (PolyData) for ParaView.

Parameters:
  • spline (splinepy.BSpline) – The spline whose knot grid should be exported.

  • filename (str) – Output file path (.vtp).