How do I use clip operations?

How do I use clip operations?#



2023-12-06 22:49:17


You can use the tidy3d.ClipOperation object to combine multiple geometries through ‘union’, ‘intersection’, ‘difference’, and ‘symmetric_difference’ operations. Simply define the geometry_a and the geometry_b and assign them to the clip object. For example:

box = tidy3d.Box(center=(0,0,0), size=(1, 1, 2))
cyl = tidy3d.Cylinder(center=(1,0,0), radius=0.5, length=2, axis=2)

union = tidy3d.ClipOperation(
  operation='union', geometry_a=box, geometry_b=cyl

intersection = tidy3d.ClipOperation(
  operation='intersection', geometry_a=box, geometry_b=cyl

difference = tidy3d.ClipOperation(
  operation='difference', geometry_a=box, geometry_b=cyl

symmetric_difference = tidy3d.ClipOperation(
  operation='symmetric_difference', geometry_a=box, geometry_b=cyl