ConstructiveSolid¶
- class photonforge.ConstructiveSolid(operand1, operand2, operation, medium=None)¶
Constructive geometry based on combinations of solids.
- Parameters:
operand1 (Extruded | Polyhedron | ConstructiveSolid | Iterable[Extruded | Polyhedron | ConstructiveSolid]) – First operand for this solid operation. The union is used in case of multiple objects.
operand2 (Extruded | Polyhedron | ConstructiveSolid | Iterable[Extruded | Polyhedron | ConstructiveSolid]) – Second operand for this solid operation. The union is used in case of multiple objects.
operation (Literal["+", "*", "-", "^"]) – One of “+” (union), “*” (intersection), “-” (difference), or “^” (symmetric difference).
medium (MediumType) – Tidy3D medium used in this structure. If unset, the medium from the first operand will be used.
Note
Solid structures can also be combined directly using the same operators in expressions.
Example
>>> medium = tidy3d.Medium(permittivity=2.0) >>> block = Extruded(medium, Rectangle((0, 0), (10, 8)), (0, 2)) >>> cylinder = Extruded(medium, Circle(4.5), (1, 2)) >>> solid = block - cylinder
Methods
copy
([deep])Create a copy of this 3D structure.
Create a Tidy3D structure from this 3D structure.
Attributes
ConstructiveSolid solid medium.
First operand for this solid.
Second operand for this solid.
Constructive solid operation.
Object properties.
- copy(deep=False)¶
Create a copy of this 3D structure.
- Parameters:
deep – If set, creates copies of any internal structures. Otherwise,
created. (a shallow copy of this solid is)
- Returns:
New copy.
- Return type:
- medium¶
ConstructiveSolid solid medium.
- Type:
MediumType
- operand1¶
First operand for this solid.
- Type:
list[Extruded | Polyhedron | ConstructiveSolid]
- operand2¶
Second operand for this solid.
- Type:
list[Extruded | Polyhedron | ConstructiveSolid]
- operation¶
Constructive solid operation.
- Type:
Literal[“+”, “*”, “-”, “^”]
- properties¶
Object properties.
- Type:
- to_tidy3d()¶
Create a Tidy3D structure from this 3D structure.
- Returns:
Tidy3D structure.
- Return type:
tidy3d.Structure