thesis: can I use CADQuery

597 views
Skip to first unread message

Igor Messina

unread,
Feb 28, 2016, 1:30:21 PM2/28/16
to CadQuery
Hi,
I'm looking for a cad3d for my thesis, because i wanna do a FEM, multybody and cfd analysis for a recumbent trike.
I used MSC Adams, Patran/Nastran, but now I have to use only free software, so I'm looking for a cad3d to generate the geometry of my trike.
I usually used Adams preprocessor to generate the geometry, so I have to learn something.
I'm very happy because CadQuery seems great!
Do you think it is ok for my goals? 

sorry for my terrible english
Igor

Jeremy Wright

unread,
Feb 28, 2016, 2:01:56 PM2/28/16
to Igor Messina, CadQuery

Hi Igor,

No need to apologize for your English. Thanks for reaching out to us.

Do you have an image or CAD export of your trike that you can share with us? That should help us tell you if CadQuery will be efficient for doing what you need. If not, maybe just list your CAD requirements and we'll make the best recommendation we can.

Also, CadQuery is not set up to do assembly and animation. You should be able to do those things through FreeCAD once you've created the individual parts using CadQuery though.

Jeremy

--
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/d878e516-fa40-47f0-b74b-a39b55fed99c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Igor Messina

unread,
Feb 28, 2016, 5:01:03 PM2/28/16
to CadQuery, uich...@gmail.com
Hi Jeremy,
thank you so much.
I haven't yet any cad export of the trike because this trike doesn't exist yet, I have to design it studing its FEM multibody and cfd models! I can link similar trike like these http://aazzaa.de/home/index.php/galerie
However I know CAD requirements for my needs.

1. I saw only CadQuery examples working with planes XY, XZ and YZ but often I need to extrude a 2D geometry sketched on a different plane. Sometimes I need to extrude a sketch on plane XY along a curve or line in space. Extrusion are very important specially in direction and orientation.

2. I found CadQuery because I saw openscad and I think the scripting is a perfect approach to CAD for my needs. I know the difference between openscad and CadQuery and I need CadQuery and step files. But in openscad I saw examples with a 'for loop' to parametrize position and number of extrusions: is it possible?

Now I'd like help this project because I think it is a great project. 

For assembly and animation I will use other pre/post software, I'd like use CadQuery to generate parametric geometry.

regards
Igor 

Jeremy Wright

unread,
Feb 28, 2016, 7:09:28 PM2/28/16
to Igor Messina, CadQuery

> Sometimes I need to extrude a sketch on plane XY along a curve or line in space. Extrusion are very important specially in direction and orientation.

Sweeping (extruding along a path) is something that's been on my To Do list for over a year. It hasn't been implemented yet though, but is within reach with probably about 10 hours of development time.

> But in openscad I saw examples with a 'for loop' to parametrize position and number of extrusions: is it possible?

Since CadQuery is built on Python, you can use Python loops. CadQuery objects also make an each function available in certain situations. I know that @dcowden and @huskier have been having some issues with multiple extrusions on some situations lately though. https://github.com/dcowden/cadquery/issues/130

Also be aware that drawing complex 2D sketches so that you can extrude them is not one of CadQuery's strengths. It seems like you might need to do that some on your trike. If so, you'd want to make sure there's a way to do the sketching you need without too much pain.

Dave Cowden

unread,
Feb 28, 2016, 7:13:42 PM2/28/16
to Jeremy Wright, Igor Messina, CadQuery
yeah one feature that OpenSCAD has that CQ lacks is ability to import a DXF file as a 2d image. That'd be a very powerful addition to CQ. Its not really that hard at all-- its just that nobody has done it.

OpenSCAD can also do text-- another thing CQ cannot do. (yet)

Igor Messina

unread,
Mar 1, 2016, 10:43:05 AM3/1/16
to CadQuery, wrig...@gmail.com, uich...@gmail.com
Thanks guys!

I think I don't need very complex 2d sketches, in particular for the multibodiy analysis, but sure I need a complete 'extruding tool' like in OpenScad.
I think that with an 'extruding tool' like in OpenScad, CQ it could be perfect for me!

Of course, with the ability to import a DXF it wil be amazing!
I don't know if you can be interested to my opinion, but I think CQ could be a perfect 3d modeler for a pre-processing in multibody analisys with a software like MBDyn.
MBDyn is a powerful software developed by my teacher.
If it coul be interesting for you, we can talk about, because in my thesis I'll work sure with MBDyn.

regards
Igor 

Dave Cowden

unread,
Mar 1, 2016, 10:57:04 AM3/1/16
to Igor Messina, CadQuery, Jeremy Wright
CQ has extrude-- we just need a function that will read a DXF and convert it to a set of wires. that's not really all that hard.

We'd love to accept a pull request  it if you'd be willing to take a crack at authoring it...

perhaps we could use a python dxf reading package, like this:


and then you'd just need to convert dxf entities into these CQ functions:
   3pt arc, line, circle, etc

if you got a basic set of code working, i coudl help you write it so that it could fit into the CQ chain. I'd envision it working liek this:

r = cq.Workplane('XY').dxf('/path/to/whatever.dxf').extrude(2.0)



Jeremy Wright

