Ansys Learning Forum Forums Discuss Simulation Photonics Trapezoidal ring Reply To: Trapezoidal ring

rahul.sanghvi
Subscriber

Hi Kirill, 

Do you know how to modify the code for 90-degree bend waveguide such that it creates a waveguide of an arbitrary angle instead of 90 deg? 

#####################################################################

# 90 degree waveguide bend

# This object makes a 90-degree waveguide bend with angled sidewalls.

#

# Input properties

# base angle: sidewall angle of the waveguide

# base height: height of the waveguide

# base width: width of the waveguide base

# radius: radius of the bend

# start angle: start angle of the waveguide

#

# Tags: integrated optics waveguide bend 90 degrees ridge

#

# Copyright 2015 Lumerical Solutions Inc

#####################################################################

 

# simplify variable names by removing spaces

base_angle = %base angle%;

base_width = %base width%;

base_height = %base height%;

start_angle = %start angle%;

 

select("arc");

set("material",material);

set("base angle",base_angle);

set("base height",base_height);

set("base width",base_width);

set("detail",0.5);

 

# magic number

# The cubic Bezier curve using this magic number in the pole points approximates the semi-circile with least error

m=0.55191502449;

 

px = radius*[0;m;1;1];

py = radius*[1;1;m;0];

p = [px,py];

 

set("poles",p);

set("first axis",'z');

set("rotation 1",start_angle);