ConstructiveSolid

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

Constructive geometry based on combinations of solids.

Parameters:
  • operand1 – First operand for this solid operation. Must be a 3D structure or an iterable of structures. The union of all solid is used in case of a sequence.

  • operand2 – First operand for this solid operation. Must be a 3D structure or an iterable of structures. The union of all solid is used in case of a sequence.

  • operation – One of "+" (union), "*" (intersection), "-" (difference), or "^" (symmetric difference).

  • medium – 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.

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.

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.

medium

ConstructiveSolid solid medium.

operand1

First operand for this solid.

operand2

Second operand for this solid.

operation

Constructive solid operation.

to_tidy3d()

Create a Tidy3D structure from this 3D structure.

Returns:

Tidy3D structure.