Subtract Regions


I want to to create a region that is the difference of two regions (boolean “A” AND NOT “B”). I’m aware that the “canonical way” would be something like:

region outer {shape} side in
region inner {shape} side out
region final intersect 2 outer inner

However, my inner region is complex union geometry already created with “side in” for a previous step and I would like to re-use that definition instead of having to redefine it all with flipped sides.

Is there an easier/shorter way to achieve that?


I am not aware of one.

How about putting your complex region definition into a separate file and use variables for in/out and region name?
Then you can define the variables to what you need and read the file with include.
Then delete and redefine the variables and include the same file again.

That’s actually a great idea. Turns out I have to create a different set of regions anyway, since a (sub-)region with open sides cannot be flipped for the purposes of “create_box region …” Doing that with a single script and a few options works well.

Thanks again,