CST_Constructor Module

class CST_Constructor.CST_Constructor.CST_Commands[source]

Bases: object

AddGlobalParameter(Parameters)[source]

Add Global parameters to the working enviroment

Parameters:

Parameters (dict) –

Dictionary with the name and value of the parameter.
For Example:

Parameters = {} Parameters[‘Length’] = 20 This will add Length = 20 to your CSt global enviroments.

Return type:

None.

BondWire(Parameters)[source]

Create a bondwire.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the bondwire.

Required keys:

  • Name Wire (str)

    Name of the bondwire.

  • Coordinates (dict of int or float)

    Dictionary with coordinates in the X, Y, Z plane to define the bondwire. Example:

    Points = {} Points[‘X1’] = 0 Points[‘Y1’] = 0 Points[‘Z1’] = 0 Points[‘X2’] = 5 Points[‘Y2’] = 5 Points[‘Z2’] = 0 parameters[“Coordinates”] = Points

  • Height (int or float)

    Height of the bondwire at the middle point.

  • Radius (int or float)

    Radius of the bondwire. The bondwire is a cylindrical object.

Optional keys:

  • Bondwire Type (str, default “Spline”)

    Type of bondwire. Options are: “Spline”, “JEDEC4”, “JEDEC5”.

  • Center Position (int or float, default 0.5)

    Center position of the height. Can be adjusted if the top height is not in the middle.

  • Alpha (int or float, optional)

    Required if using “JEDEC5”. See CST documentation. Defaults to None.

  • Beta (int or float, optional)

    Required if using “JEDEC5”. See CST documentation. Defaults to None.

  • Material (str, optional, default “PCE”)

    Material of the bondwire. Must be preloaded in the simulation.

  • SolidWireModel (bool, optional, default True)

    If True, bondwire will be modeled as a solid object.

  • Termination (str, optional)

    How the bondwire is terminated. Options: “natural”, “rounded”, “extended”. Defaults to None.

  • NameFolder (str, optional)

    Name of the folder to store the bondwire. Defaults to the wire name.

Raises:

ValueError – If any parameters are set incorrectly.

Return type:

None

Brick(Parameters)[source]

Create a Brick object.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the Brick object.

Required keys:

  • Brick Length Min (int or float)

    Minimum length of the brick. The brick is centered, so the value will be set to Length / 2.

  • Brick Length Max (int or float)

    Maximum length of the brick. Centered; value will be set to Length / 2.

  • Brick Width Min (int or float)

    Minimum width of the brick. Centered; value will be set to Width / 2.

  • Brick Width Max (int or float)

    Maximum width of the brick. Centered; value will be set to Width / 2.

  • Brick Height Min (int or float)

    Minimum height of the brick. Centered; value will be set to Height / 2.

  • Brick Height Max (int or float)

    Maximum height of the brick. Centered; value will be set to Height / 2.

  • Material (str)

    Material of the brick.

  • Brick Name (str)

    Name of the brick.

  • Component Name (str)

    Name of the component. The structure will be created as “Component Name:Brick Name”.

Return type:

None

ChangeSolverType(Parameters)[source]

Change Solver Type in CST.

Parameters:

parameters (dict) –

Dictionary containing solver settings.

Keys:

  • Type (str)

    Solver type. For example: parameters[‘Type’] = “Time”.

Return type:

None

ClearAllPicks()[source]

Clear all pciks

Return type:

None.

Conus(Parameters)[source]

Create a conus object in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the conus.

Required keys:

  • Conus Name (str)

    Name of the conus.

  • Component Name (str)

    Name of the conus component in the component tree.

  • Material (str)

    Material of the conus. Must be preloaded in the simulation.

  • Top Radius (int or float)

    Top radius of the conus.

  • Bottom Radius (int or float)

    Bottom radius of the conus.

  • Orientation Axis (str)

    Orientation axis of the conus. Can be “X”, “Y”, or “Z”. Depending on the axis, additional parameters are required:

    If `”X”` axis: - X min (int or float): X-min position. - X max (int or float): X-max position. - Y center (int or float): Y-center position. - Z center (int or float): Z-center position.

    If `”Y”` axis: - Y min (int or float): Y-min position. - Y max (int or float): Y-max position. - X center (int or float): X-center position. - Z center (int or float): Z-center position.

    If `”Z”` axis: - Z min (int or float): Z-min position. - Z max (int or float): Z-max position. - X center (int or float): X-center position. - Y center (int or float): Y-center position.

Return type:

None

CreateEfieldMonitor(Parameters)[source]

Set a monitor in the CST simulation.

Parameters:

parameters (dict) –

Dictionary containing monitor settings.

Keys:

  • Monitor Wavelength (float)

    Wavelength for the monitor. For this function, you must provide the exact value. For example, 1.55 μm is parameters[“Monitor Wavelength”] = 1.55e-6.

  • Monitor Frequency (float)

    Frequency for the monitor.

  • Domain (str)

    Domain of the monitor. Can be “Frequency” or “Wavelength”.

  • Monitor Type (str)

    Type of monitor. Can be one of: “Efield”, “Hfield”, “Surfacecurrent”, “Powerflow”, “Current”, “Powerloss”, “Eenergy”, “Elossdens”, “Lossdens”, “Henergy”, “Farfield”, “Fieldsource”, “Spacecharge”, “ParticleCurrentDensity”, “Electrondensity”.

