ipkiss3.all.device_sim.SimulationGeometry

class ipkiss3.all.device_sim.SimulationGeometry

Defines the geometry of the electromagnetic simulation.

Parameters:
layout: required

LayoutView of the component to simulate

waveguide_growth: float and Real, number and number >= 0, optional

Distance to grow the waveguides at their unconnected ports.

bounding_box: optional

Bounding box of the simulation. Default is [None, None, None]. [None, None, (-2.0, 10.0)] means to derive x and y span from the component, but use (-2.0, 10.0) in the z-direction (out-of-plane).

layers: optional

List of layers that need to be virtually fabricated. By default all layers used in the layout are virtually fabricated. Setting this overrides the behavior of ‘excluded_layers’

excluded_layers: optional

List of layers that need to be excluded. Default is not to exclude any layer.

process_flow: optional

The process flow used for virtual fabrication. By default use TECH.VFABRICATION.PROCESS_FLOW. Can be changed to customize the process flow, in order to simulate various changes to the process.

Examples

import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

class LucedaPhotonicsText(i3.PCell):
    class Layout(i3.LayoutView):
        def _generate_elements(self, elems):
            elems += i3.PolygonText(
                layer=i3.TECH.PPLAYER.SI,
                coordinate=(0.0, 15.0),
                text="Luceda Photonics",
                alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.BOTTOM),
                font=i3.TEXT.FONT.DEFAULT,
                height=8,
            ).elements
            return elems

luceda = LucedaPhotonicsText()
layout = luceda.Layout()
layout.visualize_2d()

sim_geom = i3.device_sim.SimulationGeometry(layout=layout)

# Write the geometry to an OBJ and MTL file:
sim_geom.write_obj(filename="luceda.obj")

# Write the geometry to multiple STL files into a 'luceda' folder with the "luceda" prefix,
# one STL file per material:
sim_geom.write_stl(folder_name="luceda", prefix="luceda")

# Write the geometry to multiple STL files into a 'luceda_prisms' folder, one STL file per Prism:
sim_geom.write_stl(folder_name="luceda_prisms", only_prisms=True)
../../../../_images/ipkiss3-all-device_sim-SimulationGeometry-1.png
write_obj(filename, unit=None, opaque=False)

Writes a simulation geometry to a Wavefront OBJ and an MTL file.

Parameters:
filename: str

Name of the file. Needs to end with “.obj”, the MTL file will have the same name except with “.mtl”

unit: positive number

The User units to be used in the OBJ file. By default, the value is extracted from TECH.METRICS.UNIT.

opaque: bool = False

If True, will make every material opaque. Default is False.

write_stl(folder_name, prefix='', unit=None, only_prisms=False)

Writes a simulation geometry to STL files, one file for each material in the geometry. When ‘only_prisms’ is True, it will write the individual prisms to STL files instead.

Parameters:
folder_name: string

the name of the folder where the STLs will be written to.

prefix: string

the prefix of names of the STL files. By default, they will have no prefix.

unit: positive number

The User units to be used in the STL file. By default, the value is extracted from TECH.METRICS.UNIT.

only_prisms: bool = False

When only_prisms is True, each Prism in the simulation geometry is individually written to an STL file. Default is False.