本文主要是介绍luceda ipkiss教程 58:输出器件的版图和三维模型,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在ipkiss中,通过visualize_3d_povray可以输出包含器件的三维模型参数的.pov文件,再通过POV-Ray(免费软件,下载地址:https://www.povray.org/download/)就可以查看器件的三维模型。
如:
代码如下:
from si_fab import all as pdk
from ipkiss3 import all as i3
import numba as nb
import numpy as np
from matplotlib import pyplot as plt# Building the MMI PCell with properties that describe its geometry
class MMI1x2(i3.PCell):"""MMI with 1 input and 2 outputs."""_name_prefix = "MMI1x2"trace_template = i3.TraceTemplateProperty(doc="Trace template of the access waveguide")width = i3.PositiveNumberProperty(default=4.0, doc="Width of the MMI section.")length = i3.PositiveNumberProperty(default=20.0, doc="Length of the MMI secion.")taper_width = i3.PositiveNumberProperty(default=1.0, doc="Width of the taper.")taper_length = i3.PositiveNumberProperty(default=5.0, doc="Length of the taper")waveguide_spacing = i3.PositiveNumberProperty(default=2.0, doc="Spacing between the waveguides.")def _default_trace_template(self):return pdk.SiWireWaveguideTemplate()class Layout(i3.LayoutView):def _generate_elements(self, elems):length = self.lengthwidth = self.widthtaper_length = self.taper_lengthtaper_width = self.taper_widthhalf_waveguide_spacing = 0.5 * self.waveguide_spacingcore_layer = self.trace_template.core_layercladding_layer = self.trace_template.cladding_layercore_width = self.trace_template.core_width# Si coreelems += i3.Rectangle(layer=core_layer,center=(0.5 * length, 0.0),box_size=(length, width),)elems += i3.Wedge(layer=core_layer,begin_coord=(-taper_length, 0.0),end_coord=(0.0, 0.0),begin_width=core_width,end_width=taper_width,)elems += i3.Wedge(layer=core_layer,begin_coord=(length, half_waveguide_spacing),end_coord=(length + taper_length, half_waveguide_spacing),begin_width=taper_width,end_width=core_width,)elems += i3.Wedge(layer=core_layer,begin_coord=(length, -half_waveguide_spacing),end_coord=(length + taper_length, -half_waveguide_spacing),begin_width=taper_width,end_width=core_width,)# Claddingelems += i3.Rectangle(layer=cladding_layer,center=(0.5 * length, 0.0),box_size=(length + 2 * taper_length, width + 2.0),)return elemsdef _generate_ports(self, ports):length = self.lengthtaper_length = self.taper_lengthtrace_template = self.trace_templatehalf_waveguide_spacing = 0.5 * self.waveguide_spacingports += i3.OpticalPort(name="in1",position=(-taper_length, 0.0),angle=180.0,trace_template=trace_template,)ports += i3.OpticalPort(name="out1",position=(length + taper_length, -half_waveguide_spacing),angle=0.0,trace_template=trace_template,)ports += i3.OpticalPort(name="out2",position=(length + taper_length, half_waveguide_spacing),angle=0.0,trace_template=trace_template,)return portsclass Netlist(i3.NetlistFromLayout):passif __name__ == '__main__':MMI1x2().Layout().write_gdsii("mmi.gds")MMI1x2().Layout().visualize_3d_povray(camera_pos=(30,30,20))
camera_pos的参数可以在POV-Ray中调整:
这篇关于luceda ipkiss教程 58:输出器件的版图和三维模型的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!