Sharing Your Work With CadQuery

603 views
Skip to first unread message

jmwright

unread,
Apr 20, 2016, 10:38:25 PM4/20/16
to CadQuery
We love to hear about what CadQuery users are working on. It's interesting to us, and aids us in making decisions about the future direction(s) that CadQuery will take. Sharing what you're working on may also connect you with like-minded community members who might have great ideas you'll want to leverage in your projects. I've picked up several tips from community members that I use all the time, and some have even made it into our CadQuery best practices.

Please feel free to introduce yourself and your projects here. As always, please share responsibly. Be sure you have the rights/permission to share anything you post here since it will be sent out to many email inboxes at once, and be publicly visible.

hyOzd

unread,
Apr 21, 2016, 3:17:03 AM4/21/16
to CadQuery

Here is a resin mold we designed (and built with CNC miller) to fix a 5000$ cable last week. This was our first experience with molding so we had to play around with sizes. First I designed it with freecad. But since tweaking parameters in freecad can be a little tricky, I decided to switch to cadquery. In my experience it's harder to design something from scratch in cadquery, especially if you are not exactly sure what you want. But, once you get the shape built in your mind (or in another cad tool :D), its easier to work with cadquery compared to gui based CAD tools. Its like I tell cadquery exactly what I want and it builds it for me. Another advantage is that; its more re-usable. You can put certain features in functions and use them in completely unrelated designs with ease.


Here is a link to cadquery script: https://gist.github.com/hyOzd/a36bd4e7fe1a5e924b39dc4b2ab7715d

Dave Cowden

unread,
Apr 21, 2016, 8:00:59 AM4/21/16
to hyOzd, CadQuery
wow! i mean wow, that is so awesome! It is SO AMAZING that mold is done with that few lines of code! 

Two questions:

(1) would you mind if we featured your example on the frontpage of cadquery? 
(2) can you put your finger on why CQ design is difficult? Which of these things do you think would help the most to remedy it?
       (a) a GUI
       (b) ability to visualize workplanes and sketches
       (c) easier installation and setup 
       (d) ability to import dxf (2d geometry)
       (e) 2d constraints rather than just 'fixed geometry' based
       (f) other?



--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/e1fc9be4-951c-4b0a-8a7e-66d218f31310%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jmwright

unread,
Apr 21, 2016, 8:13:38 AM4/21/16
to CadQuery, hyoz...@gmail.com
It's also really cool that you learned a new fabrication technique rather than just paying $5000 for a new cable. Thanks for sharing!

The way you're using the box selector to add fillets is a technique I need to remember. It's a really effective method that I had forgotten about until I saw your script.

Dave Cowden

unread,
Apr 21, 2016, 8:32:54 AM4/21/16
to jmwright, CadQuery, Hasan Yavuz ÖZDERYA
And, on another note, @hyOzd, i assume you guys went CQ-->STEP->Gcode to get it milled, right?  

If you are willing to let us share this example, that's a huge deal, because while lots of other packages like OpenSCAD can do code-cad, CQ is unique in its ability to produce STEP output, which is a requirement for actual machining instead of 3d printing.



On Thu, Apr 21, 2016 at 8:13 AM, jmwright <wrig...@gmail.com> wrote:
It's also really cool that you learned a new fabrication technique rather than just paying $5000 for a new cable. Thanks for sharing!

The way you're using the box selector to add fillets is a technique I need to remember. It's a really effective method that I had forgotten about until I saw your script.

--
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+u...@googlegroups.com.

hyOzd

unread,
Apr 22, 2016, 4:07:21 AM4/22/16
to CadQuery, wrig...@gmail.com, hyoz...@gmail.com

(1) would you mind if we featured your example on the frontpage of cadquery? 
(2) can you put your finger on why CQ design is difficult? Which of these things do you think would help the most to remedy it?
       (a) a GUI
       (b) ability to visualize workplanes and sketches
       (c) easier installation and setup 
       (d) ability to import dxf (2d geometry)
       (e) 2d constraints rather than just 'fixed geometry' based

       (f) other?

@dcowden I would be very happy to see it featured : )

About your second point. I think a written language is just not the best choice for 'drafting'. You have to be able to quickly visualize things. Sometimes even freecad doesn't cut it so I bring up pen&paper. In the case of this work, if I didn't have freecad but just cadquery at my hand, I would probably first draft it on paper. When it comes to drafting WYSIWYG tools are just superior in my opinion. I don't know how cadquery could beat them. But generally improving cadquery would definitely help. I would love to see more tools (functions/methods) added to cadquery. And selectors should be improved. They are the heart of cadquery in my opinion.

About the choices you gave I would pick these:

   (b) ability to visualize workplanes and sketches
   (e) 2d constraints rather than just 'fixed geometry' based
   (a) a GUI

Being able to quickly see what certain line of code does or ability to highlight selections and workplanes visually would help.

About the '2d contraints'; this sounds like a good idea. 2d drawings can be a little challenging in cadquery syntax. I somehow get it done but afterwards reading my own code, I notice it can be quite confusing. I enjoy using 2d constraints in freecad, they allow me to draw stuff otherwise I couldn't draw because I lack the knowledge of geometry to actually calculate them. Can you tell how '2d constraints' would work in cadquery?

