Function Reference: solid.read

drafting: S = solid.read (FILE)

Read a solid from a STEP file.

S = solid.read (FILE) returns the shapes held by the STEP file FILE as one solid.Shape, in millimetres whatever unit the file was written in. A file holding several parts returns them together, and solid.Shape.numsolids counts them. The colour the file gives a solid, or failing that the first of its faces with one, is its row of solid.Shape.Colour.

STEP (ISO 10303-21) is the format every mechanical CAD program exchanges solids in, and it keeps their exact geometry: a hole read from it is a true cylinder, as it was modelled. A STEP file must end in .step, in either case, and open with the keyword ISO-10303-21;, which may follow white space and comments.

model.read reads the same file as a model.Assembly, its parts named and placed as the file has them. A triangle mesh, from an STL, OBJ or PLY file, is read by polymesh.read and made a solid by solid.polyhedron.

See also: solid.Shape.write, solid.Shape, model.read, polymesh.read

Source Code: solid.read