unread,
Mar 1, 2016, 11:07:29 AM3/1/16
to Dave Cowden, Igor Messina, CadQuery
@Dave - I think that Igor needs a sweep operation though, which we don't have yet (correct me if I've missed it). We have an outstanding issue for it here: https://github.com/dcowden/cadquery/issues/33
It's pretty well planned out, it's just the execution that needs to happen.

@Igor - Could you take a look down through the issue I linked and let me know if that's what you need for extrusion along a path? We've needed that for a long time, and it's already planned out, so if you need that to be able to use CadQuery for your thesis, I'll try to fit it in ASAP.


Dave Cowden

unread,
Mar 1, 2016, 11:37:46 AM3/1/16
to Jeremy Wright, Igor Messina, CadQuery
oh ok thanks- we need extrude along a path, not just extrude perpendicular to plane. got it.

Igor Messina

unread,
Mar 5, 2016, 3:13:01 PM3/5/16
to CadQuery, wrig...@gmail.com, uich...@gmail.com
Hi guys!

@Dave: I got a very basic and scholastic experience with C, nothing special and without graphic library! I don't know if it's enough, but if you think yes, we could try! Maybe at first I have to learn to use CadQuery well, because I only try to replicate some examples. 

@Jeremy: Yes, it is what I need, even if I don't read about the possibility of scaling the section that you will extrude along the curve. I don't know if this is simple or complicated, but for example, truncated cone or pyramid or frustum, are very important in my experience.

regards 
Igor

jmwright

unread,
Apr 4, 2016, 9:32:06 PM4/4/16
to CadQuery, wrig...@gmail.com, uich...@gmail.com
I've started to experiment with creating a sweep operation: https://github.com/dcowden/cadquery/issues/33#issuecomment-205580789

Coming up with some mechanism that will allow us to set a wall thickness is the current challenge.

Dave Cowden

unread,
Apr 5, 2016, 6:49:07 AM4/5/16
to Jeremy Wright, Igor Messina, CadQuery

Since you got a solid to work, one way to create a thin wall might be to use makeShell and remove the two end faces.

That might succeed in more cases than the alternative, which would be to first offset the sweep wire inwards to create another wire before sweeping

jmwright

unread,
Apr 21, 2016, 11:20:50 PM4/21/16
to CadQuery, wrig...@gmail.com, uich...@gmail.com
> Since you got a solid to work, one way to create a thin wall might be to use makeShell and remove the two end faces

I'm not sure how to reliably detect which are the end faces, and makeShell doesn't allow the user to select any sort of wall thickness. It seems like we're stuck with offsetting the wire inwards and removing that sweep. Am I missing something?

Dave Cowden

unread,
Apr 22, 2016, 7:08:36 AM4/22/16
to jmwright, CadQuery, Igor Messina
​the cadquery shell method does allow a thickness:

def shell(self, thickness):
"""
Remove the selected faces to create a shell of the specified thickness.

If the beginning and end faces are planar and parallel to a given plane, you could use a || selector to remove them​.  For example, i dont know if this works or not:

r = cq.Workplane("XY").rect(2.0,2.0).extrude(4.0).faces("||Z").shell(0.1)

I _think_ this should create a shelled object...

On Thu, Apr 21, 2016 at 11:20 PM, jmwright <wrig...@gmail.com> wrote:
> Since you got a solid to work, one way to create a thin wall might be to use makeShell and remove the two end faces

I'm not sure how to reliably detect which are the end faces, and makeShell doesn't allow the user to select any sort of wall thickness. It seems like we're stuck with offsetting the wire inwards and removing that sweep. Am I missing something?

--
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,
Apr 22, 2016, 8:34:12 AM4/22/16
to Dave Cowden, CadQuery, Igor Messina
A couple of observations:
1. The shell operation shells outwards before removing the face. This changes the effective diameter of the swept circle.
2. The shell works fine until you get multiple faces in different planes involved.


If I try to remove the face parallel to the Y axis (that's the remaining face), FreeCAD/OCC throws an error about the operation. My guess is that we're trying to do a shell operation to remove 1 face of an object that's already been shelled from another face. That doesn't sound like something the CAD kernel would handle very well.

I'm wondering if we need to leave it up to the user to shell the sweep. It's more CQ-like to handle the shelling for the user, but in this case I don't think we can do it reliably. In a situation like the arc sweep, I'd just have to manually punch a hole in the remaining face to get the resulting solid to look right. What I'd probably end up doing in practice is creating an inner sweep and cutting it out of the outer sweep.

Thoughts?

Jeremy Wright

unread,
Apr 25, 2016, 10:48:19 PM4/25/16
to Dave Cowden, CadQuery, Igor Messina
@Igor, if you're still interested in this I have a somewhat working sweep operation on a branch that you can try out. If you are interested, I can send you a custom zip file of the CadQuery module for FreeCAD that you can try out.

Igor Messina

unread,
Apr 26, 2016, 4:54:31 PM4/26/16
to CadQuery, dave....@gmail.com, uich...@gmail.com
Hi guys!

@Jeremy I've just finished my first step of thesis and I used simply FreeCAD! But I'm curious...

Jeremy Wright

unread,
Apr 26, 2016, 9:51:22 PM4/26/16
to Igor Messina, CadQuery, Dave Cowden
@Igor - If you download the zip of the latest commit of the CadQuery module for FreeCAD, you'll be able to do sweeping. There are examples of how to do things in the tests and the original issue.


Let me know if you have any questions/comments.

Reply all
Reply to author
Forward
0 new messages