Raises:

ValueError – If any of the parameters are invalid or missing.

Return type:

None

Curve(Parameters)[source]

Create a 2D curve in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the 2D curve.

Required keys:

  • Curve Name (str)

    Name of the curve.

  • Points (dict)

    Dictionary containing the curve points.

    Example usage:

    ```python from CST_Constructor import Curves

    # Define curve parameters length = 100 offset = 40 points = 100

    # Generate the Bezier and Cosine points obj_curves = Curves(length, offset, points) cosinus_curve = obj_curves.Cosinus_Curve()

    parameters[“Points”] = cosinus_curve ```

Return type:

None

CurveToSolid(Parameters)[source]

Convert a curve into a solid object in CST.

Parameters:

parameters (dict) –

Dictionary containing all required and optional settings for the solid object.

Required keys:

  • Name (str)

    Name of the solid object.

  • Component Name (str)

    Name of the component in the component tree.

  • Material (str)

    Material of the solid object. Must be preloaded in the simulation.

  • Thickness (int or float)

    Thickness of the solid curve.

  • Angle (int or float)

    Rotation Angle of the solid curve.

  • Curve Folder (str)

    Name of the folder containing the source curve. The curve must be created beforehand.

  • Curve Name (str)

    Name of the curve to convert. The curve must be created beforehand.

Return type:

None

CurveWire(Parameters)[source]

Create a curve wire based on coordinate parameters.

Parameters:

parameters (dict) –

Dictionary containing all required and optional settings for the curve wire.

Required keys:

  • Name Wire (str)

    Name of the wire.

  • Radius (int or float)

    Radius of the curve.

Optional keys:

  • Points (dict, optional, default None)

    Dictionary of X and Y points defining the curve.

  • Material (str, optional, default “PCE”)

    Material of the bondwire. Must be preloaded in the simulation.

  • SolidWireModel (bool, optional, default True)

    If True, the curve wire will be modeled as a solid object.

  • Termination (str, optional, default None)

    How the bondwire is terminated. Options: “natural”, “rounded”, “extended”.

  • NameFolder (str, optional)

    Name of the bondwire folder. Defaults to the wire name.

  • CurveFolderName (str, optional, default None)

    Name of the curve folder.

  • CurveName (str, optional, default None)

    Name of the curve.

Raises:

ValueError – If any parameters are set incorrectly or required data is missing.

Returns:

String containing the generated VBA code for the curve wire.

Return type:

str

Cut_structures(Parameters)[source]

Cut one structure using another structure in the CST simulation environment.

Parameters:

parameters (dict) –

Dictionary containing the cut operation settings.

  • Name Cut Structure (str)

    Name of the structure that will be cut.

  • Name Structure to Cut (str)

    Name of the structure that will be used to cut the Name Cut Structure.

Return type:

None

Cylinder(Parameters)[source]

Create a cylinder object in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required and optional settings for the cylinder.

Required keys:

  • Cylinder Name (str)

    Name of the cylinder.

  • Component Name (str)

    Name of the cylinder component in the component tree.

  • Outer Radius (int or float)

    Outer radius of the cylinder.

  • Inner Radius (int or float)

    Inner radius of the cylinder.

  • Orientation Axis (str)

    Cylinder orientation axis. Can be “X”, “Y”, or “Z”. Depending on the axis, the following additional parameters are required:

    If `”X”` axis: - X min (int or float): X-min position. - X max (int or float): X-max position. - Y center (int or float): Y-center position. - Z center (int or float): Z-center position.

    If `”Y”` axis: - Y min (int or float): Y-min position. - Y max (int or float): Y-max position. - X center (int or float): X-center position. - Z center (int or float): Z-center position.

    If `”Z”` axis: - Z min (int or float): Z-min position. - Z max (int or float): Z-max position. - X center (int or float): X-center position. - Y center (int or float): Y-center position.

Optional keys:

  • Material (str, optional)

    Material for the cylinder. Must be preloaded in the simulation.

Raises:

ValueError – If any parameter values are invalid.

Return type:

None

DeleteGlobalParameter(Parameters)[source]

Delete an Global parameter from the enviroment.

Parameters:

Parameters (str) – Name of parameter to be removed.

Return type:

None.

Elipse(Parameters)[source]

Create an Ellipse object in Z-orientation in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the Ellipse object.

Required keys:

  • Name (str)

    Name of the Ellipse object.

  • Curve Name (str)

    Name of the component. The structure will be created as “Curve Name:Name”.

  • X Radius (int or float)

    Radius of the ellipse in the X-direction.

  • Y Radius (int or float)

    Radius of the ellipse in the Y-direction.

  • X Center (int or float)

    X-coordinate of the ellipse center.

  • Y Center (int or float)

    Y-coordinate of the ellipse center.

Return type:

None

GGB_Probe(Parameters)[source]

