pyvista_cad.CadDataSetAccessor.tessellate#
- CadDataSetAccessor.tessellate(*, linear_deflection=None, angular_deflection=0.5)[source]#
Re-tessellate this mesh from its cached originating B-rep.
Reuses the exact
TopoDS_Shapestashed when this mesh was produced by a CAD reader (STEP, BREP, IGES, build123d bridge) and re-meshes it at the requested deflections. This does not decimate or remesh the existing triangulation; it goes back to the analytic geometry. The chosen deflections are stamped into field data and surface astessellation_quality.A mesh with no cached B-rep origin cannot be re-tessellated and raises rather than silently returning the existing facets.
- Parameters:
- linear_deflectionfloat, optional
Maximum chordal deviation between a facet and the true surface, in dataset units. When
None, defaults to0.001of the bounding-box diagonal.- angular_deflectionfloat, default: 0.5
Maximum angle (radians) between adjacent facet normals.
- Returns:
- pyvista.PolyData
The freshly tessellated surface, carrying
cad.linear_deflection/cad.angular_deflection.
- Raises:
- pyvista_cad.CadError
If no cached originating
TopoDS_Shapeis associated with the mesh (it was not produced by a CAD reader).
- Parameters:
- Return type:
Examples
>>> import pyvista_cad >>> from pyvista_cad import examples >>> mesh = pyvista_cad.read_step(examples.step_cube) >>> retess = mesh.cad.tessellate(linear_deflection=0.02) >>> retess.n_cells > 0 True >>> retess.cad.tessellation_quality['linear_deflection'] 0.02