input_parameters['cavity_length'] / 2., 0, 0)) cavity_shell = make_beampipe( face4, input_parameters['cavity_length'] + 2 * input_parameters['wall_thickness']) beampipe_shell2 = make_beampipe( face3, input_parameters['pipe_length'], (input_parameters['pipe_length'] / 2. + input_parameters['cavity_length'] / 2., 0, 0)) shell1 = beampipe_shell1.fuse(cavity_shell) shell2 = shell1.fuse(beampipe_shell2) shell3 = shell2.cut(vac2) except Exception as e: raise ModelException(e) # An entry in the parts dictionary corresponds to an STL file. This is useful for parts of differing materials. parts = {'vac': vac2, 'shell': shell3} return parts, os.path.splitext(os.path.basename(MODEL_NAME))[0] base_model(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10) parameter_sweep(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_radius', [10e-3, 30e-3, 40e-3, 50e-3]) parameter_sweep(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_radius', [15e-3, 20e-3, 25e-3]) parameter_sweep(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_length', [10e-3, 30e-3, 40e-3, 50e-3]) parameter_sweep(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_radius', [10e-3, 30e-3, 40e-3, 50e-3]) parameter_sweep(pillbox_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_length', [40e-3, 60e-3, 100e-3])
vac1 = beampipe_vac1.fuse(taper_vac1) vac2 = vac1.fuse(beampipe_vac2) vac3 = vac2.fuse(taper_vac2) vac4 = vac3.fuse(beampipe_vac3) full_pipe = fin4.cut(vac4) except Exception as e: raise ModelException(e) # An entry in the parts dictionary corresponds to an STL file. This is useful for parts of differing materials. parts = {'pipe': full_pipe, 'vac': vac4} return parts, os.path.splitext(os.path.basename(MODEL_NAME))[0] base_model(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10) parameter_sweep(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_radius', [5e-3, 10e-3, 15e-3, 25e-3, 30e-3]) parameter_sweep(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'taper_length', [10e-3, 20e-3, 40e-3, 50e-3, 60e-3]) parameter_sweep(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'racetrack_height', [15e-3, 20e-3, 25e-3, 30e-3, 35e-3, 40e-3, 45e-3, 50e-3]) parameter_sweep(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'racetrack_width', [20e-3, 30e-3, 50e-3, 60e-3, 70e-3]) parameter_sweep(racetrack_to_octagonal_cavity_model, INPUT_PARAMETERS, OUTPUT_PATH, 'racetrack_length',
face1, input_parameters['pipe_length'], (input_parameters['pipe_length'] / 2. + input_parameters['taper_length'] + input_parameters['cavity_length'] / 2., 0, 0)) fin1 = beampipe1.fuse(taper1) fin2 = fin1.fuse(beampipe2) fin3 = fin2.fuse(taper2) fin4 = fin3.fuse(beampipe3) except Exception as e: raise ModelException(e) # An entry in the parts dictionary corresponds to an STL file. This is useful for parts of differing materials. parts = {'all': fin4} return parts, os.path.splitext(os.path.basename(MODEL_NAME))[0] base_model(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_height', [5, 10, 15, 20]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_height', [20, 30, 40, 50]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_width', [40, 60, 80, 100, 120]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'taper_length', [10, 20, 30, 40, 50, 60]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_length', [0, 20, 40, 60, 80]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_height', [10, 15, 20, 25, 30, 35, 40, 45, 50]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_width', [20, 30, 40, 50, 60, 70]) parameter_sweep(racetrack_taper_model, INPUT_PARAMETERS, OUTPUT_PATH,
face1, input_parameters['pipe_length'], (input_parameters['pipe_length'] / 2. + input_parameters['taper_length'] + input_parameters['cavity_length'] / 2., 0, 0)) fin1 = beampipe1.fuse(taper1) fin2 = fin1.fuse(beampipe2) fin3 = fin2.fuse(taper2) fin4 = fin3.fuse(beampipe3) except Exception as e: raise ModelException(e) # An entry in the parts dictionary corresponds to an STL file. This is useful for parts of differing materials. parts = {'all': fin4} return parts, os.path.splitext(os.path.basename(MODEL_NAME))[0] base_model(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_height', [5, 10, 15, 25, 30]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_width', [40, 80, 100, 120]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'taper_length', [10, 20, 40, 50, 60]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'cavity_length', [40, 60, 80]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_height', [15, 20, 25, 30, 35, 40, 45, 50]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_length', [50, 100, 150, 200, 250, 300]) parameter_sweep(elliptical_taper_model, INPUT_PARAMETERS, OUTPUT_PATH, 'pipe_width', [30, 50, 60, 70])
stripline1 = Part.makeBox( input_parameters['stripline_length'], 2, input_parameters['stripline_width'], Base.Vector(-input_parameters['stripline_length'] / 2., 30, -input_parameters['stripline_width'] / 2.)) stripline2 = Part.makeBox( input_parameters['stripline_length'], 2, input_parameters['stripline_width'], Base.Vector(-input_parameters['stripline_length'] / 2., -30, -input_parameters['stripline_width'] / 2.)) diff3 = outer.cut(cylinder1) diff4 = diff3.cut(cylinder2) diff5 = diff4.cut(cylinder3) diff6 = diff5.cut(cylinder4) pins = pin1.fuse(pin2) pins = pins.fuse(pin3) pins = pins.fuse(pin4) striplines = stripline1.fuse(stripline2) except Exception as e: raise ModelException(e) # An entry in the parts dictionary corresponds to an STL file. This is useful for parts of differing materials. parts = {'cavity': diff6, 'striplines': striplines, 'pins': pins} return parts, os.path.splitext(os.path.basename(MODEL_NAME))[0] base_model(simple_stripline_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10)
quadrants[0] * input_parameters['button_horizontal_offset'], ), rotation_angles=(quadrants[0] * quadrants[1] * input_parameters['button_angle'], 0, 0) ) ceramic = rotate_at(ceramic, loc=(quadrants[2] * input_parameters['button_s_offset'], quadrants[1] * beam_pipe_height, quadrants[0] * input_parameters['button_horizontal_offset'], ), rotation_angles=(quadrants[0] * quadrants[1] * input_parameters['button_angle'], 0, 0) ) shell = rotate_at(shell, loc=(quadrants[2] * input_parameters['button_s_offset'], quadrants[1] * beam_pipe_height, quadrants[0] * input_parameters['button_horizontal_offset'], ), rotation_angles=(quadrants[0] * quadrants[1] * input_parameters['button_angle'], 0, 0) ) return button, pin, ceramic, shell def ellipse_track(e_height, e_width, x): a = e_width / 2. b = e_height / 2. y = (b**2. - ((b / a) * x)**2.)**0.5 return y base_model(simple_buttons_model, INPUT_PARAMETERS, OUTPUT_PATH, accuracy=10) parameter_sweep(simple_buttons_model, INPUT_PARAMETERS, OUTPUT_PATH, 'button_radius', [2E-3, 2.5E-3])