GUI; current freecad-cadquery module isn't bad. It gets the job done. But a featureful gui would improve user experience. I haven't thought about it much; but I would love to see these three things;
  - quick access to documentation and examples
  - project templates (such as start with a box, start with a cylinder etc)
  - this would be mostly helpful to beginners; ability to select something (edge, face, point) from the user interface and having a selector displayed for it. For example user selects the top face of a cube and selector for it displayed "faces('>Z')". I don't expect this to work seamlessly for every case. But as I said having something for simple shapes could be helpful to beginners.

A small extra; in my previous works I really struggled with arcs : ) having a couple more choices for drawing arcs would be great. And fillets/chamfers for 2d drawings...


And, on another note, @hyOzd, i assume you guys went CQ-->STEP->Gcode to get it milled, right? 

That was the plan :) but the CAM tool I've used didn't support STEP format. Software was Deskproto. I think they omitted step format because its mostly used for artistic work rather then technical parts. So I had to use .stl output. I'm no cam expert but I can see why step format is preferred for cam work. Even the cheaper CNC machines can do very precise work (<50um). When you use a lossy format such as STL you are losing this ability. Another thing I've noticed is that; cam tools are not very smart. Sometimes you have have to add tasks manually by selecting features on the shape. A simple example is drills. You have to select the drill locations for the CAM program. For this to work you need to be able to import your shape in STEP format.


It's also really cool that you learned a new fabrication technique rather than just paying $5000 for a new cable. Thanks for sharing!

@jmwright This was a long cable (100m) for a sensor used in construction sites. Fix had to be strong and well isolated because the cable is sent down in a tube -most of the time- filled with water. The company selling it flat out said it couldn't be repaired and they (owners of the cable, not us) had to buy a new one. 'Consumerism' at work :P

by the way here is the actual mold; http://i.imgur.com/0fNhXkt.jpg

Dave Cowden

unread,
Apr 22, 2016, 7:18:30 AM4/22/16
to hyOzd, CadQuery, Jeremy Wright
@dcowden I would be very happy to see it featured : )

​Ok awesome, thanks for the permission. I am going to add it to our samples collection, and also feature it in the readme.​
 
​ Its such a great example of what CQ is all about. I'm jacked you got business value from it.

 And selectors should be improved. They are the heart of cadquery in my opinion. 

The main motivation for the CQ 2.0 re-write is to introduce a proper feature tree. This will allow the ability to select things using feature ids, which is a very powerful feature, especially when combined with existing selectors. Example: select all of the planar faces that were created by this hole operation, or even "select all of the features who's name looks like xxx"

The feature tree will also make it much easier to break the fluent language change, and still retain the ability to select ​
 

. 2d drawings can be a little challenging in cadquery syntax

​Very true. I've found for objects I have done that i often have to draw it out and do the math before I can use CQ.  The ideal is the opposite-- have the tool do the math.   I have thought a few times about how to do 2-d in cq, and its not very easy. My _thought_ is for it to be more like what i do when i draw in solid works. I draw a circle with a _notional_ diameter, and then some lines. but the dimensions really dont matter. then, as i add dimensions, the sketch is solved and things change for me. That's what i hope to create.   

I also find in 2-d cad a do a lot of 'draw and trim'.  LIke, draw a line, and a circle, but then trim the line where it hits the circle kind of thing. not sure at all how to do that in code. (Yet). But i'm going to be the first one to figure it out!​
 


Jeremy Wright

unread,
Apr 22, 2016, 8:50:28 AM4/22/16
to Dave Cowden, hyOzd, CadQuery
 (b) ability to visualize workplanes and sketches
> (e) 2d constraints rather than just 'fixed geometry' based
> (a) a GUI
> - quick access to documentation and examples
> - project templates (such as start with a box, start with a cylinder etc)
> - this would be mostly helpful to beginners; ability to select something (edge, face, point) from the user interface and having a selector displayed for it. For example user selects the top face of a cube and selector for it displayed "faces('>Z')". I don't expect this to work seamlessly for every case. But as I said having something for simple shapes could be helpful to beginners.

I've been tinkering around with a next-generation GUI for CadQuery, and some of the things you've mentioned are on the drawing board. It already has easy access to the examples and documentation because those are pretty easy to add. Those mouse-code interaction that you mentioned is something I've been wanting to do for a long time. I think it would go a long way towards making CadQuery more accessible for a larger range of tasks (and for new users). It sounds like if constrained 2D drawing functionality was added too (which would be converted to code of course) that would be ideal.

For the project templates, my thought was to allow the user to right click on the 3D view in the GUI to get a context menu. If they click in open space maybe they could get a list of template objects that they can select from (box, cylinder, etc). If they right click on a face/edge/vertex of an object they get a menu of things they can do with those objects (like create a face selector).

Workplane visualization is something that Dave and I talked about early on when I got involved, and seems like a win to do in the GUI. It's easy to get lost on where your current workplane is.

