mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 02:41:17 +00:00
CAD mass properties: volume / area / centre of mass / inertia
Port of snaporca c2821af783. New GeometryEngine::mass_properties over BRepGProp (separate VolumeProperties/SurfaceProperties), bounds-checked CadDocument::body_mass_properties, and a mass_properties MCP method. Query-only: no CadFeature, no serialization, no version change. Analytic tests (WithinRel/WithinAbs): cube 8000/2400/COM(0,0,10)/inertia 533333, cylinder 500pi/300pi, hollow = solid-500pi, invalid index -> valid=false. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8edc12c8f1
commit
b807be3c4a
@@ -1852,4 +1852,10 @@ bool CadDocument::export_step(const std::string& path,
|
||||
return true;
|
||||
}
|
||||
|
||||
GeometryEngine::MassProps CadDocument::body_mass_properties(int body_index) const
|
||||
{
|
||||
if (body_index < 0 || body_index >= int(bodies.size())) return {};
|
||||
return GeometryEngine::mass_properties(bodies[body_index].shape);
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
Reference in New Issue
Block a user