MCPcopy
hub / github.com/CadQuery/cadquery / importBrep

Method importBrep

cadquery/occ_impl/shapes.py:571–583  ·  view source on GitHub ↗

Import shape from a BREP file

(cls, f: str | BytesIO)

Source from the content-addressed store, hash-verified

569
570 @classmethod
571 def importBrep(cls, f: str | BytesIO) -> Shape:
572 """
573 Import shape from a BREP file
574 """
575 s = TopoDS_Shape()
576 builder = BRep_Builder()
577
578 BRepTools.Read_s(s, f, builder)
579
580 if s.IsNull():
581 raise ValueError(f"Could not import {f}")
582
583 return cls.cast(s)
584
585 def exportBin(self, f: str | BytesIO) -> bool:
586 """

Callers 4

importBrepFunction · 0.80
testBrepImportExportMethod · 0.80
test_exportMethod · 0.80
test_exportFunction · 0.80

Calls 1

castMethod · 0.80

Tested by 3

testBrepImportExportMethod · 0.64
test_exportMethod · 0.64
test_exportFunction · 0.64