Dave Cowden

unread,
Apr 22, 2016, 11:09:15 AM4/22/16
to Jeremy Wright, hyOzd, CadQuery
yeah i'm really big on ability to visualize workplanes-- not only the current one, but named ones. we've had a lot of questions and confusion that woudl be cleared up by displaying the workplane, its center point, and normal direction.

I also want to display a sketch on a workplane too. again-- a good way to see what you are doing as you work with 2d.

I also want to imprort dxf ( very doable, i found a python lib to do it ).  I actually hate import dxf-- because its very not-cq: the parts you import are not parametric. But its probably the path a lot of people will find most convenient. I see a lot of OpenSCAD projects that start with a dxf and then extrude. 

Johannes

unread,
May 1, 2016, 1:58:35 PM5/1/16
to CadQuery


Hi,

here is my example (see also here): I designed a clock (using some other CAD tool) which consists only of 2D shapes that should be laser-cut from 1mm steel. Now my idea is to write a script that 'extracts' all the shapes, orients them correctly and arranges them in a space saving way (something I did manually in the past). So I wrote a really dirty script, that recognizes the orientation of each shape, rotates them accordingly and uses this script to arrange them, see both screenshots. I think it's quite obvious that the packing can be improved, so the next thing I tried is using this library. Unfortunately that script is written in java, but the results look promising. So I exported the shapes s.t. I can import them using that library. But to do that correctly I need to export the points that define a face in the correct order (counter-clockwise), which is were I'm currently stuck at (see also the issue on github). Since this is a free-time project, I currently don't have so much time to work on this. But my next step would be to determine the correct point order using edges. Cutouts make this harder... but it would be pretty cool if this would work reliably.


Johannes



Jeremy Wright

unread,
May 2, 2016, 4:49:16 PM5/2/16
to Johannes, CadQuery
Another very cool project. Thanks for sharing Johannes.

--
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+u...@googlegroups.com.

Jeremy Wright

unread,
May 14, 2016, 11:34:51 PM5/14/16
to Johannes, CadQuery
It's been a little while since I worked on this project, but it's the coolest thing I've done with CadQuery so far. It was a volunteer project I helped out on for Mach 30 (mach30.org).


It's a design for a cold gas thruster that could be used for space satellite attitude control. This particular thruster design had been documented before, but this project tied the math and theory of the thruster nozzle-body assembly all the way through to the 3D printed object, and CadQuery was the pivot point for all of that. There was a solver that would find the optimal wall thickness and then CadQuery would use that to generate the chamber. That was then exported to STL from FreeCAD and 3D printed.


​On the left you can see the IPython notebook, which held the documentation, equations, and the Python code for the chamber body. That code could be used directly by the CadQuery script to generate the 3D model, keeping us from having to document things in multiple places. Everything was linked, from the theory through to the manufacturing steps.

Dave Cowden

unread,
May 15, 2016, 9:22:38 AM5/15/16
to Jeremy Wright, Johannes, CadQuery

Awesome Jeremy! Thanks for sharing!

I would like to add this sample to the front page of cadquery page. May I?

Jeremy Wright

unread,
May 15, 2016, 11:19:34 AM5/15/16
to Dave Cowden, Johannes, CadQuery

Sure thing.

Jeremy Wright

unread,
May 15, 2016, 9:03:11 PM5/15/16
to Dave Cowden, Johannes, CadQuery
If there's a spot for it, could you add a link to mach30.org please?

Dave Cowden

unread,
May 15, 2016, 9:13:45 PM5/15/16
to Jeremy Wright, Johannes, CadQuery
sure will!

Jeremy Wright

unread,
Jun 2, 2016, 1:54:44 PM6/2/16
to Dave Cowden, Johannes, CadQuery
I've started a GitHub repo for some of my personal CadQuery projects. Right now there's an in-progress eggbeater style antenna design for receiving radio transmissions from satellites and the International Space Station (based on some work mach30.org is doing). The idea is that you change the frequency in the script, and it gives you an accurately configured model and tells you things like how long the aerials need to be. Right now it only models the aerials.


The other project is a fun one that I experimented with for a potential give-away item. It translates someone's name or a word from English to the Star Wars Aurebesh alphabet.

Each project's directory has a readme file which explains what I'm trying to do. As I do more of these side projects they'll probably end up in that repo. As the warning in the readme says, the scripts aren't meant as canonical references but anyone is welcome to borrow from, contribute to, and discuss the scripts as much as they want.

One thing the Aurebesh translator project showed me is that it would be helpful to have SVG import as well as DXF import. FreeCAD supports SVG import, but you have to utilize the GUI through scripting to do it, so it's not an ideal option.

Adam Urbanczyk

unread,
Aug 16, 2016, 3:39:34 PM8/16/16
to CadQuery
Dear all,
here is an example (experimental extruder support for a P3steel 3d printer) which uses a couple of time the new Nth string selector syntax: https://github.com/adam-urbanczyk/cadquery-models .

Jeremy Wright

unread,
Aug 16, 2016, 3:43:57 PM8/16/16
to Adam Urbanczyk, CadQuery
Awesome! Thanks for sharing.