Create GGB probes in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the GGB probes.

Required keys:

  • Component Name (str)

    Name of the component in the CST project.

  • Orientation Angle (int or float)

    Angle to tilt the GGB probes.

Return type:

None

GSGSG_Bondwire_ChipToChip_connection(Parameters)[source]

Generate a setup with two chips connected by bondwires for GSGSG pads.

The setup is based on IHP: bondpads are made of Aluminium, and the bondwires are also Aluminium. The glue and floating shield over the bondwires are taken from a KIT paper setup.

Materials: - Gold: floating shield - DAF Glue: glue between the bondwires - Al: bondwires and bondpads - SiO2: layer under the bondpads on both chips - Si: substrate layer below the SiO2

Parameters:

parameters (dict) –

Dictionary containing all required settings for the GSGSG bondwire setup.

Required keys:

  • PAD Width GND (int or float)

    Width of the GND bondpads.

  • PAD Width Signal (int or float)

    Width of the signal bondpads.

  • PAD Length (int or float)

    Length of both signal and GND bondpads.

  • PAD Thickness (int or float)

    Thickness of both signal and GND bondpads.

  • PADs Distance (int or float)

    Distance from the first chip’s bondpads to the second chip’s bondpads.

  • Bondwire Height (int or float)

    Height of the bondwire at its midpoint.

  • Bondwire Radius (int or float)

    Radius of the bondwire.

  • Floating Shield (bool)

    If True, a floating shield with glue as dielectric is added to improve bandwidth. Requires also setting Floating Shield Thickness and Glue Thickness.

  • Glue Thickness (int or float)

    Thickness of the DAF glue measured from the SiO2 layer of the first chip to the SiO2 layer of the second chip.

  • Floating Shield Thickness (int or float)

    Thickness of the floating shield gold layer.

  • Accuracy (int or str)

    FDTD solver accuracy. Can be one of: 80, 60, 50, 40, 35, 30, 25, 20 dB, or ‘no check’.

Return type:

None

GSG_Bondwire_ChipToChip_connection(Parameters)[source]

Generate a setup with two chips connected by bondwires.

The setup is based on IHP: bondpads are made of Aluminium, and the bondwires are also Aluminium. The glue and floating shield over the bondwires are taken from a KIT paper setup. This setup is designed for GSG pads.

This function has the option to import GSG probes.

Materials: - Gold: Floating shield - DAF Glue: Glue between the bondwires - Al: Bondwires and bondpads - SiO2: Layer under the bondpads on both chips - Si: Substrate layer below the SiO2

Parameters:

parameters (dict) –

Dictionary containing all required settings for the bondwire setup.

Required keys:

  • PAD Width GND (int or float)

    Width of the GND bondpads.

  • PAD Width Signal (int or float)

    Width of the signal bondpads.

  • PAD Length (int or float)

    Length of both signal and GND bondpads.

  • PAD Thickness (int or float)

    Thickness of both signal and GND bondpads.

  • PADs Distance (int or float)

    Distance from the first chip’s bondpads to the second chip’s bondpads.

  • Bondwire Height (int or float)

    Height of the bondwire at its midpoint.

  • Bondwire Radius (int or float)

    Radius of the bondwire.

  • Floating Shield (bool)

    If True, a floating shield with glue as dielectric is added to improve the bandwidth of the bondwire connections. Requires also setting Floating Shield Thickness and Glue Thickness.

  • Glue Thickness (int or float)

    Thickness of the DAF glue measured from the SiO2 layer of the first chip upward to the SiO2 layer of the second chip.

  • Floating Shield Thickness (int or float)

    Thickness of the floating shield gold metal layer.

  • Accuracy (int or str)

    FDTD solver accuracy. Can be one of: 80, 60, 50, 40, 35, 30, 25, 20 dB, or ‘no check’.

Return type:

None

MZM(Parameters)[source]

Create an MZM modulator.

Materials used: - Gold: for the electrodes - LiNbO3: for optical waveguides - SiO2: for the substrate

Parameters:

parameters (dict) –

Dictionary containing all required settings for the MZM modulator.

Required keys:

  • Length Electrodes (int or float)

    Length of the electrodes. The waveguides will be 2 units longer than the electrodes.

  • Width GND (int or float)

    Width of the GND electrodes.

  • Width Signal (int or float)

    Width of the signal electrode.

  • Width WG (int or float)

    Top width of the optical waveguide (Rib waveguide).

  • Gap (int or float)

    Gap between the signal electrode and the optical waveguide.

  • Angle (int or float)

    Angle of the side wall of the optical waveguide.

  • Height Electrodes (int or float)

    Height of the electrodes.

  • Height WG (int or float)

    Height of the optical waveguide.

  • Height Slab (int or float)

    Height of the slab. If set to 0, no slab will be implemented.

  • Height Substrate (int or float)

    Height of the substrate.

Return type:

None

MoveWaveguidePorts(Parameters)[source]

Move a waveguide port in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for moving the waveguide port.

