ExtrusionSpec¶
- class photonforge.ExtrusionSpec(mask_spec, medium, limits, sidewall_angle=0, reference='top')¶
Extrusion specification for masks.
This class is mainly used to create extrusion recipes for a
Technology
.- Parameters:
mask_spec (MaskSpec) – Mask specification for this extrusion.
medium (MediumType | dict[Literal["optical", "electrical"], MediumType]) – Tidy3D medium for the resulting structures. Different media can be used for optical and electrical frequencies by using a dictionary (see note below).
limits (Sequence[float]) – Out-of-plane extrusion limits.
sidewall_angle (float) – Sidewall angle for extrusion (in degrees). Positive values will dilate the bottom face or erode the top face, according to the reference position.
reference (Literal["top", "bottom", "middle"] | float) – Reference position for computing dilations and erosions when using a sidewall angle.
Example
>>> extrusion_spec = ExtrusionSpec( ... MaskSpec((1, 0)), ... td.Medium(permittivity=3.48**2), ... limits=(0, 0.250), ... sidewall_angle=8, ... )
Note
The medium used for simulations in optical and electrical frequency ranges (see
frequency_classification()
) can be set individually with:>>> media = { ... "optical": td.Medium(permittivity=3.48**2), ... "electrical": td.Medium(permittivity=12.3), ... } >>> extrusion_spec = ExtrusionSpec( ... MaskSpec((1, 0)), ... medium=media, ... limits=(0, 0.250), ... sidewall_angle=8, ... )
Methods
copy
([deep])Create a copy of this extrusion specification.
extrude
(*structures[, extrusion_tolerance, ...])Extrude planar structures according to this extrusion specification.
from_json
(json_str)Import object data from json.
get_medium
(classification)Return electrical or optical medium for this extrusion specification.
Attributes
(DEPRECATED) Json representation of this layer specification.
Extrusion limits.
Extrusion mask specification.
Extrusion medium.
Object properties.
Extrusion reference position.
Extrusion sidewall_angle (in degrees).
- copy(deep=False)¶
Create a copy of this extrusion specification.
- Parameters:
deep (bool) – If set, creates a copy of mask specification as well. Otherwise, the same mask specification object will be used.
- Returns:
New copy.
- Return type:
- extrude(*structures, extrusion_tolerance=0, classification='optical')¶
Extrude planar structures according to this extrusion specification.
- Parameters:
*structures (Rectangle | Circle | Polygon | Path) – Structures to be extruded.
extrusion_tolerance (float) – Minimal dimension to search for topological changes in angled extrusions or fallback to an orthogonal profile. A value of 0 or less defaults to
config.tolerance
.classsification (Literal["optical", "electrical"]) – Frequency classification indicating which type of medium to use.
- Returns:
List of 3D structures.
- Return type:
list[Polyhedron | Extruded | ConstructiveSolid]
Note
The mask specification in this object is not taken into account. All structures are used in the extrusion and no dilation is applied.
- static from_json(json_str)¶
Import object data from json.
Warning
This method is DEPRECATED and will be removed in the next release.
- Parameters:
json_str (str) – String containing the json data.
- Returns:
PhotonForge object.
- Return type:
Any
- get_medium(classification)¶
Return electrical or optical medium for this extrusion specification.
- Parameters:
classification (Literal["optical", "electrical"]) – Frequency classification of the desired medium.
- Returns:
Medium for the chosen classification.
- Return type:
MediumType
See also
- json¶
(DEPRECATED) Json representation of this layer specification.
- Type:
str
- limits¶
Extrusion limits.
- Type:
ndarray
- medium¶
Extrusion medium.
- Type:
MediumType | dict[Literal[‘optical’, ‘electrical’], MediumType]
- properties¶
Object properties.
- Type:
- reference¶
Extrusion reference position.
- Type:
Literal[‘top’, ‘bottom’, ‘middle’] | float
- sidewall_angle¶
Extrusion sidewall_angle (in degrees).
- Type:
float