--
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/6ae5b397-34b5-4f8e-b7b2-dc06113c46b3%40googlegroups.com.

Dave Cowden

unread,
Aug 16, 2016, 6:10:02 PM8/16/16
to Adam Urbanczyk, CadQuery
so awesome! It always amazes me what's possible!  

On Tue, Aug 16, 2016 at 3:39 PM, Adam Urbanczyk <adam.jan....@gmail.com> wrote:

--
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.

jmwright

unread,
Aug 19, 2016, 2:20:47 PM8/19/16
to CadQuery
@Adam - Would you be interested in adding some comments to key sections of this script so that I could include it as an advanced example within the CadQuery module for FreeCAD?

Adam Urbanczyk

unread,
Aug 31, 2016, 6:19:25 PM8/31/16
to CadQuery
Sure! I will let you know once I'm done.

Adam Urbanczyk

unread,
Sep 21, 2016, 3:47:54 PM9/21/16
to CadQuery
@jmwright -- I finally added some comments to the file. Let me know if it is clear enough or not.


On Friday, August 19, 2016 at 8:20:47 PM UTC+2, jmwright wrote:

Jeremy Wright

unread,
Sep 22, 2016, 4:47:48 AM9/22/16
to Adam Urbanczyk, CadQuery

Those comments look great, thanks Adam. I'll get that added to the examples that come with our FreeCAD module.


--
You received this message because you are subscribed to a topic in the Google Groups "CadQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadquery/mS2ITd37sQA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/e43c8579-ddc5-4320-aaf3-a24c5ae7418f%40googlegroups.com.

Jeremy Wright

unread,
Sep 23, 2016, 3:54:51 PM9/23/16
to Adam Urbanczyk, CadQuery
Thanks for this example. It's been added in the latest commit of the FreeCAD module. I had to add some spaces and newlines to get our editor's syntax checker to stop complaining, but none of the logic was altered.

Adam Urbanczyk

unread,
Sep 24, 2016, 10:05:22 AM9/24/16
to CadQuery, adam.jan....@gmail.com
Cool!


On Friday, September 23, 2016 at 9:54:51 PM UTC+2, jmwright wrote:
Thanks for this example. It's been added in the latest commit of the FreeCAD module. I had to add some spaces and newlines to get our editor's syntax checker to stop complaining, but none of the logic was altered.
On Thu, Sep 22, 2016 at 4:47 AM, Jeremy Wright <wrig...@gmail.com> wrote:

Those comments look great, thanks Adam. I'll get that added to the examples that come with our FreeCAD module.

On Sep 21, 2016 15:47, "Adam Urbanczyk" <adam.jan....@gmail.com> wrote:
@jmwright -- I finally added some comments to the file. Let me know if it is clear enough or not.


On Friday, August 19, 2016 at 8:20:47 PM UTC+2, jmwright wrote:
@Adam - Would you be interested in adding some comments to key sections of this script so that I could include it as an advanced example within the CadQuery module for FreeCAD?
You received this message because you are subscribed to a topic in the Google Groups "CadQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadquery/mS2ITd37sQA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadquery+u...@googlegroups.com.

jmwright

unread,
Sep 27, 2016, 3:18:24 PM9/27/16
to CadQuery
I'm moving this over here because the discussion was getting into "share your work" territory. I've been doing some work on automated model creation and FEM analysis in FreeCAD. Below is my explanation of what I've been doing.

It's hobby-related at this time I guess, but it's also aimed at learning a new mechanical design technique. I've gotten interested in generative design within the last several months, and I feel like CadQuery is a great fit for that space. Most generative design documentation and examples out there are in architecture and product design, with a lot of information related to aesthetics. So I set out to create at least one beginners example of generative mechanical design, with CadQuery and FreeCAD at the center of it. The first example I've started on is a simply loaded beam. I've written a CadQuery script that varies a beam's shape pseudo-randomly. The idea is to generate thousands (or millions) of variations, doing an FEM analysis on each one and then comparing those to a solid beam and an I-beam. The idea is that it should yield predictable results for a well understood case as a first baby step.

Here's the test harness for automating the FEM analysis:
https://github.com/jmwright/cadquery-projects/blob/master/generative-design/simple_beam/test_harness/test_harness.py

Here's the CadQuery script to generate the beam. I haven't integrated it with the test harness yet:

There's going to be a whole other layer of using things like Evolutionary Algorithms, but I'm still trying to wrap my head around that whole concept. My plan is to get the beam example working with generation, analysis and some comparison, and then send my work around to some generative design people and have them critique it.

What I'm eventually shooting for is to have an open source toolchain that can do things like this: https://en.wikipedia.org/wiki/Evolved_antenna

There's a whitepaper out there that explains how NASA did it in more detail. I'd like to be able to generatively design all sorts of things, not just antennas, but that's the best example involving an automated generate-analyze loop that I've found yet.

thebluedirt

unread,
Sep 27, 2016, 4:15:11 PM9/27/16
to CadQuery
wow, that's really really awesome!  you're competing with NASA!!!

