1536 suggests a Workplane.when() or similar conditionals such as unless and ifte.
from fn import _
cq.Workplane.when = lambda self, cond, f: cond and f(self) or self
cq.Workplane().box(5,5,5).when(True, _.faces(">Y").workplane().hole(1)) # pretty but `_` needs fixing
cq.Workplane().box(5,5,5).when(True, lambda c: c.faces(">Y").workplane().hole(1)) # longer but it works
fn.py's doesn't deal with methods the same way it deals with other attributes. I'm not sure if it can be fixed. Would an `` that records/evaluates only the methods defined in cq might be worth doing?
1536 suggests a
Workplane.when()
or similar conditionals such asunless
andifte
.fn.py's doesn't deal with methods the same way it deals with other attributes. I'm not sure if it can be fixed. Would an `` that records/evaluates only the methods defined in cq might be worth doing?