artist.nurbs.utils
Functions
|
Create a grid of evaluation points for a NURBS surface. |
|
Create planar NURBS control points for each facet. |
Module Contents
- artist.nurbs.utils.create_nurbs_evaluation_grid(number_of_evaluation_points: torch.Tensor, epsilon: float = 1e-07, device: torch.device | None = None) torch.Tensor
Create a grid of evaluation points for a NURBS surface.
Parameters
- number_of_evaluation_pointstorch.Tensor
The number of nurbs evaluation points in east and north direction. Shape is
[2].- epsilonfloat
Offset for the NURBS evaluation points (default is 1e-7). NURBS are defined in the interval of [0, 1] but have numerical instabilities at their endpoints. Therefore, the evaluation points need a small offset from the endpoints.
- devicetorch.device | None
The device on which to perform computations or load tensors and models (default is None). If None,
ARTISTwill automatically select the most appropriate device (CUDA or CPU) based on availability and OS.
Returns
- torch.Tensor
The evaluation points. Shape is
[number_of_evaluation_points_e * number_of_evaluation_points_n, 2].
- artist.nurbs.utils.create_planar_nurbs_control_points(number_of_control_points: torch.Tensor, canting: torch.Tensor, device: torch.device | None = None) torch.Tensor
Create planar NURBS control points for each facet.
The generated control points form a flat, equidistant grid. The grid extent is derived from the norm of the canting vectors, which encode the dimensions of the facets.
Parameters
- number_of_control_pointstorch.Tensor
The number of NURBS control points. Shape is
[2].- cantingtorch.Tensor
The canting vector for each facet. Shape is
[number_of_facets, 2, 4].- devicetorch.device | None
The device on which to perform computations or load tensors and models (default is None). If None,
ARTISTwill automatically select the most appropriate device (CUDA or CPU) based on availability and OS.
Returns
- torch.Tensor
Planar control point grids for each facet. Shape is
[number_of_facets, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].