Jeremy Wright

unread,
Sep 27, 2016, 7:41:47 PM9/27/16
to Dave Cowden, CadQuery

Nah, just using them as a guidepost. I might have to be careful about U.S. export control restrictions if I reproduce the NASA setup as open source, but I'll check that out before I get too far.


--
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/f435cf2e-0c3f-4db1-a727-3cf2b0d87a86%40googlegroups.com.

Ragnar Middelhede

unread,
Sep 28, 2016, 2:47:23 AM9/28/16
to CadQuery
Hi Jeremy

What an interesting subject ;-) I am working daily as FEM specialist and believe it will be along with topology analysis a hot subject for product designers and hobbyists in the furure. But the hart part is to interpret the results in the right and responsible way and to apply the different mechanical/physical natural laws so the results make sense.

I have a question: Why would you generate thousands/millions of beam variation and then run an analysis on them, it requires a lot of CPU (mesh dependent). Why just not take one beam design and apply topology analysis until you have found the right size and strength.  

jmwright

unread,
Sep 28, 2016, 5:17:02 PM9/28/16
to CadQuery
> Why would you generate thousands/millions of beam variation and then run an analysis on them, it requires a lot of CPU (mesh dependent).

@Ragnar Thanks for the feedback. Quick answer: I'm attempting to create what I think is a "generative design", and also trying to follow the path that NASA laid out with their generatively designed antenna. I'm completely open to discussion on all of my assumptions though. I'm not knowledgeable in FEM, and I'm just trying to understand what generative design really is and how to apply it. The following blog post talks at a philosophical level about what generative design is.


To me, and I don't know if this is right, it's letting an algorithm explore a problem space by creating and directing mutations of a starting design (condition). In my beam example, there are some fixed points so that I end up with a "beam" with two flat areas to fix and apply a force to. The other points are free to move to any location that will still result in a valid solid, and are randomly moved to vary the beam's shape. The FEM analysis of each variation (and the resulting CPU overhead) is a way of quantifying the fitness of a solution for the problem. I haven't defined the fitness output value yet, but it could simply be deflection, deflection versus weight, or any other metric that makes sense. The FEM analysis is also simply an attempt to mimic what NASA did with the NEC4 antenna analysis software for their generatively designed antenna.


In a more advanced example, something like an evolutionary algorithm would help decide which traits are beneficial and which are not, using that information to guide future iterations of the design. There's also an aspect of how and when to present potential solutions to a designer so they can direct the evolution of the design in ways they see as beneficial. This gets well beyond the example I'm trying to create though.

I'm interested in hearing more about topology analysis and how it would work in my beam example. Would it be a direct replacement for the CPU-intensive FEM analysis I'm doing here? Is it possible to do topology analysis with FreeCAD or other open source tools? Is what you're suggesting anything like what is discussed in this post? http://forum.freecadweb.org/viewtopic.php?t=15460

Sorry for all the naive questions. This is a case where I sense value in an approach without understanding it very well. I know enough to feel that it's worth pursuing, but don't know enough to properly explain what "it" is. It's kind of how I felt about CadQuery when I first started using it. I didn't fully understand the power of the CadQuery's design philosophies, but my instincts told me there was something there worth learning. My instincts were right on that one.

> But the hart part is to interpret the results in the right and responsible way and to apply the different mechanical/physical natural laws so the results make sense.

Agreed. It doesn't matter if you can generate millions of possible designs if they don't make sense and don't solve the design problem. That may be where the designer guided evolution comes in. A designer can look at a variation and see that it's not viable, whereas a computer would  not.

Hopefully that all makes sense.

Ragnar Middelhede

unread,
Sep 29, 2016, 9:52:49 AM9/29/16
to CadQuery
Hi Jeremy

I must admitt, I haven't heard about generative design. I will need to read a little more about it.

Regarding topology optimization: This definition is taken from the homepage http://en.z88.de/topology-optimization/ 

The topology optimization as a part of the structural optimization helps engineers to design products or single parts to meet the contrived requirements in an optimal way. This can be maximum stiffness with low volume or maximum stability with low mass. Thereby great possible savings can be achived in terms of less application of energy in production, less material usage and less workload in development. 

They have a freeware of a topology and finite element program aviable to download. http://en.z88.de/z88arion/

Anotherone is http://www.salome-platform.org/ for finite element analysis.

Once you have defined your boundary / material conditions and constrains for the beam model you will run a topology analysis. The result you'll get in return can be evaluated for stiffness and strength in a FEA program. Until you have reached the desired max. allowable values e.g (v. Mieses, tensile, yield...plasticity) you will typically do some stress iterations.

For simple structures like beams, I would not consider any topology analysis. Beams are usually applied in conservative structural applications and are easily stress evaluated by hand calculations. When it comes to leightweight applications e.g. (wind turbine wings, car body frames...) here you typically will always go for a size optimization in order to save material or increase stability or changing the stiffness. This little video explains a liitle how it works: https://www.youtube.com/watch?v=Eo6Kz30cBl4


I think this FreeCad topology module is a very good example for what and how it can be used for.

