troubles while evaluating cadquery and cqparts

298 views
Skip to first unread message

Zbyněk Winkler

unread,
May 14, 2018, 6:14:06 AM5/14/18
to cadq...@googlegroups.com
Hi!

I am trying to evaluate cadquery and I am having troubles.

First I tried the jupyter documents but currently, it does not work. See issue https://github.com/RustyVermeer/tryCQ/issues/1

Then I switched to a portable binary of Freecad on Windows. I have the cadquery workbench installed. I run into problems when trying to use cqparts. See issue https://github.com/jmwright/cadquery-freecad-module/issues/120 and https://forum.freecadweb.org/viewtopic.php?f=4&t=28731

Is there anything for me to in the meantime? I mean short of compiling Freecad with msvc2008 myself.

Thanks.
Zbyněk

Jeremy Wright

unread,
May 14, 2018, 10:18:07 AM5/14/18
to CadQuery
Hi Zbyněk.

cqparts is a relatively new addition to the CadQuery ecosystem, and support for it was just added to the CadQuery module for FreeCAD about a week ago. You're on the bleeding edge of the technology.

As for the tryCQ issue, I've let the developer know there's an issue open there. There's the option of running a Jupyter Notebook through binder.org, but that won't include cqparts. https://mybinder.org/v2/gh/RustyVermeer/tryCQ/master

I'll work on fixing cqparts support in FreeCAD on Windows, but in the meantime @fragmuffin will probably be your best bet for help if you're focused on using cqparts. He'll probably see this thread, but just in case he doesn't: https://github.com/fragmuffin/cqparts/issues

Zbyněk Winkler

unread,
May 14, 2018, 10:59:49 AM5/14/18
to Jeremy Wright, CadQuery
Thanks! As for the Jupyter + cqparts, I was working under the assumption that I could pip-install cqparts inside once it it working using

!pip install wheel
!pip install cqparts

This seems to successfully install cqparts, however trying `import cqparts` fails to find the package :-(.

It might be somewhat difficult to bring cqparts to windows with freecad since freecad is compiled with msvc2013 while binary packages for python2.7 are usually built by msvc2008. So to bring cqparts to freecad on windows, custom compile of at least numpy would be needed. I am trying to compile freecad with msvc2008, but that seems to be failing with lots of fatal errors.

I guess moving to linux seems to be like the only feasible option in the short run (?).


--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/761bf355-8d83-4fbf-aae8-203b6f0fb219%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Urbanczyk

unread,
May 14, 2018, 2:29:42 PM5/14/18
to CadQuery
Do you need python 2.7? I'd use python3 (which uses MSVC2015 AFAIK). If py3 is fine easiest is to use anaconda: (cf. the appveyor.yml )

conda create --quiet --name cqtest -c cadquery -c conda-forge freecad=0.17 python=3.6 pyparsing
pip install cadquery cqparts

One day we will also have a conda package for cadquery itself. I did not use cqparts yet so I am not sure if it supports py3,CQ itself definitely does.

Op maandag 14 mei 2018 16:59:49 UTC+2 schreef Zbyněk Winkler:
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.

Zbyněk Winkler

unread,
May 14, 2018, 4:38:43 PM5/14/18
to Adam Urbanczyk, CadQuery
I don't need python 2.7 - I was under the impression that freecad needs it since that's what is included in the portable binary release I was using.

That conda install needs to be run with 64bit conda. Except that "--quiet" option left me wondering if it got stuck not doing anything ;-). It is worth noting that conda takes "forever" (30min?) to create that environment. And in the end it says "Windows cannot find 'pythonw'. Make sure you typed the name correctly, and then try again.". trying to do something as admin (??)

...lib\site-packages\menuinst\win_elevate.py", line 70, in runAsAdmin

Anyway. The installed freecad seems to work (it starts and shows main window), as does installing cadquery and cqparts (I am able to import both).

Is there a way how to get the cadquery workbench working with this setup? Or how do I use cadquery without it?

Thanks! I did not hope to get this far this quick.

Zbyněk


To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/28bc2057-5859-46ae-b1e4-dbdf68b21629%40googlegroups.com.

Jeremy Wright

unread,
May 14, 2018, 4:55:50 PM5/14/18
to CadQuery
> Is there a way how to get the cadquery workbench working with this setup? Or how do I use cadquery without it?

You could open the Python console in FreeCAD and try doing the imports manually to see if FreeCAD can see them. If not, you can try to manipulate 'sys.path' directly using the append and insert functions so that FreeCAD can see the installed versions. Here's an example from the module of how to do it: https://github.com/jmwright/cadquery-freecad-module/blob/master/Init.py#L14

If I'm understanding you correctly that you got CadQuery and cqparts installed, you should be able to run CadQuery/cqparts scripts from the command line. Start the Python console from a command line or Power Shell window and try the imports 'import cadquery', 'import cqparts'. If you can do that, you can put your scripts into a file with a .py extension and run them like any other Python script. The drawback is that you won't have a display of the model. You can export to STEP or STL and use a viewer though. I think that Rusty has a more manual setup like this that he uses for his Twitch streams, but I've never identified all the parts of it. I'd put a link here, but all of Rusty's Twitch streams seem to have disappeared.



