cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

ifcopenshell to caquery (or PythonOCC to OCP)

Open SubChange opened this issue 1 year ago • 2 comments

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?

SubChange avatar Jan 28 '24 12:01 SubChange

Potentially related issues here.

jmwright avatar Jan 28 '24 13:01 jmwright

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

adam-urbanczyk avatar Jan 28 '24 16:01 adam-urbanczyk