subdivision
¶
Module Contents¶
Classes¶
Face-varying interpolation rule |
|
Selection tag for interpolated attributes |
|
Subdivision scheme type |
|
Vertex boundary interpolation rule |
Functions¶
|
Evaluates the subdivision surface of a polygonal mesh. |
- class subdivision.FaceVaryingInterpolation(*args, **kwds)¶
Bases:
enum.Enum
Face-varying interpolation rule
- All = 5¶
- Boundaries = 4¶
- CornersOnly = 1¶
- CornersPlus1 = 2¶
- CornersPlus2 = 3¶
- Smooth = 0¶
- class subdivision.InterpolatedAttributesSelection(*args, **kwds)¶
Bases:
enum.Enum
Selection tag for interpolated attributes
- All = 0¶
- Empty = 1¶
- Selected = 2¶
- class subdivision.SchemeType(*args, **kwds)¶
Bases:
enum.Enum
Subdivision scheme type
- Bilinear = 0¶
- CatmullClark = 1¶
- Loop = 2¶
- class subdivision.VertexBoundaryInterpolation(*args, **kwds)¶
Bases:
enum.Enum
Vertex boundary interpolation rule
- EdgeAndCorner = 2¶
- EdgeOnly = 1¶
- NoInterpolation = 0¶
- subdivision.subdivide_mesh(mesh, num_levels, scheme=None, adaptive=False, max_edge_length=None, vertex_boundary_interpolation=VertexBoundaryInterpolation.EdgeOnly, face_varying_interpolation=FaceVaryingInterpolation.Smooth, use_limit_surface=False, interpolated_attributes_selection=InterpolatedAttributesSelection.All, interpolated_smooth_attributes=None, interpolated_linear_attributes=None, edge_sharpness_attr=None, vertex_sharpness_attr=None, face_hole_attr=None, output_limit_normals=None, output_limit_tangents=None, output_limit_bitangents=None)¶
Evaluates the subdivision surface of a polygonal mesh.
- Parameters:
mesh (lagrange.core.SurfaceMesh) – The source mesh.
num_levels (int) – The number of levels of subdivision to apply.
scheme (SchemeType | None) – The subdivision scheme to use.
adaptive (bool) – Whether to use adaptive subdivision.
max_edge_length (float | None) – The maximum edge length for adaptive subdivision.
vertex_boundary_interpolation (VertexBoundaryInterpolation) – Vertex boundary interpolation rule.
face_varying_interpolation (FaceVaryingInterpolation) – Face-varying interpolation rule.
use_limit_surface (bool) – Interpolate all data to the limit surface.
edge_sharpness_attr (int | None) – Per-edge scalar attribute denoting edge sharpness. Sharpness values must be in [0, 1] (0 means smooth, 1 means sharp).
vertex_sharpness_attr (int | None) – Per-vertex scalar attribute denoting vertex sharpness (e.g. for boundary corners). Sharpness values must be in [0, 1] (0 means smooth, 1 means sharp).
face_hole_attr (int | None) – Per-face integer attribute denoting face holes. A non-zero value means the facet is a hole. If a face is tagged as a hole, the limit surface will not be generated for that face.
output_limit_normals (str | None) – Output name for a newly computed per-vertex attribute containing the normals to the limit surface. Skipped if left empty.
output_limit_tangents (str | None) – Output name for a newly computed per-vertex attribute containing the tangents (first derivatives) to the limit surface. Skipped if left empty.
output_limit_bitangents (str | None) – Output name for a newly computed per-vertex attribute containing the bitangents (second derivative) to the limit surface. Skipped if left empty.
interpolated_attributes_selection (InterpolatedAttributesSelection)
interpolated_smooth_attributes (collections.abc.Sequence[int] | None)
interpolated_linear_attributes (collections.abc.Sequence[int] | None)
- Returns:
The subdivided mesh.
- Return type:
lagrange.core.SurfaceMesh