Using the planar solid structure, it is very easy to create complex geometries like a truncated cone using the script environment. The planar solid object is a very powerful tool to create arbitrary geometries. Lumerical’s knowledge base has documented the properties of this object in this page Structures - planar solid. The vertices of the planar solid object can be edited using script commands by two method, (i) specifying the vertices as a cell array or (ii) specifying the vertices as a matrix. Detailed examples of both approaches are documented in the same page.
Here, the script file is shared that can be used to create a truncated cone in Lumerical finite element environment (e.g. CHARGE). The curved surface of the cone is broken up in multiple rectangular segments (see figure below). This helps us identify all the vertices needed to create the surfaces (top and bottom surfaces and the rectangular faces on the curved surface). The script takes the radius (in micron) of the top and bottom surfaces and the height of the cone as input parameters. It also takes the number of segments as an input. The larger the number of segments, the smoother the curved surface will become. The script can also be used to create a cone (not truncated). To do that, simply choose one of the radius values to be very small (say, 1e-3 micron or less).