Hi !
This is my first post there. I've
played with cadquery a bit, as I'm doing some simple modeling in FreeCAD
and OpenSCAD. The first is buggy and unstable for me. The second is
fine for 80% of the models I need, but gets messy when doing complex
things. I've been very happy with cadquery so far, but I've found some
peculiar behaviors. I'm not sure if those are bugs or me not
understanding the inner workings of this tool. So... I'll start with the
first issue.
I've been trying to make a box
with shell and chamfer. When combined they behave "wierd" when selecting
faces. let me explain on some examples:
x1 = cq.Workplane('XY').box(15, 15, 15)
x1 = x1.edges("|Z").chamfer(1)
x1 = x1.faces(">X").sphere(1)
x1.val().exportStl("./test1.stl")
x2 = cq.Workplane('XY').box(15, 15, 15)
x2 = x2.faces(">Z").shell(3, kind='intersection')
x2 = x2.faces(">X").sphere(1)
x2.val().exportStl("./test2.stl")
I'm
using chamfer and shell separately. As you can see the sphere is placed
on the X most face as expected. So far so good. Now lets combine the
two.
x3 = cq.Workplane('XY').box(15, 15, 15)
x3 = x3.faces(">Z").shell(3, kind='intersection')
x3 = x3.edges("|Z").chamfer(1)
x3.val().exportStl("./test3.stl")
x4 = cq.Workplane('XY').box(15, 15, 15)
x4 = x4.edges("|Z").chamfer(1)
x4 = x4.faces(">Z").shell(3, kind='intersection')
x4.val().exportStl("./test4.stl")
There
are two ways of doing so: shell-then-chamfer (x3) or chamfer-then-shell
(x4). The shapes produced are similar but a bit different in geometry.
No surprises here. But lets now add a sphere on these shapes, creating
x5 and x6 respectively.
x5 = cq.Workplane('XY').box(15, 15, 15)
x5 = x5.faces(">Z").shell(3, kind='intersection')
x5 = x5.edges("|Z").chamfer(1)
x5 = x5.faces(">X").sphere(1)
x5.val().exportStl("./test5.stl")
x6 = cq.Workplane('XY').box(15, 15, 15)
x6 = x6.edges("|Z").chamfer(1)
x6 = x6.faces(">Z").shell(3, kind='intersection')
x6 = x6.faces(">X").sphere(1)
x6.val().exportStl("./test6.stl")
For
me, x6 looks as expected, but x5 produces... just the sphere. The box
is gone. I don't know if this is some quirk of cadquery or a bug, but it
this left me very confused. The x5 STL is also over twice as large as
x1, x2, x6 (x4 and x5 have just straight lines so they're tiny).
I'd love to hear form you.
Thank you,
Wojciech