Boolean Operations¶
Notebook
This page was generated from boolean_operations.ipynb. Download it to run the examples yourself.
Boolean operations in ada-py can be applied to any physical object or to any part in the assembly (including the top-level Assembly object). Any boolean applied to a part will automatically be applied to its children. Any primitive can be used as a boolean.
Use the add_boolean method (which is available on all physical objects and Part objects) to add any primitive as a boolean.
cyl = ada.PrimCyl('cyl', (0,0,0), (0,0,1), 0.2)
pl = ada.Plate('pl', [(0,0), (1,0), (1,1), (0,1)], 0.01, origin=(-0.5,-0.5,0), normal=(0, 0, 1), xdir=(1, 0, 0))
pl.add_boolean(cyl)
pl.show()
When applying a boolean to a Part, it will automatically apply it to all objects recursively underneath the given Part level.