CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
2.93k stars 276 forks source link

ifcopenshell to caquery (or PythonOCC to OCP) #1512

Open SubChange opened 5 months ago

SubChange commented 5 months ago

ifcopenshell is a powerful tool to parse ifc files. In the ifcopenshel.geom part, I saw that one can convert ifc file to OpenCASCADE BRep by

settings = ifcopenshell.geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)

However, above implementation is based on pythonocc-core, another python wrapper of OpenCASCADE. I want to know if there are any methods to convert ifc file to cadquery objects?

jmwright commented 5 months ago

Potentially related issues here.

adam-urbanczyk commented 5 months ago

So the actual question is: how do I convert from PythonOCC to OCP. There are two options:

  1. Serialize to brep and then deserialize (see #518)
  2. If PythonOCC can provide the TopoDS_Shape address you can use OCP.TopoDS.TopoDS_Shape._from_address