Keys:

  • Port Number (int)

    Number of the port to move.

  • Distance (int or float)

    Distance to move the port.

  • Span (list of list of int/float)

    Dictionary/array defining the port span in Y and Z directions: - Parameters[“Span”][0][0] : Y range minimum - Parameters[“Span”][0][1] : Y range maximum - Parameters[“Span”][1][0] : Z range minimum - Parameters[“Span”][1][1] : Z range maximum

Return type:

None

New_Project(name_project)[source]
Open_Project(path)[source]

Open existing project.

Parameters:

path (str) – Path and name to the project that you want ot open. For example : path = “C:/Test_folder/Test_cst_Project.cst”

Return type:

None.

PhaseModulator(Parameters)[source]

Create a Phase Modulator.

Materials used: - Gold: for the electrodes - LiNbO3: for optical waveguides - SiO2: for the substrate

Parameters:

parameters (dict) –

Dictionary containing all required settings for the Phase Modulator.

Required keys:

  • Length Electrodes (int or float)

    Length of the electrodes. The waveguides will be 2 units longer than the electrodes.

  • Width GND (int or float)

    Width of the GND electrodes.

  • Width Signal (int or float)

    Width of the signal electrode.

  • Width WG (int or float)

    Top width of the optical waveguide (Rib waveguide).

  • Gap (int or float)

    Gap between the signal electrode and the optical waveguide.

  • Angle (int or float)

    Angle of the side wall of the optical waveguide.

  • Height Electrodes (int or float)

    Height of the electrodes.

  • Height WG (int or float)

    Height of the optical waveguide.

  • Height Slab (int or float)

    Height of the slab. If set to 0, no slab will be implemented.

  • Height Substrate (int or float)

    Height of the substrate.

Return type:

None

Pick(Parameters)[source]

Pick function in CST environment.

Parameters:

pick_params (dict) –

Dictionary containing all required settings for the pick operation.

Keys:

  • Option (str)

    Pick option. Currently, only “Centerpoint” and “Face” are supported.

  • Object (str)

    Name of the object on which the pick will be executed.

  • Face Number (int)

    ID of the picked face (required if Option is “Face”).

Raises:

ValueError – Raised if any parameter is invalid or missing.

Return type:

None

Poligon_2D(Parameters)[source]

Create a 2D polygon for a tRib waveguide.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the 2D polygon.

Required keys:

  • Waveguide Name (str)

    Name of the polygon.

  • Points X (list of int or float)

    X-coordinates of the polygon points.

  • Points Y (list of int or float)

    Y-coordinates of the polygon points.

Return type:

None

Poligon_3D(Parameters)[source]

Create a 3D polygon for a tRib waveguide.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the 3D polygon.

Required keys:

  • Name (str)

    Name of the polygon.

  • Curve Name (str)

    Name of the component. The structure will be created as “Curve Name:Name”.

  • Point (dict)

    Dictionary containing the X and Y coordinates of the polygon points. Required keys:

    • X (list of int or float)

      X-coordinates of the polygon points.

    • Y (list of int or float)

      Y-coordinates of the polygon points.

Return type:

None

RibWaveguide_ToSolid(Parameters)[source]

Convert a Rib Waveguide into a solid object in CST.

Parameters:

parameters (dict) –

Dictionary containing all required and optional settings for the Rib Waveguide.

Keys:

  • Waveguide Name (str, optional, default “Rib_Waveguide”)

    Name of the waveguide.

  • Waveguide Height (int or float, optional)

    Height of the waveguide. Defaults to None.

  • Angle (int or float, optional)

    Side wall Angle of the waveguide. Defaults to None.

  • Name Folder (str, optional)

    Name of the folder where the waveguide will be stored. Defaults to None.

  • Material (str, optional)

    Material of the waveguide. Must be preloaded in the simulation. Defaults to None.

  • Waveguide Folder Name (str, optional)

    Name of the folder where the 2D or 3D polygon of the waveguide was created. Defaults to None.

Raises:

ValueError – If required parameters are missing or set incorrectly.

Return type:

None

RotationTranslation(Parameters)[source]

Rotate an object in the CST simulation environment.

Parameters:

parameters (dict) –

Dictionary containing rotation settings.

Keys:

  • Name Object (str)

    Name of the object to rotate.

  • Angle X (int or float)

    Rotation Angle around the X-axis in degrees.

  • Angle Y (int or float)

    Rotation Angle around the Y-axis in degrees.

  • Angle Z (int or float)

    Rotation Angle around the Z-axis in degrees.

Return type:

None

Save_Project(path, name, overwrite=False)[source]

Save CST Project to path with an given name

Parameters:
  • path (str) – Path to where the CST file should be saved.

  • name (str) – Name of the file to save

  • overwrite (boolen) – If the save file exist you can set “overwrite=True” to overwrite the existing save project. The default is False.

Return type:

None.

SetDiscretePort(Parameters)[source]

Set a discrete port in the CST environment.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the discrete port.

