CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
757 stars 116 forks source link

How to show pythonocc objects in CQ-editor #377

Closed SubChange closed 1 year ago

SubChange commented 1 year ago

I have a IFC file, then utilizing ifcopenshell, I obtain OCC objects, such as TopoDS_Solid using following codes:

from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox, BRepPrimAPI_MakeCylinder
shape = BRepPrimAPI_MakeCylinder(60, 60, 50).Shape()

Since Cadquery is based on OCP which is a python wrapper of OpenCascade like pythonpcc, Are there any solutions to convert objects of pythonpcc to OCP, then dispay them is CQ-editor? Thanks for your suggestions.

adam-urbanczyk commented 1 year ago

I don't think there is anything specific implemented to achieve PythonOCC-OCP interop. Maybe serialize in-memory to brep and then de-serialize.