ConstructiveSolid

class photonforge.ConstructiveSolid(operand1, operand2, operation, medium=None)

Constructive geometry based on combinations of solids.

Parameters:

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.

to_tidy3d()

Create a Tidy3D structure from this 3D structure.

Attributes

medium

ConstructiveSolid solid medium.

operand1

First operand for this solid.

operand2

Second operand for this solid.

operation

Constructive solid operation.

properties

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:

ConstructiveSolid

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:

Properties

to_tidy3d()

Create a Tidy3D structure from this 3D structure.

Returns:

Tidy3D structure.

Return type:

tidy3d.Structure