Keys:

  • Discrete Port Number (int)

    Number of the discrete port.

  • Discrete Port Type (str)

    Type of the discrete port. Can be one of: - “Voltage” - “S-Parameters” - “Current”

  • Port Impedance (int or float)

    Impedance of the port.

  • Port Voltage (int or float)

    Voltage applied to the port.

  • Port Current (int or float)

    Current applied to the port.

  • Port Radius (int or float)

    Radius of the port.

  • Discrete Port Coordinates (dict)

    Dictionary with coordinates for the port. Example keys: - Parameters[“Discrete Port Coordinates”][“X1”] - Parameters[“Discrete Port Coordinates”][“Y1”] - Parameters[“Discrete Port Coordinates”][“Z1”] - Parameters[“Discrete Port Coordinates”][“X2”] - Parameters[“Discrete Port Coordinates”][“Y2”] - Parameters[“Discrete Port Coordinates”][“Z2”]

Raises:

ValueError – Raised if any parameter is invalid or missing.

Return type:

None

SetMesh(Parameters)[source]

Set the type of the mesh in the CST simulation. The user can define the number of mesh cells per wavelength near and far from the simulation object.

Parameters:

parameters (dict) –

Dictionary containing mesh settings.

Keys:

  • Mesh Type (str)

    Type of the mesh. Possible values: - “PBA” — Hexahedral mesh with Perfect Boundary Approximation - “HexahedralTLM” - “CFD” - “CFDNew” - “Staircase” — Hexahedral mesh with staircase cells - “Tetrahedral” — Tetrahedral mesh - “Surface” — Surface mesh - “SurfaceMLS” — Surface multi-layer mesh - “Planar” — Planar 2D mesh

  • Mesh Cells Near Object (int)

    Number of mesh cells per wavelength near the simulation object.

  • Mesh Cells Far Object (int)

    Number of mesh cells per wavelength far from the simulation object.

Return type:

None

Sphere(Parameters)[source]

Create a Sphere object.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the Sphere object.

Required keys:

  • Axis (str)

    Orientation axis of the sphere. Can be "X", "Y", or "Z".

  • Center Radius (int or float)

    Radius of the sphere at its center.

  • Top Radius (int or float)

    Radius of the sphere at the top.

  • Bottom Radius (int or float)

    Radius of the sphere at the bottom.

  • Center Positions (dict)

    Dictionary with the center coordinates of the sphere. Required keys:

    • X (int or float)

    • Y (int or float)

    • Z (int or float)

    Example:

    `python positions = {} positions["X"] = 2 positions["Y"] = 2 positions["Z"] = 2 parameters["Center Positions"] = positions `

  • Material (str)

    Material of the Sphere object.

  • Name (str)

    Name of the sphere.

  • Component Name (str)

    Name of the component. The structure will be created as “Component Name:Name”.

Return type:

None

Squere_Waveguide(Parameters)[source]

Generate a simple straight waveguide.

Materials used: - Gold: for the electrodes - LiNbO3: for optical waveguides - SiO2: for the substrate

Parameters:

parameters (dict) –

Dictionary containing all required settings for the waveguide.

Required keys:

  • Length WG (int or float)

    Length of the waveguide.

  • Height WG (int or float)

    Height of the optical waveguide.

  • Width WG (int or float)

    Top width of the optical waveguide (Rib waveguide).

  • Substrate Height (int or float)

    Height of the substrate.

  • Slab Height (int or float)

    Height of the slab. If set to 0, no slab will be implemented.

Return type:

None

StartTimeSolver()[source]

Start Time Simulation

Return type:

None.

ToSolid(Parameters)[source]

Convert a function or polynomial curve into a solid object in CST.

Parameters:

parameters (dict) –

Dictionary containing all required and optional settings for the solid object.

Required keys:

  • Solid Name (str)

    Name of the solid object.

  • Curve Name (str, optional, default “Polygon”)

    Name of the source curve to convert.

  • Name Folder (str, optional)

    Name of the folder where the solid will be stored. Defaults to the curve name.

  • Material (str, optional, default “Aluminum”)

    Material of the solid object. Must be preloaded in the simulation.

Return type:

None

Translation(Parameters)[source]

Translate, scale, or rotate an object in the CST simulation environment.

Parameters:

parameters (dict) –

Dictionary containing the transformation settings.

Common Keys:

  • Translate Type (str)

    Type of transformation. Can be one of: - “Translate” - “Scale” - “Rotate”

If Translate Type == “Translate”:

  • Name Object (str)

    Name of the object to translate.

  • Object to translate (str)

    Specify the type of object: “Shape” for solids, “Curve” for curves.

  • Position (list of int/float)

    Translation vector in [“X”, “Y”, “Z”] directions. Example: [1, 2, 3].

If Translate Type == “Scale”:

  • Name Object (str)

    Name of the object to scale.

  • Center Positions (list of int/float)

    Center coordinates for scaling in [“X”, “Y”, “Z”]. Example: [1, 2, 3].

  • Scale Factors (list of int/float)

    Scaling factors in [“X”, “Y”, “Z”]. Example: [1, 2, 3].

