Beispiel #1
0
 def make_constraints(self):
     inner = self.components['inner_ring']
     outer = self.components['outer_ring']
     return [
         constraint.Fixed(inner.mate_origin),
         constraint.Coincident(outer.mate_origin, inner.mate_origin),
     ]
Beispiel #2
0
 def make_constraints(self):
     base = self.components['base']
     top = self.components['top']
     fastener = self.components['fastener']
     return [
         constraint.Fixed(base.mate_bottom),
         constraint.Coincident(top.mate_bottom, base.mate_top),
         constraint.Coincident(fastener.mate_origin,
                               top.mate_top + CoordSystem((1, 2, 0))),
     ]
Beispiel #3
0
 def make_constraints(self):
     constraints = []
     for i in range(self.roller_count):
         obj = self.components[self._roller_name(i)]
         angle = i * (360. / self.roller_count)
         constraints.append(
             constraint.Fixed(
                 obj.mate_origin,
                 CoordSystem().rotated((0, 0, angle)) +
                 CoordSystem(origin=(self.rolling_radius, 0, 0), ).rotated(
                     (0, -self.roller_angle, 0))))
     return constraints
 def make_constraints(self):
     bottom = self.components['bottom']
     top = self.components['top']
     spring = self.components['spring']
     return [
         constraint.Fixed(bottom.mate_side),
         constraint.Coincident(
             top.mate_spring_center,
             bottom.mate_spring_center + CoordSystem(normal=(0, 0, -1))),
         constraint.Coincident(spring.mate_origin,
                               bottom.mate_spring_center),
     ]
Beispiel #5
0
    def make_constraints(self):
        outer = self.components['outer_ring']
        inner = self.components['inner_ring']
        ring = self.components['rolling_elements']
        constraints = [
            constraint.Fixed(outer.mate_origin),
            constraint.Coincident(
                inner.get_mate_center(angle=0),
                outer.get_mate_center(angle=self.angle)
            ),
            constraint.Coincident(ring.mate_origin, outer.mate_origin),
        ]
        # rolling elements
        # FIXME: use a more sensible constraint when available (see issue #30)

        return constraints
Beispiel #6
0
    def make_constraints(self):
        constraints = []

        ball_angle = -radians(self.angle * 2)
        rail_angle_delta = radians(self.angle / 2)
        for i in range(self.ball_count):
            # crude, innacruate calculation. justification: ball position is just illustrative
            ball = self.components[self.ball_name(i)]
            arc_angle = i * ((pi * 2) / self.ball_count)
            rail_angle = arc_angle + rail_angle_delta
            constraints.append(constraint.Fixed(
                ball.mate_origin,
                CoordSystem(
                    origin=(
                        self.rolling_radius * cos(rail_angle),
                        self.rolling_radius * sin(rail_angle),
                        0,
                    ),
                    xDir=(cos(ball_angle), sin(ball_angle), 0),
                    normal=(0, 0, 1),
                )
            ))

        return constraints