.NET API
MeshApi
Mesh utilities from the Commands/Meshes family.
from ArtisanPlugin.Scripting import MeshApi
See also the guide, Manufacturing › Decimator, and the Python package, ra.mesh.
Methods
| Method | |
|---|---|
Decimate | Decimates meshes with Rhino’s quadric edge-collapse reduction (the ArtisanMeshDecimate command, headless). |
DecimateToTolerance | Decimates meshes as much as a deviation budget allows (the ArtisanMeshDecimateTolerance command, headless). |
Decimate
DecimateResult MeshApi.Decimate(IEnumerable<Guid> objectIds = null, double percentage = 50)
Decimates meshes with Rhino’s quadric edge-collapse reduction (the ArtisanMeshDecimate command, headless). Distortion is allowed: the reducer prioritizes hitting the target face count over shape fidelity, so heavy percentages give a faceted low-poly look. objectIds meshes to decimate; null/empty = current selection. percentage faces to REMOVE, 1-99 (default 50). Each mesh is replaced in place (same Guid). Returns totals so the script can report “N meshes: X faces -> Y faces”.
| Parameter | Type | Default |
|---|---|---|
objectIds | IEnumerable<Guid> | null |
percentage | double | 50 |
Returns DecimateResult.
DecimateToTolerance
DecimateToleranceResult MeshApi.DecimateToTolerance(
IEnumerable<Guid> objectIds = null,
double toleranceMm = 0)
Decimates meshes as much as a deviation budget allows (the ArtisanMeshDecimateTolerance command, headless). Each mesh is reduced to the heaviest percentage whose result still stays within toleranceMm of the original surface, so the shape is guaranteed and the face count is whatever falls out. objectIds meshes to decimate; null/empty = current selection. toleranceMm max deviation in MILLIMETRES, 0 = default (0.05). Each mesh is replaced in place (same Guid). Meshes that cannot lose a single percent within tolerance are left untouched and counted in MeshesUnchanged.
| Parameter | Type | Default |
|---|---|---|
objectIds | IEnumerable<Guid> | null |
toleranceMm | double | 0 |
Returns DecimateToleranceResult.