I share the same opinion about CadQuery. I am trying to use it to build some design tools with an "End-user-GUI"  where I try to include topology analysis. 

Let me know if there are any doubts :-)

Adam Vermeer

unread,
Nov 20, 2017, 7:13:29 AM11/20/17
to CadQuery
Hello, everyone.

I've been using CadQuery + Jupyter notebooks a lot lately, and have actually managed to use CQ to build something! It's a fairly simple iPad stand made from stainless steel tubes.

I have a post about it here:

That post has all of the CQ code I used as well as some in-browser part viewers and a download of the step files. It even has some pictures of the final build, if you're interested in that.

Jeremy Wright

unread,
Nov 20, 2017, 7:50:53 AM11/20/17
to CadQuery
Thanks for sharing! That post is really cool, and I like seeing a real-world example showing the power of using Jupyter Notebooks to develop and document a project.

I think this would be another great addition to the Examples section of the readme. https://github.com/dcowden/cadquery#examples

You mentioned moving the tube function into a module at the end of the post. Peter Boin is working on a collection of parts and assemblies that your tubing function might fit into. He's defining interfaces for part and assembly objects so that they can be integrated into projects with a minimal amount of pain. https://github.com/fragmuffin/cqparts

Adam Vermeer

unread,
Dec 19, 2017, 7:26:34 AM12/19/17
to CadQuery
I made another project in a similar vein to the ipad stand.




I had a TV lying around with no front bezel. It worked otherwise, so I just needed to make a frame for it. 

In this cadquery project I tried out the (work in progress) DXF function instead of creating the tube's profile directly. There's still room to improve my workflow, but I'm happy that I can use cadquery for some actual creative design work!

I intend to keep making these kinds of posts, but really don't want to hijack this thread, so I think the next one I'll refrain from posting here :)

Jeremy Wright

unread,
Dec 19, 2017, 11:35:24 PM12/19/17
to CadQuery
> I intend to keep making these kinds of posts, but really don't want to hijack this thread, so I think the next one I'll refrain from posting here :)

I don't think there's any problem with posting your projects here since they involve CadQuery, even if you have a lot of them. It helps us build a library of real-world examples for people to look at. This is a great use of CadQuery, and it's very cool that you used the new DXF import. 

One note - I was viewing your post in Google Chrome on Windows 10 and scrolling was painfully slow. I'll check the next time I'm back in Ubuntu, but I don't remember having that problem in it.

Adam Vermeer

unread,
Dec 21, 2017, 8:48:17 PM12/21/17
to CadQuery
Well, I guess I can keep sharing then :) I'm glad they're useful examples.

I really do need to optimize how I'm displaying the objects. They are just iframes, and all currently use a framework that's meant for VR stuff... probably room for improvements. I went for 'quick and easy' over 'optimal'. I have some tweaking to do!

Thanks for the feedback

Jeremy Wright

unread,
May 23, 2018, 12:38:31 AM5/23/18
to CadQuery
@All

Here's a simple example of a common use case for me, a part generator.


The components of a single pin are generated and then copied in an array pattern depending on the number of rows and columns set. I'll generate the array of pins I need and then pull them into an assembly. If I got the pin spacing or some other parameter wrong, it's really easy to regenerate the array and save/export them again. I create the body and the pin separately so that they can have independent colors. The colors set when using show_object stay with the part when you save/export from the FreeCAD GUI.

These parts were generated for use in a traditional assembly. If you're interested in creating dynamic native CadQuery assemblies and haven't seen it yet, check out cqparts: https://github.com/fragmuffin/cqparts

Dave Cowden

unread,
May 23, 2018, 7:18:32 AM5/23/18
to Jeremy Wright, CadQuery
Awesome example! Thanks for sharing!

This reminds me that there has been a lot of discussion about moving examples to a separate place so that it's easier for people to contribute them.

What are your current thoughts on that? Is your projects repo intended for that purpose?

I like the fact that the current examples auto generate pictures. But they also serve partly as tests, and I really don't want to mix them with user contributed code.


--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/7843c164-ebda-4284-b053-5191b7cee530%40googlegroups.com.

Jeremy Wright

unread,
May 23, 2018, 10:40:47 AM5/23/18
to Dave Cowden, CadQuery
> What are your current thoughts on that?
> Is your projects repo intended for that purpose?

Honestly, I'm not a fan of how we've currently got our examples organized, and I'm largely to blame. They start out teaching individual core concepts and operations, and then at example 22 we start mixing in "real world" examples. I really like the contributed real-world/complex examples (and have contributed one myself), but I think we should break just those out into a contrib example repo. That way when somebody adds some core functionality to CadQuery, they're not tacking on their example after/among unrelated real-world scripts.

My cadquery-projects repo is kind of like a scratch pad where I can put things that are incomplete or could cause confusion, but still put things out there so people can borrow code/ideas from them if they're useful. Thus the "use at your own risk" warning in the readme. I'm not opposed to migrating things like my header pins example over, but I don't want to add to the current disorganization.

