tidy3d.ClipOperation#
- class ClipOperation[source]#
Bases:
GeometryClass representing the result of a set operation between geometries.
- Parameters:
operation (Literal['union', 'intersection', 'difference', 'symmetric_difference']) – Operation to be performed between geometries.
geometry_a (Union[
Box,Transformed,ClipOperation,GeometryGroup,GeometryArray,Sphere,Cylinder,PolySlab,ComplexPolySlabBase,TriangleMesh]) – First operand for the set operation. It can be any geometry type, includingGeometryGroup.geometry_b (Union[
Box,Transformed,ClipOperation,GeometryGroup,GeometryArray,Sphere,Cylinder,PolySlab,ComplexPolySlabBase,TriangleMesh]) – Second operand for the set operation. It can also be any geometry type.
Attributes
Returns bounding box min and max coordinates.
Methods
inside(x, y, z)For input arrays
x,y,zof arbitrary but identical shape, return an array with the same shape which isTruefor every point in zip(x, y, z) that is inside the volume of theGeometry, andFalseotherwise.inside_meshgrid(x, y, z)Faster way to check
self.insideon a meshgrid.intersections_plane([x, y, z, cleanup, ...])Returns list of shapely geometries at plane specified by one non-None value of x,y,z.
intersections_tilted_plane(normal, origin, to_2D)Return a list of shapely geometries at the plane specified by normal and origin.
to_polygon_list(base_geometry[, cleanup])Return a list of valid polygons from a shapely geometry, discarding points, lines, and empty polygons, and empty triangles within polygons.
- operation#
- geometry_a#
- geometry_b#
- static to_polygon_list(base_geometry, cleanup=False)[source]#
Return a list of valid polygons from a shapely geometry, discarding points, lines, and empty polygons, and empty triangles within polygons.
- Parameters:
base_geometry (shapely.geometry.base.BaseGeometry) – Base geometry for inspection.
cleanup (bool = False) – If True, removes extremely small features from each polygon’s boundary. This is useful for removing artifacts from 2D plots displayed to the user.
- Returns:
Valid polygons retrieved from
base geometry.- Return type:
list[shapely.geometry.base.BaseGeometry]
- intersections_tilted_plane(normal, origin, to_2D, cleanup=True, quad_segs=None)[source]#
Return a list of shapely geometries at the plane specified by normal and origin.
- Parameters:
normal (Coordinate) – Vector defining the normal direction to the plane.
origin (Coordinate) – Vector defining the plane origin.
to_2D (MatrixReal4x4) – Transformation matrix to apply to resulting shapes.
cleanup (bool = True) – If True, removes extremely small features from each polygon’s boundary.
quad_segs (Optional[int] = None) – Number of segments used to discretize circular shapes. If
None, uses high-quality visualization settings.
- Returns:
List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentation.
- Return type:
list[shapely.geometry.base.BaseGeometry]
- intersections_plane(x=None, y=None, z=None, cleanup=True, quad_segs=None)[source]#
Returns list of shapely geometries at plane specified by one non-None value of x,y,z.
- Parameters:
x (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
y (float = None) – Position of plane in y direction, only one of x,y,z can be specified to define plane.
z (float = None) – Position of plane in z direction, only one of x,y,z can be specified to define plane.
cleanup (bool = True) – If True, removes extremely small features from each polygon’s boundary.
quad_segs (Optional[int] = None) – Number of segments used to discretize circular shapes. If
None, uses high-quality visualization settings.
- Returns:
List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentaton.
- Return type:
list[shapely.geometry.base.BaseGeometry]
- property bounds#
Returns bounding box min and max coordinates.
- inside(x, y, z)[source]#
For input arrays
x,y,zof arbitrary but identical shape, return an array with the same shape which isTruefor every point in zip(x, y, z) that is inside the volume of theGeometry, andFalseotherwise.