FreeCAD .FCStd and Rhino .3dm files open, insert and drop like STEP and IGES: cadmpeg (Apache-2.0, pinned =0.6.1, native builds only) detects the format, decodes it under its service resource caps, validates the model and writes it as STEP AP214, which becomes an Import feature in a new component named after the file, with the up and names options. Only the fcstd, rhino and step codecs are compiled in (no default features). ACIS is left out: cadmpeg's sat codec is a ShapeManager stream decoder. native_cad.rs is the single importer seam. Self-made FreeCAD and Rhino box fixtures, hostile-input, ZIP-bomb and cap tests, engine tests for the component path; the browser build reports these formats as not supported. A note under design format 23 says an Import's file can name these formats. Co-authored-by: Jacob Oursland <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
12 lines
536 B
Python
12 lines
536 B
Python
# Writes block.3dm: a 10 x 20 x 30 mm box called "Block", as a Rhino 7 file, with McNeel's MIT
|
|
# licensed rhino3dm package. Run from this directory: `uv run --with rhino3dm python make_block_3dm.py`.
|
|
import rhino3dm
|
|
|
|
model = rhino3dm.File3dm()
|
|
model.Settings.ModelUnitSystem = rhino3dm.UnitSystem.Millimeters
|
|
brep = rhino3dm.Brep.CreateFromBox(rhino3dm.Box(rhino3dm.BoundingBox(0, 0, 0, 10, 20, 30)))
|
|
attributes = rhino3dm.ObjectAttributes()
|
|
attributes.Name = "Block"
|
|
model.Objects.AddBrep(brep, attributes)
|
|
model.Write("block.3dm", 7)
|