Here's my suggestion on restructuring the examples. The core list below is the same up until example 22. I left the lego brick in the core examples because it's interesting and is a good segue into the contributed examples. We could make it example 100 or something so that people could fill in core concept examples before it.

Core Examples (stays in main CadQuery repo)
  • Ex001_Simple_Block.py
  • Ex002_Block_With_Bored_Center_Hole.py
  • Ex003_Pillow_Block_With_Counterbored_Holes.py
  • Ex004_Extruded_Cylindrical_Plate.py
  • Ex005_Extruded_Lines_and_Arcs.py
  • Ex006_Moving_the_Current_Working_Point.py
  • Ex007_Using_Point_Lists.py
  • Ex008_Polygon_Creation.py
  • Ex009_Polylines.py
  • Ex010_Defining_an_Edge_with_a_Spline.py
  • Ex011_Mirroring_Symmetric_Geometry.py
  • Ex012_Creating_Workplanes_on_Faces.py
  • Ex013_Locating_a_Workplane_on_a_Vertex.py
  • Ex014_Offset_Workplanes.py
  • Ex015_Rotated_Workplanes.py
  • Ex016_Using_Construction_Geometry.py
  • Ex017_Shelling_to_Create_Thin_Features.py
  • Ex018_Making_Lofts.py
  • Ex019_Counter_Sunk_Holes.py
  • Ex020_Rounding_Corners_with_Fillets.py
  • Ex021_Splitting_an_Object.py
  • Ex025_Revolution.py
  • Ex031_Sweep.py
  • Ex034_Sweep_Along_List_Of_Wires.py
  • Ex033_Shelled_Cube_Inside_Chamfer_With_Logical_Selector_Operators.py
  • Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py
  • Ex026_Lego_Brick.py
Contributed Examples (Separate Repo)
  • Ex022_Classic_OCC_Bottle.py
  • Ex023_Parametric_Enclosure.py
  • Ex027_Remote_Enclosure.py
  • Ex028_Numpy.py
  • Ex029_Braille.py
  • Ex030_Panel_with_Various_Holes_for_Connector_Installation.py
  • Ex032_3D_Printer_Extruder_Support.py
There are several more already out there that we could collect for the contrib repo, like the resin mold example from the readme. If we ended up with thousands of examples in here I'd be fine with that. People can use GitHub search to find what they want, or maybe somebody can write the CadQuery equivalent of Hoogle for Haskell programmers. We should probably ask that people use descriptive file names and put descriptive header comments in their examples to make them more easily searchable later. We could probably also remove the 'Ex0XX_' prefix from the file names since there's no real progression of skills like there is with the core examples.


To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.

Dave Cowden

unread,
May 23, 2018, 11:57:02 AM5/23/18
to Jeremy Wright, CadQuery
I agree. I'm going to create a new repo for examples, with a very open contribution policy. These will be community authored and reviewed.

I think Jeremy's suggested breakdown is perfect-- i'll move the ones listed as 'contributed examples' into the new repo.

This will provide a side benefit that the new rep will get its own README-- so i can put pictures of examples there, which are currently cluttering the main repo readme.

I created this issue to track this work. https://github.com/dcowden/cadquery/issues/271


Bruce

unread,
Apr 23, 2020, 10:39:21 AM4/23/20
to CadQuery
Hi folks I'd like to thank you all for your support in my introduction to CadQuery.
And now I would like to proudly show what I've made with CadQuery.

Before I discovered CadQuery I tried a few other things (OpenSCAD, OpenJSCAD, FreeCAD)
If you would like to see my buildlog you can read more about it here: https://bruceisonfire.net/2020/04/23/my-adventure-with-flosscad-the-birth-of-hexidor/ on my blog.
Or in the reddit post I've made.

https://preview.redd.it/a2ucr89reku41.png?width=1256&format=png&auto=webp&s=fe713c444f17047c0b175384d4aa26aeff25cfb6

Keep up the good work!!

Dave Cowden

unread,
Apr 23, 2020, 11:36:42 AM4/23/20
to Bruce, CadQuery
Wow Bruce! 
Thanks for sharing this project! I enjoyed reading your project log.

Thank you for your props to the CQ community.  You mention that you found CQ hardest to get started with-- can you share some comments that help?  Your perspective about what we could do to help would be very much appreciated and very helpful. We rarely see such a deep dive comparing the various approaches directly.

Thanks again, your project is VERY professional looking! 


--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/169fcb4c-0aca-449a-b227-3d7dc6826513%40googlegroups.com.

Bruce

unread,
Apr 23, 2020, 1:43:55 PM4/23/20
to CadQuery
Hey
Thanks for the compliments!
CQ is very powerful as you can acces every edge or plane and use it for an operation. Many commands can be linked together and it's getting abstract very quickly.

hex en coords voor grid
In OpenSCAD you can create an easy function and spit out a hexagon and translate it to where ever you'd like.
With QC you need to create a set of coordinates and pass it to a function this function generates a hex for every point it receives something like this:


def makeHex(self,diameter):
    #self refers to the CQ or Workplane object
         ....   
    def _makePolygon(center):
         .....
        return cq.Wire.makePolygon(pnts)
    return self.eachpoint(_makePolygon,True)
 
