feat: render cached Part shapes in viewport

This commit is contained in:
2026-08-02 19:27:37 -04:00
parent 42e59ac068
commit 1bbee75761

View File

@@ -407,7 +407,7 @@ function Viewport({ selectedObject, setSelectedObject, workbench, facade, docume
const capabilities = await facade.geometry.initialize() const capabilities = await facade.geometry.initialize()
if (capabilities.status !== 'ready') throw new Error(capabilities.reason || 'OCCT geometry runtime unavailable') if (capabilities.status !== 'ready') throw new Error(capabilities.reason || 'OCCT geometry runtime unavailable')
const document = facade.app.document.getActive() const document = facade.app.document.getActive()
const featureIds = [selectedObject, 'fillet', 'pocket', 'pad'].filter(Boolean) const featureIds = [selectedObject, 'fillet', 'chamfer', 'revolution', 'intersection', 'cut', 'union', 'pocket', 'pad', 'box', 'cylinder', 'sphere', 'cone'].filter(Boolean)
const storedShape = featureIds.map((objectId) => facade.geometry.getObjectShape(objectId)).find((shape): shape is ShapeHandle => Boolean(shape)) const storedShape = featureIds.map((objectId) => facade.geometry.getObjectShape(objectId)).find((shape): shape is ShapeHandle => Boolean(shape))
if (storedShape) { if (storedShape) {
const mesh = await facade.geometry.mesh(storedShape, 0.05) const mesh = await facade.geometry.mesh(storedShape, 0.05)