Open KeithSloan opened 4 years ago
@KeithSloan
When CQ 2.0 was in the earlier stages my plan was to update this workbench, and part of that was going to be using toPythonOCC
and fromPythonOCC
. However, as other options became available such as CQ-editor and jupyter-cadquery, and the community didn't seem to be asking for the things this workbench provides, it became harder to justify upgrading this. With that said, I still think good integration and interop with FreeCAD is a good thing.
It did not take a lot to update cadquery-gui for CQ 2.0 because CQGI works the same way. I expect that most of the work on this workbench would be done here. If you're interested in putting together a PR, it would be nice if the user could select between CQ versions (default to CQ 1.0) instead of being forced to upgrade to CQ 2.0. CQ 2.0 wouldn't be the "batteries included" experience that users of this workbench have come to expect. The settings dialog code is here where a CQ version setting could be added.
I had a look at "here" and the only thing I saw was
newFeature.Shape = cqObject.toFreecad()
So I assume that cg already does some conversion to FreeCAD Shape and I need to look at the cgObject implementation
toFreecad
is from CQ 1.0. There's no equivalent in CQ 2.0. I imagine that code would have to change to something like:
newFeature.Shape = Part.fromPythonOCC(cqObject.val().wrapped)
But that's just off the top of my head. I also may be missing other changes that will have to be made, but that's where I would start.
I was wondering about this thing for a few days before arriving to this thread. CQ-editor may be more than ideal as a primary editor but freecad is a much broader tool, so it makes total sense for CQ to have a shelter there as well.
@infosisio I spent some time looking into it, but the main problem I ran into was that FreeCAD would not use an Anaconda environment, so it's very hard to experiment with it. I don't have a lot of time to spend on this ATM, but am supportive of the community working on it. I would like to see CadQuery and FreeCAD integrated again.
@jmwright Got it!
The latest beta version of cadquery now supports being used without conda / with pip
pip install cadquery==2.2.0b0
How feasible is it to update this workbench to work with CQ 2.0 which uses PythonOCC? Clearly you cannot have python that is using PythonOCC outputing directly to a FreeCAD window. I know that Part has Part.toPythonOCC() and Part.fromPythonOCC() to exchange TopoDS_Shape entities to/from pythonOCC, would it be possible to put wrappers round things? I know the answer should be to look at the code, but would like somebody who is already familiar with the code to comment on feasibility of doing this before investigating further.