Exemplo n.º 1
0
 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)), )
     ]
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
 def make_constraints(self):
     constr = []
     for i in range(self.count):
         el = self.components[self.electrode_name(i)]
         constr.append(
             Fixed(
                 el.mate_origin,
                 CoordSystem().rotated((0, 0, i * self.incr)) +
                 CoordSystem(origin=(self.radius, 0, 0)),
             ))
     return constr
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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))),
         ),
     ]
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 def pulley_B_mate(self, offset=0):
     return Mate(
         self,
         CoordSystem(origin=(-offset, -self.spacing, 0),
                     xDir=(0, 1, 0),
                     normal=(1, 0, 0)),
     )
Exemplo n.º 9
0
 def mate_tip(self):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.shaft_length),
                     xDir=(1, 0, 0),
                     normal=(0, 0, 1)),
     )
Exemplo n.º 10
0
 def mate_two(self):
     return Mate(
         self,
         CoordSystem(origin=(0, -11, 0),
                     # xDir=(1, 0, 0), normal=(0, -1, 0),
                     ),
     )
Exemplo n.º 11
0
 def make_constraints(self):
     constraints = [
         Fixed(self.components["base"].mate_origin, CoordSystem()),
         Fixed(self.components["switch1"].mate_origin,
               CoordSystem((0, -30, 0))),
         Fixed(
             self.components["switch2"].mate_origin,
             CoordSystem((0, 15, 0), xDir=(0, 0, 1),
                         normal=(-1, 0, 0)).rotated((90, 0, 0)),
         )
         # Fixed(  # Space out nuts
         #     self.components["switch2"].mate_origin,
         #     CoordSystem((0, 0, 0), xDir=(0, 1, 0), normal=(1, 0, 0)),
         # ),
     ]
     return constraints
Exemplo n.º 12
0
 def mate_top(self):
     " top of the stator"
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.length / 2),
                     xDir=(0, 1, 0),
                     normal=(0, 0, 1)))
Exemplo n.º 13
0
 def make_constraints(self):
     constr = [
         Fixed(self.components["base"].mate_origin,
               CoordSystem(origin=(0, 0, 60))),
         Coincident(
             self.components["electronics"].mate_origin,
             self.components["base"].mate_back(),
         ),
         Coincident(
             self.components["sensors"].mate_front(),
             self.components["base"].mate_front(),
         ),
         Coincident(
             self.components["Ldrive_b"].mate_corner(flip=-1),
             self.components["base"].mate_RL(),
         ),
         Coincident(
             self.components["Rdrive_b"].mate_corner(flip=1),
             self.components["base"].mate_RR(),
         ),
         Coincident(
             self.components["Ldrive_f"].mate_corner(flip=1),
             self.components["base"].mate_RL(offset=self.length -
                                             self.chamfer),
         ),
         Coincident(
             self.components["Rdrive_f"].mate_corner(flip=-1),
             self.components["base"].mate_RR(offset=self.length -
                                             self.chamfer),
         ),
     ]
     return constr
Exemplo n.º 14
0
 def mate_right(self):
     return Mate(
         self,
         CoordSystem(origin=(0, self.length / 2, 0),
                     xDir=(1, 0, 0),
                     normal=(0, 1, 0)),
     )
Exemplo n.º 15
0
 def mate_holder(self):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, 0),
                     # xDir=(1, 0, 0), normal=(0, 0, 1),
                     ),
     )
Exemplo n.º 16
0
 def mate_top(self):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.height),
                     xDir=(1, 0, 0),
                     normal=(0, 0, -1)),
     )
Exemplo n.º 17
0
 def mate_centre(self):
     """Assumes rotating around Z axis"""
     return Mate(
         self,
         CoordSystem(origin=(0, 0, +self.width / 2),
                     #            xDir=(1, 0, 0), normal=(0, -1, 0),
                     ))
Exemplo n.º 18
0
 def mate_gear(self):
     """This is at the centre and end of the drive shaft"""
     return Mate(
         self,
         CoordSystem(origin=(8.5, 0, 26.75),
                     xDir=(1, 0, 1),
                     normal=(0, 0, -1)))
Exemplo n.º 19
0
 def mate_beam2(self):
     return Mate(
         self,
         CoordSystem(origin=(10, 17.5, 128),
                     xDir=(0, -1, 0),
                     normal=(-1, 0, 0)),
     )
Exemplo n.º 20
0
 def mate_output(self, offset=0):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.gap / 2),
                     xDir=(1, 0, 0),
                     normal=(0, 0, 1)),
     )
Exemplo n.º 21
0
 def mate_tip(self, offset=0):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.length),
                     xDir=(1, 0, 0),
                     normal=(0, 0, 1)),
     )
Exemplo n.º 22
0
 def mate_bottom(self):
     " bottom of the stator"
     return Mate(
         self,
         CoordSystem(origin=(0, 0, -self.length / 2),
                     xDir=(1, 0, 0),
                     normal=(0, 0, -1)))
Exemplo n.º 23
0
 def mate_motor(self):
     return Mate(
         self,
         CoordSystem(origin=(self.motor_offset, 0, 0),
                     xDir=(0, 0, 1),
                     normal=(-1, 0, 0)),
     )
Exemplo n.º 24
0
 def mate_top(self):
     return Mate(
         self,
         CoordSystem(origin=(0, 0, self.thickness),
                     xDir=(1, 0, 0),
                     normal=(0, 0, 1)),
     )
Exemplo n.º 25
0
 def mate_left(self):
     return Mate(
         self,
         CoordSystem(origin=(0, self.seperation / 2, 0),
                     xDir=(1, 0, 0),
                     normal=(0, -1, 0)),
     )
Exemplo n.º 26
0
 def make_constraints(self):
     constr = [
         Fixed(self.components["shaft"].mate_origin,
               CoordSystem(origin=(0, 0, 0))),
         Fixed(self.components["roller"].mate_end()),
     ]
     return constr
Exemplo n.º 27
0
 def mate_top(self):
     " connect to the end of the top cap"
     return Mate(
         self,
         CoordSystem(origin=(0, 0, -self.length / 2),
                     xDir=(0, 1, 0),
                     normal=(0, 0, -1)))
Exemplo n.º 28
0
 def mate_end(self, offset=0):
     return Mate(
         self,
         CoordSystem(origin=(-self.length / 2, 0, 0),
                     xDir=(0, 0, 1),
                     normal=(1, 0, 0)),
     )
Exemplo n.º 29
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,
            ),
        ]
Exemplo n.º 30
0
 def mate_holder(self):
     return Mate(
         self,
         CoordSystem(origin=(-90, 17.5, 128),
                     xDir=(1, 0, 0),
                     normal=(0, -1, 0)),
     )