which look like complex high level statements compared to the simple functions in OpenSCAD.
You feel CQ is just a lot more powerful as you can enter anything into anything but it's hard to understand at first. When I was looking at the examples I was able to understand them but I was not able to come up with the arguments and functions myself.

OpenSCAD's documentation is very user friendly: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#square lots of examples and every argument is explaned.
While for CQ it sometimes feels you need to understand Object oriented programming to understand how to use a function.
Or when you'd like to rotate something: https://cadquery.readthedocs.io/en/latest/classreference.html?highlight=end%20point#cadquery.Shape.rotate
The documentation is talking about vectors, begin points and endpoints. Which gives you the feeling you can create anything. But you're still wondering what you could use as an beginpoint and endpoint for the rotation of your square.
There is a lot of documentation but it looks like it's written for other developers instead of noobs.

I feel CQ is by far the best thar is out there, maybe I'm missing something. But it's hard to getting started with.
As you could compare in ease of use TinkerCAD < FreeCAD < Blender
You have OpenJSCAD < OpenSCAD < ... < QC.

I'd love to get some better understanding of this program.

Another thing just to get this working and installed (I'm using Ubuntu) was a lot harder than any of its competitors.

Every time I need to look up
(conda env create -f cqgui_env.yml -n cqgui
conda activate cqgui
python run.py)
Just to get it started. This might be because I'm a linux noob or I missed some documentation.

I'm not completly stupid but it's still hard to use. More tutorials, videos, examples and documentation for sure will help.
I'd love to support this project by sending some money but I don't think that will solve the problem.

This answer my have bad formatting / structure. But I think it will pass the point I'm trying to make.

I love the work your doing and the warm community behind it. I hope this keeps going!

For any questions or feedback feel free to ask.

Warm Regards
Bruce
To unsubscribe from this group and stop receiving emails from it, send an email to cadq...@googlegroups.com.

Jeremy Wright

unread,
Apr 23, 2020, 5:04:28 PM4/23/20
to CadQuery
@Bruce

Very cool, thanks for sharing. It's always nice and motivating to see the things the community creates with CQ.

CQ does require a very different mindset than OpenSCAD. It seems hard to make the mental switch for quite a few people, but hopefully it's worth it in the end.

> Another thing just to get this working and installed (I'm using Ubuntu) was a lot harder than any of its competitors. Just to get it started. This might be because I'm a linux noob or I missed some documentation.

Installing CQ 2.x by itself is harder than it was with CQ 1.x, but that's one of the trade-offs we currently have to live with. I expect it will become easier over time after we've gotten comfortable with the new normal of 2.x and start exploring other installation methods. I think the easiest way to get started right now is to grab a pre-built version of CQ-editor, which includes all the dependencies with the GUI application. It works well for me in Ubuntu 18.04. I just used it for creating sewing machine thread guides for a friend earlier this week, and exported straight to STL from the code. https://github.com/CadQuery/CQ-editor/releases/tag/0.1RC1

In your post you mention wanting to do a projection for your laser cutter. If you want to do that directly from your CadQuery code I'm guessing it's possible via SVG export, but it may take some tinkering. Enabling SVG export for CNC mills and laser cutters (and maybe even slicing) is something I hope to work on eventually. Finding time is always hard though.

On how to make your game more widely available, what if you could 3D print it in multiple sections and then have dovetails or something to assemble the sections together? That would make it easier to transport too. If you create one that will fit in a 250x210x200 print volume, I'd be interested in giving it a shot on my Prusa i3 Mk2. Have you considered selling the completed game on Tindie or Etsy?

Nice work!

Adam Urbanczyk

unread,
Apr 28, 2020, 3:45:06 PM4/28/20
to CadQuery
Great project and write-up! It is always nice to hear some constructive feedback. What do you think should be our top prio regarding ease of use? I have a couple of proposals (feel free to extend the list):

1) More complex examples
2) Add simple example for every function
3) Type annotations
4) More debugging tools in the CQ-editor

BTW: are you ever planning to share the CQ sources of your model?

Bruce

unread,
Apr 28, 2020, 6:38:31 PM4/28/20
to CadQuery
Hi Adam, thanks for the compliments!
I went to FOSDEM to see your talk because wanted to see the people behind the software, I use for my projects. Thanks for the talk! (I forgot to ask for stickers though)

Yes I'd like to share my code but as you may have read at the bottom of my blog post. I haven't decided yet what license I should pick, I'm open for suggestions.

I'd love to share my code because I'm curious to your feedback and I'd love to learn from the people here. It probably could have been a lot more efficient.

What personally works best for me is a lot of examples, just to see how functions are called and what input objects they use and how they are configured.

So for me It would be:
1) Add simple example for every function
2) More complex examples
3) Type annotations
4) More debugging tools in the CQ-editor

Thanks and keep up the great work!!

Eddie Liberato

unread,
May 18, 2020, 9:30:38 PM5/18/20
to CadQuery
Cool and interesting project! Cheers

Reply all
Reply to author
Forward
0 new messages