-
Notifications
You must be signed in to change notification settings - Fork 22
Description
I try to create two cylinders and subtract them from a box, but there is a weird naming process that make it fail.
Here is the code:
from HFSSdrawpy import *
from HFSSdrawpy.libraries.base_elements import *
import numpy as np
from HFSSdrawpy.utils import parse_entry, Vector
pm = Modeler('hfss')
chip = Body(pm, 'chip')
cydinder_posX = pm.set_variable('0mm')
cydinder_posY = pm.set_variable('0mm')
cydinder_posZ = pm.set_variable('0mm')
cydinder_rad = pm.set_variable('0.275mm')
chip_width = pm.set_variable('10mm')
chip_length = pm.set_variable('10mm')
chip_thickness = pm.set_variable('1mm')
chip_sapphire = box(chip, [-chip_width/2, -chip_length/2, 0],
[chip_width, chip_length, -chip_thickness],
name="chip_sapphire")
chip_sapphire.assign_material("sapphire")
hole1 = cylinder(chip,[cydinder_posX, cydinder_posY, cydinder_posZ],
cydinder_rad,
-chip_thickness,
'Z',
nonmodel=True,
name='hole1')
hole2 = cylinder(chip,[cydinder_posX, cydinder_posY+'1mm', cydinder_posZ],
cydinder_rad,
-chip_thickness,
'Z',
nonmodel=True,
name='hole2')
chip_sapphire.subtract([hole1,hole2])