main
John Lauer
Review off-board sensor and mechanical libraries with truthful conversion and supplier limits
4c1d6f7
"""Load every shape returned by a STEP import, including separated assembly roots."""
from pathlib import Path
import cadquery as cq
def load_step(path):
objects=cq.importers.importStep(str(Path(path))).vals()
if not objects or not all(isinstance(obj,cq.Shape) for obj in objects):
raise ValueError(f'No complete shape set in STEP: {path}')
# .val() selects just the first root; assembly files can have several.
return objects[0] if len(objects)==1 else cq.Compound.makeCompound(objects)