If Translate Type == “Rotate”:

  • Name Object (str)

    Name of the object to rotate.

  • Object to rotate (str)

    Specify the type of object: “Shape” for solids, “Curve” for curves.

  • Center Positions (list of int/float)

    Center coordinates for rotation in [“X”, “Y”, “Z”]. Example: [1, 2, 3].

  • Angle Values (list of int/float)

    Rotation Angles in degrees for [“X”, “Y”, “Z”]. Example: [10, 20, 30].

Return type:

None

Translation_Rotation(Parameters)[source]

Rotate an object in the CST simulation environment.

Parameters:

parameters (dict) –

Dictionary containing the rotation settings.

  • Name Object (str)

    Name of the object to rotate.

  • Center Positions (dict)

    Center coordinates for the rotation operation. - X (int/float) : Center position in X direction. - Y (int/float) : Center position in Y direction. - Z (int/float) : Center position in Z direction.

  • Angle Values (dict)

    Rotation Angles for each axis. - X (int/float) : Rotation Angle around X axis. - Y (int/float) : Rotation Angle around Y axis. - Z (int/float) : Rotation Angle around Z axis.

Return type:

None

Translation_Scale(Parameters)[source]

Scale an object in the CST simulation environment.

Parameters:

parameters (dict) –

Dictionary containing the scaling settings.

  • Name Object (str)

    Name of the object to scale.

  • Center Positions (dict)

    Center coordinates for the scaling operation. - X (int/float) : Center position in X direction. - Y (int/float) : Center position in Y direction. - Z (int/float) : Center position in Z direction.

  • Scale Factors (dict)

    Scaling factors for each axis. - X (int/float) : Scale factor in X direction. - Y (int/float) : Scale factor in Y direction. - Z (int/float) : Scale factor in Z direction.

Return type:

None

WaveguidePort(Parameters)[source]

Set the waveguide port in CST.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the port.

Keys:

  • Orientation (list of str)

    Orientation of the ports. Can be “Positive” or “Negative”. For this function, two ports will be defined, so provide a list of two orientations, e.g.: Parameters[“Orientation”] = [“Positive”, “Positive”].

  • Coordinates (str)

    Type of coordinate selection. Recommended: “Picks”. Options are: “Free”, “Full”, “Picks”.

  • Span (list of list of int/float)

    Array defining the port span: [[Ymin, Ymax], [Zmin, Zmax]].

  • Potential (list of int)

    Array of port potentials, e.g.: [1, 2].

  • Port Number (list of int)

    Array of port numbers corresponding to each port.

Return type:

None

WaveguidePortWithPins(Parameters)[source]

Set the waveguide port in CST for a given object.

Parameters:

parameters (dict) –

Dictionary containing all required settings for the waveguide port.

Keys:

  • Orientation (list of str)

    Orientation of the ports. Can be “Positive” or “Negative”. Two ports are defined, so provide a list of two orientations, e.g.: Parameters[“Orientation”] = [“Positive”, “Positive”].

  • Coordinates (str)

    Type of coordinate selection. Recommended: “Picks”. Options are: “Free”, “Full”, “Picks”.

  • Span (list of list of int/float)

    Array defining the port span: [[Ymin, Ymax], [Zmin, Zmax]].

  • Potential (list of int)

    Array of port potentials, e.g., [1, 2].

  • Port Number (list of int)

    Array of port numbers corresponding to each port.

  • Polarity (list of str)

    Port polarity. Can be “Positive” or “Negative”. Provide an array for two ports, e.g.: Parameters[“Polarity”] = [“Positive”, “Positive”].

  • Solid Name (str)

    Name of the object where the waveguide port will be created, e.g.: “WG:WG1”.

  • Face ID (list of int)

    IDs of the two picked faces, e.g.: [2, 4].

  • Face Number (list of int)

    Numbers of the picked faces of the structure.

Return type:

None

add_Al()[source]

Add Aluminium to Material

Return type:

None.

add_Au()[source]

Add gold to Material

Return type:

None.

add_GGB_Probe_Material()[source]

Add an materials according to GGB Probes.

Return type:

None.

add_Glue()[source]

Add special glue for the floating shield bond wires according to the KIT model.

Return type:

None.

add_Si()[source]

Add Silicon to Material

Return type:

None.

add_SiO2()[source]

Add Silicon dioxide to Materials

Return type:

None.

add_anisotropy_material(name, Values)[source]

Add Anisotropic material to Material Libs

Parameters:
  • name (str) – Name of the Material

  • Values (dict) –

    Dictionary with the material Values:

    Values[“X”] : X Epsilon Value Values[“Y”] : Y Epsilon Value Values[“Z”] : Z Epsilon Value

Return type:

None.

add_json_material(path, name)[source]

Add a JSON material file if one is provided by the manufacturer or another source.

Parameters:
  • path (str) – Path to file.

  • name (str) – Name of the file..

Return type:

None.

add_material(name)[source]

Add an pre-set of Materials that are for now only available. An extra materials need to be added here.

Parameters:

name (str) –

Materials that are added to this CST_Constructor:
  • ”Si” Silicon

  • ”LiNbO3” Lithium niobate x-cut

  • ”SiO2” silicon dioxide

  • ”Au” Gold

  • ”Al” Aluminium

  • ”Glue” Special Glue for the Bondwire floating shield according to KIT Model

