cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

workplane() should allow from tag as parameter, providing enhanced workplaneFromTagged() functionality

Open Telescopic-5 opened this issue 3 years ago • 1 comments

workplane() should be enhanced to include an optional from parameter which would specify a tagged workplane be used rather than the TOS face. workplane() functionality, including offset, would be able to be applied to copies of tagged workplanes. workplaneFromTagged() should be deprecated.

    .workplane(from="sometag", ...and all the other options...)

Example: A workplane is tagged.

    .faces(">Z").workplane().tag("the_tag")

Later you have a need to offset another workplane from that one, but you can't refer to the tagged plane, instead you have to duplicate the selection. That's a possible source of error and also doesn't say "now I'll make a plane offset from this other one".

    .faces(">Z").workplane(offset=-some_offset)

Wouldn't this be clearer?

    .workplane(name="the_tag", offset=-some_offset)

I have looked at the code, but I don't claim to fully understand possible risks of this enhancement.

Telescopic-5 avatar Jun 29 '22 21:06 Telescopic-5

I would like this too, but it can easily be done by workplaneFromTagged("the_tag").workplane(offset=-some_offset) a single method would be friendly though.

geiseri avatar Sep 21 '22 02:09 geiseri