On Monday, May 14, 2018 at 4:38:43 PM UTC-4, Zbyněk Winkler wrote:
I don't need python 2.7 - I was under the impression that freecad needs it since that's what is included in the portable binary release I was using.

That conda install needs to be run with 64bit conda. Except that "--quiet" option left me wondering if it got stuck not doing anything ;-). It is worth noting that conda takes "forever" (30min?) to create that environment. And in the end it says "Windows cannot find 'pythonw'. Make sure you typed the name correctly, and then try again.". trying to do something as admin (??)

...lib\site-packages\menuinst\win_elevate.py", line 70, in runAsAdmin

Anyway. The installed freecad seems to work (it starts and shows main window), as does installing cadquery and cqparts (I am able to import both).

Is there a way how to get the cadquery workbench working with this setup? Or how do I use cadquery without it?

Thanks! I did not hope to get this far this quick.

Zbyněk

Zbyněk Winkler

unread,
May 15, 2018, 4:18:47 AM5/15/18
to Jeremy Wright, CadQuery
On 14 May 2018 at 22:55, Jeremy Wright <wrig...@gmail.com> wrote:
> Is there a way how to get the cadquery workbench working with this setup? Or how do I use cadquery without it?

You could open the Python console in FreeCAD and try doing the imports manually to see if FreeCAD can see them. If not, you can try to manipulate 'sys.path' directly using the append and insert functions so that FreeCAD can see the installed versions. Here's an example from the module of how to do it: https://github.com/jmwright/cadquery-freecad-module/blob/master/Init.py#L14

If I'm understanding you correctly that you got CadQuery and cqparts installed, you should be able to run CadQuery/cqparts scripts from the command line. Start the Python console from a command line or Power Shell window and try the imports 'import cadquery', 'import cqparts'. If you can do that, you can put your scripts into a file with a .py extension and run them like any other Python script. The drawback is that you won't have a display of the model. You can export to STEP or STL and use a viewer though. I think that Rusty has a more manual setup like this that he uses for his Twitch streams, but I've never identified all the parts of it. I'd put a link here, but all of Rusty's Twitch streams seem to have disappeared.

Actually, what I am looking for is gui :-). I guess I could somehow take the guts of the cadquery workbench and install it by hand without the embedded packages/libraries, right? Is there anything I should especially watch out for? btw: I am a programmer that is why I think cadquery is going to be "the thing" for me. I think the way to go could be python packaging tools, see https://forum.freecadweb.org/viewtopic.php?f=4&t=28748

Please let me know if your favorite workflow involves some other gui than freecad.

My current application is modelling some parts for a house reconstruction/extension. My other interests involve transient heat transfer FEA (on an assembly, with proper materials defined) to examine different heat accumulation strategies. I might also need/use export to IFC.

Zbyněk Winkler

unread,
May 15, 2018, 6:59:24 AM5/15/18
to Jeremy Wright, CadQuery
I toyed somewhat with convincing cadquery-freecad-module to not use the bundled libraries && work under conda built Freecad which is based on python 3 and contains updated dependencies (like PySide2 instead of PySide). I got it to load but that's it :-(. I don't understand the QT stuff.

Adam Vermeer

unread,
May 15, 2018, 7:45:50 AM5/15/18
to CadQuery
I've worked on fixing the tryCQ build.
On my end, things are working, but I'd like confirmation before I push the change to master


That link should launch a working server for you. NOTE: If you are met with a 'failed to launch' error, that is a MyBinder problem, NOT a build error. I had that a bit, and relaunching would fix it. MyBinder is still in Beta, so these things might still happen.

In my own experimentation I have lately been working with CQ / cqparts a bit more. If there is a need to have a jupyter env. with cqparts, I could start spending some time on that as well.
Probably it will require me to re-think how I made CQNB, but if there's enough interest, it might be a good project.


On Monday, May 14, 2018 at 6:14:06 AM UTC-4, Zbyněk Winkler wrote:

Zbyněk Winkler

unread,
May 15, 2018, 12:40:06 PM5/15/18
to Adam Vermeer, CadQuery
It is different (better). Before I got only the error. Now some UI is displayed and then I get the errors.


I also get the UI to interact with the box twice. First, no box is shown. Only after I click on Run Interact, the box is shown. I am not sure if that is the expected behavior.

When I reexecute the cell by pressing ctrl+enter for a second time, the UI is shown only once and no error is shown.

As for cqparts (or any other package), it would be nice if installing by pip worked - that is what I use with Google Colab.

Zbyněk


--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.

Adam Vermeer

unread,
May 15, 2018, 12:53:06 PM5/15/18
to CadQuery
I think it's best to keep this discussion now on the issue.

I had just posted here in case you missed it on Github.
I will continue addressing the problem there.

Hope that's ok :)
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.

Zbyněk Winkler

unread,
May 15, 2018, 1:23:20 PM5/15/18
to CadQuery
I was able to use the technique from Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py to use Freecad as cadquery gui even without cadquery-freecad-module.

Adam Urbanczyk

unread,
May 15, 2018, 5:34:24 PM5/15/18
to CadQuery
What are the issues with porting to pyside2 and python3?
Reply all
Reply to author
Forward
0 new messages