Raises:

ValueError – Give Error back if you choose some matherial that is not in the list of materials.

Return type:

None.

removeObject(Parameters)[source]

Delete objects in project

Parameters:

parameters (dict) –

Dictionary containing all parameters required for this function.

Required keys:

  • Type (str)

    Type of the object to delete. Possible values:

    • "Folder"

    • "Material"

    • "Component"

    • "Port"

    • "Curve"

  • Name (str)

    Name of the object to delete.

    If Type is "Port", only the port number is required. Example: parameters["Name"] = "1"

    Example usage:

    parameters["Type"] = "Component"
    parameters["Name"] = "Box"
    

    This deletes a component named Box.

Raises:

ValueError – If the object type or name is invalid.

Return type:

None

setBackground(Parameters)[source]

Set the Simulation background.

Parameters:

parameters (dict) –

Dictionary with all parameters required for this function.

Required keys:

  • Type Background (str)

    Type of the background. Default is "Normal". Possible values:

    • "PEC"

    • "Normal"

    • "Anisotropic"

  • Xmax Background (float)

    Background X-max value

  • Xmin Background (float)

    Background X-min value

  • Ymax Background (float)

    Background Y-max value

  • Ymin Background (float)

    Background Y-min value

  • Zmax Background (float)

    Background Z-max value

  • Zmin Background (float)

    Background Z-min value

Raises:

ValueError – DESCRIPTION.

Return type:

None.

setBoundary(Parameters)[source]

Set Boundary box Parameters

Parameters:

parameters (dict) –

Dictionary containing all boundary settings.

Required keys:

  • Xmin Boundary (str)

    Type of the X-min boundary.

  • Xmax Boundary (str)

    Type of the X-max boundary.

  • Ymin Boundary (str)

    Type of the Y-min boundary.

  • Ymax Boundary (str)

    Type of the Y-max boundary.

  • Zmin Boundary (str)

    Type of the Z-min boundary.

  • Zmax Boundary (str)

    Type of the Z-max boundary.

  • Xsymmetry Boundary (str)

    Type of X boundary symmetry.

  • Ysymmetry Boundary (str)

    Type of Y boundary symmetry.

  • Zsymmetry Boundary (str)

    Type of Z boundary symmetry.

Raises:

ValueError – If any of the boundary types or symmetries are invalid.

Return type:

None

setDomainSolverType(Parameters)[source]

Set Solver Domain in CST.

Parameters:

parameters (dict) –

Dictionary containing solver settings.

Keys:

  • Domain (str)

    Solver domain. Can be one of the following: “Time”, “Freq”, “EigenMode”, “Integral”, “Asymptotic”, “Multilayer”.

Return type:

None

setElectricalSimulationProperties(Parameters)[source]

Set Electrical Simulation Properties in CST.

Parameters:

parameters (dict) –

Dictionary containing all required electrical simulation settings.

Keys:

  • Dimensions (str)

    Unit for lengths.

  • Frequency (str)

    Unit for frequency.

  • Time (str)

    Unit for time.

  • Temperature (str)

    Unit for temperature.

  • Type Background (str)

    Type of simulation background (e.g., “Normal”, “PEC”, “Anisotropic”).

  • Xmin Background, Xmax Background (int/float)

    Minimum and maximum X span of the background.

  • Ymin Background, Ymax Background (int/float)

    Minimum and maximum Y span of the background.

  • Zmin Background, Zmax Background (int/float)

    Minimum and maximum Z span of the background.

  • Min Frequency, Max Frequency (int/float)

    Minimum and maximum simulation frequencies.

  • Xmin Boundary, Xmax Boundary (int/float)

    Minimum and maximum X boundary.

  • Ymin Boundary, Ymax Boundary (int/float)

    Minimum and maximum Y boundary.

  • Zmin Boundary, Zmax Boundary (int/float)

    Minimum and maximum Z boundary.

  • Xsymmetry Boundary, Ysymmetry Boundary, Zsymmetry Boundary (int/float)

    Symmetry settings for the X, Y, and Z boundaries.

Return type:

None

setFreqSolver()[source]

Set Frequency solver Parameters

Return type:

None.

setOpticalSimulationProperties(Parameters)[source]

Set Optical Simulation Properties in CST.

Parameters:

parameters (dict) –

Dictionary containing all required optical simulation settings.

Keys:

  • Length (str)

    Unit for lengths.

  • Frequency (str)

    Unit for frequency.

  • Time (str)

    Unit for time.

  • Temperature (str)

    Unit for temperature.

  • Type Background (str)

    Type of simulation background (e.g., “Normal”, “PEC”, “Anisotropic”).

  • Xmin Background, Xmax Background (int/float)

    Minimum and maximum X span of the background.

  • Ymin Background, Ymax Background (int/float)

    Minimum and maximum Y span of the background.

  • Zmin Background, Zmax Background (int/float)

    Minimum and maximum Z span of the background.

  • Min Wavelength, Max Wavelength (int/float)

    Minimum and maximum simulation wavelengths.

  • Xmin Boundary, Xmax Boundary (int/float)

    Minimum and maximum X boundary.

  • Ymin Boundary, Ymax Boundary (int/float)

    Minimum and maximum Y boundary.

  • Zmin Boundary, Zmax Boundary (int/float)

    Minimum and maximum Z boundary.

  • Xsymmetry Boundary, Ysymmetry Boundary, Zsymmetry Boundary (int/float)

    Symmetry settings for the X, Y, and Z boundaries.

