def make_constraints(self): constraints = [ Fixed( self.components["glass_top"].mate_origin, CoordSystem((0, 0, self.height), (1, 0, 0), (0, 0, 1)), ), Fixed( self.components["shelf_0"].mate_origin, CoordSystem((0, 0, self.height_1), (1, 0, 0), (0, 0, 1)), ), Fixed( self.components["shelf_1"].mate_origin, CoordSystem((0, 0, self.height_2), (1, 0, 0), (0, 0, 1)), ), Coincident( self.components["leg_0"].mate_origin, self.components["glass_top"].mate_leg_0, ), Coincident( self.components["leg_1"].mate_origin, self.components["glass_top"].mate_leg_1, ), Coincident( self.components["leg_2"].mate_origin, self.components["glass_top"].mate_leg_2, ), Coincident( self.components["leg_3"].mate_origin, self.components["glass_top"].mate_leg_3, ), ] return constraints
def make_constraints(self): board = self.components["board"] constr = [ Fixed( board.mate_origin, CoordSystem(origin=(0, 0, self.standoff + board.thickness / 2)), ) ] for i, j in enumerate(board.mount_verts()): m = Mate( self, CoordSystem( origin=(j.X, j.Y, self.standoff + board.thickness), xDir=(1, 0, 0), normal=(0, 0, 1), ), ) constr.append( Coincident(self.components[self.screw_name(i)].mate_origin, m)), constr.append( Coincident( self.components[self.standoff_name(i)].mate_top(), Mate( self, CoordSystem( origin=(j.X, j.Y, self.standoff), xDir=(1, 0, 0), normal=(0, 0, 1), ), ), )) return constr
def make_constraints(self): return [ Fixed( self.components["holder"].mate_origin, CoordSystem((0, 0, 0), (1, 0, 0), (0, 0, 1)), ), Coincident( self.components["bolt"].mate_along( 0), # self.components["holder"].mate_origin, # Put nut at end self.components["holder"].mate_bolt, ), # Fixed( # Test bolt # self.components["bolt"].mate_origin, # CoordSystem((20, 30, 0), (0, 0, 1), (1, 0, 0)).rotated((0, 0, 0)), # ), Coincident( # Move motor self.components["motor"].mate_origin, self.components["holder"].mate_motor, ), Coincident( self.components["gear"].mate_shaft, self.components["motor"].mate_gear ), Fixed( # Move riser self.components["riser_holder"].mate_origin, CoordSystem((7.5+14.7/2.0, -18.4, 0), (-1, 0, 0), (0, 0, 1)).rotated((0, 0, 180)), ), Coincident( # mount self.components["riser"].mate_holder_demo, self.components["riser_holder"].mate_origin, ), Fixed( self.components["switch"].mate_origin, CoordSystem((0, -7, 3), xDir=(0, 0, 1), normal=(-1, 0, 0)).rotated((90, 0, 0)), ) ]
def make_constraints(self): return [ # trunk Fixed( self.components['trunk'].mate_origin, # lock this CoordSystem((0, 0, 0), (1, 0, 0), (0, 0, 1)), # here ), Coincident( self.components['trunk_split'].mate_origin, # lock this self.components['trunk'].mate_top, # here ), # branch L Coincident( self.components['branch_lb'].mate_origin, self.components['trunk_split'].mate_left, ), Coincident( self.components['branch_ls'].mate_origin, self.components['branch_lb'].mate_top, ), # branch RL Coincident( self.components['branch_r'].mate_origin, self.components['trunk_split'].mate_right, ), ]
def make_constraints(self): return [ Fixed(self.components['base'].mate_origin, CoordSystem()), Coincident(self.components['front_bar'].mate_origin, self.components['base'].mate_left), Coincident(self.components['back_bar'].mate_origin, self.components['base'].mate_right), ]
def make_constraints(self): return [ Fixed(self.components['axle'].mate_origin, CoordSystem()), Coincident(self.components['left_wheel'].mate_origin, self.components['axle'].mate_left), Coincident(self.components['right_wheel'].mate_origin, self.components['axle'].mate_right), ]
def make_constraints(self): chassis = self.components['chassis'] front = self.components['front_wheels'] back = self.components['back_wheels'] return [ Fixed(chassis.mate_origin), Coincident(front.mate_origin, chassis.mate_front_axle), Coincident(back.mate_origin, chassis.mate_back_axle), ]
def make_constraints(self): base = self.components['base'] top = self.components['top'] fastener = self.components['fastener'] return [ Fixed(base.mate_bottom), Coincident(top.mate_bottom, base.mate_top), Coincident(fastener.mate_origin, top.mate_top), ]
def make_constraints(self): anchor = self.components['anchor'] plate = self.components['plate'] fastener = self.components['fastener'] return [ Fixed(anchor.mate_origin), Coincident(plate.mate_origin, anchor.mate_top), Coincident(fastener.mate_origin, plate.mate_top), ]
def make_constraints(self): axle = self.components['axle'] wheel_left = self.components['wheel_left'] wheel_right = self.components['wheel_right'] return [ Fixed(axle.mate_origin), Coincident(wheel_left.mate_connect, axle.mate_left), Coincident(wheel_right.mate_connect, axle.mate_right), ]
def make_constraints(self): return [ Fixed(self.components["body"].mate_origin), Coincident( self.components["shaft"].mate_origin, self.components["body"].mate_origin, ), Coincident(self.components["back"].mate_origin, self.components["body"].mate_bottom), ]
def make_constraints(self): return [ Fixed(self.components["holder"].mate_origin, CoordSystem()), Coincident( self.components["motor"].mate_centre, self.components["holder"].mate_centre, ), Coincident(self.components["gear"].mate_shaft, self.components["motor"].mate_gear), ]
def make_constraints(self): base = self.components["base"] yaw = self.components["yaw"] pitch = self.components["pitch"] constr = [ Fixed(base.mate_origin), Coincident(yaw.mate_origin, base.mate_top()), Coincident(pitch.mate_origin, yaw.mate_middle()), ] return constr
def make_constraints(self): return [ Fixed(self.components["axle"].mate_origin), Coincident(self.components["lwheel"].mate_origin, self.components["axle"].mate_left), Coincident( self.components["rwheel"].mate_origin, self.components["axle"].mate_right, ), ]
def make_constraints(self): constr = [ Fixed(self.components["stepper"].mate_origin), Coincident(self.components["coupling"].mate_input(), self.mate_tip()), Coincident( self.components["thread"].mate_origin, self.components["coupling"].mate_output(), ), ] return constr
def make_constraints(self): return [ Fixed(self.components['chassis'].mate_origin), Coincident( self.components['front_axle'].mate_origin, Mate(self.components['chassis'], CoordSystem((self.wheelbase/2,0,0))), ), Coincident( self.components['rear_axle'].mate_origin, Mate(self.components['chassis'], CoordSystem((-self.wheelbase/2,0,0))), ), ]
def make_constraints(self): return [ Fixed(self.components['body'].mate_origin), Coincident( self.components['shaft'].mate_origin, self.components['body'].mate_origin, ), Coincident( self.components['back'].mate_origin, self.components['body'].mate_bottom, ) ]
def make_constraints(self): return [ Fixed(self.components["axle"].mate_origin, CoordSystem()), Coincident( self.components["left_wheel"].mate_origin, self.components["axle"].mate_left, ), Coincident( self.components["right_wheel"].mate_origin, self.components["axle"].mate_right, ), ]
def make_constraints(self): return [ Fixed(self.components['topcap'].mate_top), Coincident( self.components['stator'].mate_top, self.components['topcap'].mate_bottom, ), Coincident(self.components['botcap'].mate_bottom, self.components['stator'].mate_bottom), Coincident(self.components['shaft'].mate_origin, self.components['topcap'].mate_top), ]
def make_constraints(self): servobody = self.components["servobody"] shaft = self.components["shaft"] constr = [ Fixed(servobody.mate_origin), Coincident(shaft.mate_origin, servobody.mate_shaft()), ] if self.horn is not None: horn = self.components["horn"] constr.append(Coincident(horn.mate_origin, shaft.mate_tip())) return constr
def get_constraints(self): last_part = self.evaluator.eval[-1].part return [ Coincident( self.components['screw'].mate_threadstart, Mate(last_part, self.evaluator.eval[-1].start_coordsys - last_part.world_coords), ), Coincident( self.components['anchor'].mate_screwhead, self.components['screw'].mate_origin, ), ]
def make_constraints(self): base2 = self.components["base2"] base3 = self.components["base3"] constraints = [ Fixed(self.components["base"].mate_origin, CoordSystem( (0, 107, 0))), Fixed(base2.mate_origin, CoordSystem( (0, 147, 0))), # Embed nuts in top and make sure cutout Fixed(base3.mate_origin, CoordSystem( (0, 180, 0))), # Embed nuts in top and make sure cutout # works ] for i, size in enumerate(self.tests): bolt_b = self.components[self.bolt_on_bottom_name(size)] constraints += [ Fixed( # Space out nuts self.components[self.nut_name(size)].mate_origin, CoordSystem((i * 20, 0, 0)), ), Fixed( self.components[self.thread_name(size)].mate_origin, CoordSystem((i * 20, 15, 0)), ), Fixed( self.components[self.min_bolt_name(size)].mate_origin, CoordSystem((i * 20, 40, 0)), ), Fixed( self.components[self.bolt_name(size)].mate_origin, CoordSystem((i * 20, 65, 0)), ), Fixed( self.components[self.embedded_bolt_name(size)].mate_origin, CoordSystem((i * 20, 95, 0)), ), Fixed( self.components[self.insert_bolt_name(size)].mate_origin, CoordSystem((i * 20, 120, 10)), ), Fixed( self.components[self.tool_name(size)].mate_origin, CoordSystem((i * 20, -10, 0)), ), Coincident( self.components[self.nut_on_top_name(size)].mate_nutend, base2.mate_nut_top(i), ), Coincident( bolt_b.mate_head_end(rotation=(180, 0, 0)), base3.mate_nut_bottom(i), ), ] return constraints
def make_constraints(self): constr = [ Fixed(self.components["back"].mate_origin), Coincident( self.components["cover"].mate_back(), self.components["back"].mate_front(), ), Coincident( self.components["seal"].mate_back(), self.components["cover"].mate_origin, ), ] return constr
def make_constraints(self): constr = [ Fixed(self.components["stepper"].mate_origin), Coincident( self.components["drive"].pulley_A_mate(offset=10), self.components["stepper"].mate_origin, ), Coincident( self.components["idler"].mate_origin, self.components["drive"].pulley_B_mate(offset=10), ), ] return constr
def make_constraints(self): base = self.components["base"] left = self.components["left"] right = self.components["right"] fal = self.components["fal"] far = self.components["far"] cl = [ Fixed(base.mate_origin), Coincident(left.mate_bot, base.mate_left), Coincident(right.mate_bot, base.mate_right), Coincident(fal.mate_origin, base.mate_left_up), Coincident(far.mate_origin, base.mate_right_up), ] return cl
def make_constraints(self): return [ Fixed(self.components["base"].mate_origin, CoordSystem()), Coincident(self.components["mount1"].mate_origin, self.components["base"].mate_one), Coincident(self.components["mount2"].mate_origin, self.components["base"].mate_two), Coincident(self.components["beam1"].mate_origin, self.components["base"].mate_beam1), Coincident(self.components["beam2"].mate_origin, self.components["base"].mate_beam2), Coincident(self.components["holder"].mate_origin, self.components["base"].mate_holder), ]
def make_constraints(self): return [ Fixed(self.components["topcap"].mate_top), Coincident( self.components["stator"].mate_top, self.components["topcap"].mate_bottom, ), Coincident( self.components["botcap"].mate_bottom, self.components["stator"].mate_bottom, ), Coincident(self.components["shaft"].mate_origin, self.components["topcap"].mate_top), ]
def make_constraints(self): constr = [ Fixed(self.components["mount"].mate_origin), Coincident( self.components["stepper"].mate_origin, self.components["mount"].mate_motor(), ), ] # if driven is defined if self.driven is not None: shaft_length = self.stepper().shaft_length constr.append( Coincident( self.components["driven"].mate_wheel(), self.components["mount"].mate_motor(offset=shaft_length), )) # if the mount is defined add the mnt = self.find("mount") if self.target is not None: for i, j in enumerate(self.components["mount"].mount_points()): m = Mate( self, CoordSystem( origin=(j.X, j.Y, -mnt.thickness), xDir=(1, 0, 0), normal=(0, 0, -1), ), ) constr.append( Coincident(self.components[self.mount_name(i)].mate_origin, m)) # screws for stepper to mount for i, j in enumerate(self.components["stepper"].mount_points()): m = Mate( self, CoordSystem( origin=( j.X, -mnt.length / 2, j.Y + mnt.height / 2 + mnt.clearance / 2 + mnt.thickness, ), xDir=(1, 0, 0), normal=(0, -1, 0), ), ) constr.append( Coincident(self.components[self.screw_name(i)].mate_origin, m)) return constr
def make_constraints(self): const = [] disc = self.components["disc"] boss = self.components["boss"] motor = self.components["motor"] const.append(Fixed(disc.mate_top())) const.append(Coincident(boss.mate_origin, disc.mate_origin)) # const.append(Coincident(motor.mate_origin, boss.mate_origin)) const.append( Fixed(motor.mate_origin, CoordSystem(origin=(0, 0, -self.sl)))) # const.append(Fixed(boss.mate_origin)) if self.mount is not None: const.append(Coincident(self.mount.mate_origin, motor.mate_origin)) return const
def make_constraints(self): return [ Fixed( self.components["middle"].mate_origin, CoordSystem(origin=(0, 0, self.base_height + self.thickness)), ), Coincident( self.components["lower"].mate_origin, self.components["middle"].mate_bottom(explode=self.explode), ), Coincident( self.components["upper"].mate_origin, self.components["middle"].mate_top(explode=self.explode), ), ]