Skip to content

.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
DecimateDecimates meshes with Rhino’s quadric edge-collapse reduction (the ArtisanMeshDecimate command, headless).
DecimateToToleranceDecimates 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”.

ParameterTypeDefault
objectIdsIEnumerable<Guid>null
percentagedouble50

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.

ParameterTypeDefault
objectIdsIEnumerable<Guid>null
toleranceMmdouble0

Returns DecimateToleranceResult.