Return type:

None

setSimFreqeuncy(Parameters)[source]

Set Simulation Frequency

Parameters:

parameters (dict) –

Dictionary containing the simulation frequency settings.

Required keys:

  • Min Frequency (int or float)

    Minimum frequency of the simulation.

  • Max Frequency (int or float)

    Maximum frequency of the simulation.

Return type:

None

setSimWavelength(Parameters)[source]

Set the simulation wavelength range.

Parameters:

parameters (dict) –

Dictionary containing the simulation wavelength settings.

Required keys:

  • Min Wavelength (int or float)

    Minimum wavelength of the simulation.

  • Max Wavelength (int or float)

    Maximum wavelength of the simulation.

Return type:

None

setTimeSolver(Parameters)[source]

Set Time Solver Parameters in CST.

Parameters:

parameters (dict) –

Dictionary containing all required solver settings.

Keys:

  • Accuracy (int)

    Accuracy of the solver. Possible values: 10, 15, 20, 25, 30, 35, 40.

  • Calculate Modes Only (bool)

    Set to True to calculate only the port modes. Set to False to calculate the entire structure.

  • Auto Impedance (bool)

    Set to True to automatically determine port impedance. Set to False to specify impedance manually.

  • Impedance (int or float)

    Port impedance (used only if Auto Impedance is False).

  • Source Port (int)

    Number of the source port (e.g., 1 or 2).

Raises:

ValueError – Raised if any parameter is invalid or missing.

Return type:

None

set_Units(Parameters)[source]

Set CST enviroment global units.

Parameters:

parameters (dict) –

Dictionary containing all parameters required for this function.

Required keys:

  • Unit Length (str)

    Measurement unit for length. Example: "um".

  • Unit Frequency (str)

    Measurement unit for frequency. Example: "GHz".

  • Unit Time (str)

    Measurement unit for time. Example: "ns".

  • Unit Temperature (str)

    Measurement unit for temperature. Example: "K".

Return type:

None

class CST_Constructor.CST_Constructor.Curves(Span_X, Span_Y, NumberOfPoints)[source]

Bases: object

Curve class is given an Euler Bezier and Cosinis curves (S-Curves). It was created to use the mathematical expressions to assist the above CST wire to solid functions.

Bezier_Curve()[source]

The Cubic Bezier Polynoms are taken from Wikipedia!

Returns:

curve – curve[:,0] - X Param of the Bezier Curve curve[:,1] - Y Param of the Bezier Curve

Return type:

2 dimentional np array

Cosinus_Curve()[source]

The cosinus function is SpanY*(cos((pi/(2*SpanX))*t)^2) —->> t in the range of 0 to SpanY

Returns:

curve – curve[:,0] - X Param of the Bezier Curve curve[:,1] - Y Param of the Bezier Curve.

Return type:

2 dimentional np array

Euler_Curve()[source]

Construct an Euler S-bend from (0, 0) to (Span_X, Span_Y) Using Fresnel integrals and linear curvature.

Returns:

curve – curve[:,0] - X Param of the Bezier Curve curve[:,1] - Y Param of the Bezier Curve.

Return type:

2 dimentional np array

class CST_Constructor.CST_Constructor.PostProcess(CST_obj)[source]

Bases: object

This class is used to export and also plot data that is generated with CST

Parameters:

CST_obj (CST_Commands)

Export_SParameters(Parameters)[source]

Export S-Parameters from the CST simulation.

Parameters:

parameters (dict) –

Dictionary containing all settings for the S-Parameter export.

  • Name (str)

    Name of the S-Parameter file. Example: parameters[“Name”] = “Export_S_Params”.

  • Path (str)

    Path where the file will be saved. Example: parameters[“Path”] = “C:/…/CST_Files”.

  • Impedance (int or float, optional)

    Impedance for the S-Parameters. Default is 50 Ohms.

  • Format (str)

    Export format for the S-Parameters. Options: “MA”, “DB”, or “RI”.

Raises:

ValueError – If an unsupported format is selected.

Return type:

None

read_snp(Parameters)[source]

Read a Touchstone S-parameter file (.s2p, .s3p, .s4p, etc.) and return the frequency array and S-matrix array.

Parameters:

Parameters (dict) –

Dictionary containing all settings for reading the file.

  • File Name (str)

    Name of the S-parameter file. Example: Parameters[“File Name”] = “Export_S_Params.s2p”.

  • Path (str)

    Path to the directory where the file is located. Example: Parameters[“Path”] = “C:/…/CST_Files”.

Returns:

  • freq (np.ndarray) – Frequency points (Hz or as specified in the file).

  • S_params (np.ndarray) – Array of shape (num_points, N, N) containing complex S-matrices.