Open MarcWeber opened 2 months ago
There's a cq plugin for local selectors: https://github.com/CadQuery/cadquery-plugins/tree/main/plugins/localselectors I haven't used it, so I don't know how good it is, but maybe it works for your use case
The plane normal can be accessed with <the workplane>.plane.zDir
. You might also try one of the Direction*
selectors as another solution.
import cadquery as cq
cyl = cq.Workplane("ZX").cylinder(20, 5)
cyl = cyl.faces(cq.selectors.DirectionNthSelector(cyl.plane.zDir, 0))
# cyl = cyl.faces(cq.selectors.DirectionMinMaxSelector(-cyl.plane.zDir))
If you change degree to > 90 the hole in the middle is closed. So it would be nice if >Z would be relative to workplane Z direction not global Z direction or if z (lower case or such) would have this different behavior to not break code. or >wz (w meaning workplane) or whatever. The waterfall implementation basically is the same but allowing pyright to type the abstraction which it can't if you extend workplane