Beispiel #1
0
        self.dxf = dxf
        self.color = color
        self.thickness = thickness
        self.pf_thickness = pf_thickness

    def mount_holes(self):
        '''3D description of the cut to be made in the playfield wood'''
        return translate([0,0,-self.thickness])(
            linear_extrude(height=self.thickness + 1)(
                import_(self.dxf)
            )
        ) + \
        translate([0,0,-self.pf_thickness])(
            linear_extrude(height=self.pf_thickness + 1)(
                import_(self.dxf) #TODO: calculate inset of this shape
            )
        )

    def part_model(self):
        return color(self.color)(translate([0, 0, -self.thickness])(
            linear_extrude(height=self.thickness)(import_(self.dxf))))


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Inserts("inserts_example.dxf"))  #TODO: add an example DXF file

    scad_render_to_file(pf.assembly(), 'inserts_example.scad')
class NarrowStandupTarget(RectangularStandupTarget):

  def __init__(self, **kwargs):
    #TODO: check dimensions
    super(NarrowStandupTarget, self).__init__(width = (3.0/4)*inch, height = 1*inch, thickness = 3.0/8*inch, **kwargs)

  def part_model(self):
    return \
    super(NarrowStandupTarget, self).part_model() 

class SquareStandupTarget(RectangularStandupTarget):

  def __init__(self, **kwargs):
    super(SquareStandupTarget, self).__init__(width = 1*inch, height = 1*inch, thickness = 3.0/8*inch, **kwargs)

  def part_model(self):
    return \
    super(SquareStandupTarget, self).part_model() 

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(RoundStandupTarget(), [50,30])
  pf.append(SquareStandupTarget(), [100,30])
  pf.append(NarrowStandupTarget(), [150,30])
  pf.append(WideStandupTarget(), [200,30])

  scad_render_to_file( pf.assembly(), '/tmp/standuptarget_example.scad')

  def mount_holes(self):
    return None

  def laneguide(self):
    return \
    translate([0, 0, 14])(
      self.lguide.part_model()
    )

  def posts(self):
    return \
    union()(
      translate([0, self.lguide.length/2+1.5])(
        self.p1.part_model()
      ),
      translate([0, -self.lguide.length/2-1.5])(
        self.p2.part_model()
      )
    )

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(LaneGuideAssembly(), [200,120])
  pf.append(LaneGuideAssembly(), [250,100])
  pf.append(LaneGuideAssembly(), [300,120])

  scad_render_to_file( pf.assembly(), '/tmp/laneguide_example.scad')

Beispiel #4
0
                                                  thickness=3.0 / 8 * inch,
                                                  **kwargs)

    def part_model(self):
        return \
        super(NarrowStandupTarget, self).part_model()


class SquareStandupTarget(RectangularStandupTarget):
    def __init__(self, **kwargs):
        super(SquareStandupTarget, self).__init__(width=1 * inch,
                                                  height=1 * inch,
                                                  thickness=3.0 / 8 * inch,
                                                  **kwargs)

    def part_model(self):
        return \
        super(SquareStandupTarget, self).part_model()


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(RoundStandupTarget(), [50, 30])
    pf.append(SquareStandupTarget(), [100, 30])
    pf.append(NarrowStandupTarget(), [150, 30])
    pf.append(WideStandupTarget(), [200, 30])

    scad_render_to_file(pf.assembly(), '/tmp/standuptarget_example.scad')
Beispiel #5
0
            )
          ),
          translate([0,0,-1])(
            cylinder(r=m4_diameter/2, h=H+2, segments=20)
          ),

          translate([0,0,self.rubber_height])(
            rotate_extrude()(
              translate([r+d + (H-self.rubber_height)*(R-r-d)/H,0])(
                circle(r=self.rubber_radius, segments=20)
              )
            )
          )
        )
        return post

    def mount_holes(self):
        return None

    def mount_holes_2d(self):
        return None


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Post(), [50, 30])

    scad_render_to_file(pf.assembly(), '/tmp/post_example.scad')
Beispiel #6
0
    translate([0,13,-self.pf_thickness-1])(
		linear_extrude(height=self.pf_thickness+2)(
			hull()(
				translate([0,+self.cut_length/2])( circle(r=self.cut_width/2, segments=20) ),
				translate([0,-self.cut_length/2])( circle(r=self.cut_width/2, segments=20) )
			)
		)
	)

    return plunger_cut + ball_centering_cut + rollover_switch_cut

  def part_model(self):
    return self.shooter_switch() + self.plunger()

  def shooter_switch(self):
    #TODO: Implement-me!
    return empty_3d()

  def plunger(self):
    #TODO: Implement-me!
    return empty_3d()

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(Launcher(), [400 - 30, 100])

  scad_render_to_file( pf.assembly(), '/tmp/launcher_example.scad')

Beispiel #7
0
          translate([-30,0])(
            circle(r=radius)
          ),

          translate([-4,0])(
            hull()(
              translate([0,-4])(
                circle(r=radius-2)
              ),

              translate([0,8])(
                circle(r=radius-2)
              )
            )
          ),

          translate([30,0])(
            circle(r=radius)
          )
        )


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Slingshot(angle=30), [100, 100])
    pf.append(Slingshot(angle=180 - 30), [300, 100])

    scad_render_to_file(pf.assembly(), '/tmp/slingshot_example.scad')
Beispiel #8
0
    '''3D description of the cut to be made in the playfield wood'''
    return translate([0,0,-self.thickness])(
        linear_extrude(height=self.thickness + 1)(
            import_(self.dxf)
        )
    ) + \
    translate([0,0,-self.pf_thickness])(
        linear_extrude(height=self.pf_thickness + 1)(
            import_(self.dxf) #TODO: calculate inset of this shape
        )
    )


  def part_model(self):
    return color(self.color)(
        translate([0,0,-self.thickness])(
            linear_extrude(height=self.thickness)(
                import_(self.dxf)
            )
        )
    )

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(Inserts("inserts_example.dxf")) #TODO: add an example DXF file

  scad_render_to_file( pf.assembly(), 'inserts_example.scad')

      translate([-30,0])(
        circle(r=radius)
      ),

      translate([-4,0])(
        hull()(
          translate([0,-4])(
            circle(r=radius-2)
          ),

          translate([0,8])(
            circle(r=radius-2)
          )
        )
      ),

      translate([30,0])(
        circle(r=radius)
      )
    )

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(Slingshot(angle = 30), [100,100])
  pf.append(Slingshot(angle = 180-30), [300,100])

  scad_render_to_file( pf.assembly(), '/tmp/slingshot_example.scad')

Beispiel #10
0
inches = 25.4


class Stud(PinballPart):
    def __init__(self, radius=0.4 * inches, height=30, rubber_radius=2, rubber_position=20, rubber_height=5, **kwargs):
        super(Stud, self).__init__(**kwargs)
        self.radius = radius
        self.height = height
        self.rubber_radius = rubber_radius
        self.rubber_height = rubber_height
        self.rubber_position = rubber_position

    def part_model(self):
        stud = color([0.7, 0.7, 0.7])(translate([0, 0, -self.height])(cylinder(r=self.radius, h=2 * self.height)))
        return stud

    def mount_holes(self):
        return None

    def mount_holes_2d(self):
        return circle(r=self.radius, segments=self.segments)


if __name__ == "__main__":
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Stud(), [200, 30])

    scad_render_to_file(pf.assembly(), "/tmp/stud_example.scad")
Beispiel #11
0
        )
      ),
      translate([0,0,-1])(
        cylinder(r=m4_diameter/2, h=H+2, segments=20)
      ),

      translate([0,0,self.rubber_height])(
        rotate_extrude()(
          translate([r+d + (H-self.rubber_height)*(R-r-d)/H,0])(
            circle(r=self.rubber_radius, segments=20)
          )
        )
      )
    )
    return post

  def mount_holes(self):
    return None

  def mount_holes_2d(self):
    return None

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(Post(), [50,30])

  scad_render_to_file( pf.assembly(), '/tmp/post_example.scad')

Beispiel #12
0
    translate([0,0,-self.playfield_thickness-epsilon])(
      translate([0,0,bevel_depth])(
        cylinder(r1 = self.radius,
                 r2 = self.radius + bevel_depth,
                 h = self.playfield_thickness - bevel_depth + 2*epsilon)
      ),

      cylinder(r=self.radius, h=self.playfield_thickness + 2*epsilon)
    )
    return hole

  def mount_holes_2d(self):
    #just in case someone wants to use 
    #simple 2d playfield holes without bevels...
    return \
    circle(r=self.radius)

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(BallHole(), [50,30])
  pf.append(BallHole(), [120,300])
  pf.append(BallHole(), [200,230])
  pf.append(BallHole(), [120,70])
  pf.append(BallHole(), [230,130])
  pf.append(BallHole(radius=25), [50,140])

  scad_render_to_file( pf.assembly(), '/tmp/ballhole_example.scad')

Beispiel #13
0
    def flipper_rubber(self):
        return color(self.rubber_color)(
            translate([0, 0, self.h])(
                linear_extrude(height=self.H - self.h)(
                    difference()(
                        self.flipper_outline(
                            self.L + 2 * self.rubber_r, self.R + self.rubber_r, self.r + self.rubber_r
                        ),
                        self.flipper_outline(self.L, self.R, self.r),
                    )
                )
            )
        )

    def flipper_shaft(self, radius=5.9 / 2, length=50):
        return color("grey")(translate([0, 0, -length])(cylinder(r=radius, h=length, segments=20)))  # metalic color

    def flipper_outline(self, L, R, r):
        return hull()(circle(r=R), translate([L - r - R, 0])(circle(r=r)))


if __name__ == "__main__":
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Flipper(angle=-30), [100, 100])
    pf.append(Flipper(angle=180 + 30), [300, 100])

    scad_render_to_file(pf.assembly(), "/tmp/flipper_example.scad")
pf_height = 1185.8
playfield_variant="msdos"

class VerticalUpKicker(BallHole):
	#TODO: Implement this in SolidPinball
	pass

class BallDrain(BallHole):
	#TODO: Implement this in SolidPinball
	pass

#TODO: SolidPinball: implement the PopBumper body 3d-model
#TODO: SolidPinball: implement the Slingshot assembly 3d-model (including rubber and 3 posts automatically)
#TODO: SolidPinball: implement the 3d-model of the StardupTargets metal part

pf = Playfield(pf_width, pf_height)
pf.append_parts([
  {'part': Rollover(), 'position': [74.5,360] },
  {'part': Rollover(), 'position': [37.4,320] },
  {'part': Rollover(), 'position': [520.4, 360] },
  {'part': Rollover(), 'position': [560.5, 320] },
  {'part': Rollover(), 'position': [457,1129.5], 'rotation':-120 },
  {'part': Rollover(), 'position': [269,1147.3], 'rotation':105 },
  {'part': Inserts('../../DXF/playfield_inserts.dxf') , 'position': [0,0]}, #TODO: SolidPinball: default [0,0] value for the 'position' keyword
  {'part': Launcher(), 'position': [pf_width - 30, 100] }, # ball launcher
  {'part': BallDrain(), 'position': [303,53.5] }, # ball drain
  {'part': BallHole(), 'position': [340.2,1116.3] }, # hidden entrance
  {'part': BallHole(), 'position': [135,942] }, # million loop
  {'part': BallHole(), 'position': [266,873.5] }, # arcade
  {'part': VerticalUpKicker(), 'position': [39.5,703.5] }, # snack
  {'part': Flipper(angle=-65, rubber_color="red"), 'position': [62.5, 746.5] }, #top left
Beispiel #15
0
    def mount_holes(self):
        return None

    def laneguide(self):
        return \
        translate([0, 0, 14])(
          self.lguide.part_model()
        )

    def posts(self):
        return \
        union()(
          translate([0, self.lguide.length/2+1.5])(
            self.p1.part_model()
          ),
          translate([0, -self.lguide.length/2-1.5])(
            self.p2.part_model()
          )
        )


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(LaneGuideAssembly(), [200, 120])
    pf.append(LaneGuideAssembly(), [250, 100])
    pf.append(LaneGuideAssembly(), [300, 120])

    scad_render_to_file(pf.assembly(), '/tmp/laneguide_example.scad')
Beispiel #16
0
              translate([0,-11,1])(
                cylinder(r=9.3/2, h=4, segments = 30)
              )
            )
          )
        )
        return spring_holder

    def popbumper_screws(self):
        return empty_3d()  #TODO: implement-me!

    def popbumper_solenoid(self):
        return empty_3d()  #TODO: implement-me!

    def popbumper_footprint(self):
        '''2D footprint of the part'''
        return empty_2d()  #TODO: implement-me!


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(
        PopBumper(game="partyland", version="msdos", cap_color="darkred"),
        [150, 180])
    pf.append(PopBumper(game="stonesnbones", version="amiga"), [250, 100])
    pf.append(PopBumper(game="stonesnbones", version="msdos"), [350, 180])

    scad_render_to_file(pf.assembly(), '/tmp/popbumper_example.scad')
Beispiel #17
0
class VerticalUpKicker(BallHole):
    #TODO: Implement this in SolidPinball
    pass


class BallDrain(BallHole):
    #TODO: Implement this in SolidPinball
    pass


#TODO: SolidPinball: implement the PopBumper body 3d-model
#TODO: SolidPinball: implement the Slingshot assembly 3d-model (including rubber and 3 posts automatically)
#TODO: SolidPinball: implement the 3d-model of the StardupTargets metal part

pf = Playfield(pf_width, pf_height)
pf.append_parts([
    {
        'part': Rollover(),
        'position': [74.5, 360]
    },
    {
        'part': Rollover(),
        'position': [37.4, 320]
    },
    {
        'part': Rollover(),
        'position': [520.4, 360]
    },
    {
        'part': Rollover(),
Beispiel #18
0
  def rubber_outline(self):
    corners = empty_2d()
    for p in self.posts:
      corners += translate([p[0], p[1]])(
        circle(r=p[2], segments=20)
      )

    area = hull()(corners)

    outline = minkowski()(
      area,
      circle(r=epsilon, segments = 20)
    ) - area

    return linear_extrude(height=epsilon)(outline)

  def mount_holes(self):
    return None

  def mount_holes_2d(self):
    return None

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(Rubber(), [50,30])

  scad_render_to_file( pf.assembly(), '/tmp/rubber_example.scad')

Beispiel #19
0
            )
          )
        )

    def flipper_shaft(self, radius=5.9 / 2, length=50):
        return \
        color("grey")( #metalic color
          translate([0,0,-length])(
            cylinder(r=radius, h=length, segments=20)
          )
        )

    def flipper_outline(self, L, R, r):
        return \
        hull()(
        circle(r=R),
        translate([L-r-R,0])(
          circle(r=r)
          )
        )


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Flipper(angle=-30), [100, 100])
    pf.append(Flipper(angle=180 + 30), [300, 100])

    scad_render_to_file(pf.assembly(), '/tmp/flipper_example.scad')
Beispiel #20
0
        super(Stud, self).__init__(**kwargs)
        self.radius = radius
        self.height = height
        self.rubber_radius = rubber_radius
        self.rubber_height = rubber_height
        self.rubber_position = rubber_position

    def part_model(self):
        stud = \
     color([0.7, 0.7, 0.7])(
        translate([0,0,-self.height])(
        cylinder(r=self.radius, h=2*self.height)
        )
        )
        return stud

    def mount_holes(self):
        return None

    def mount_holes_2d(self):
        return circle(r=self.radius, segments=self.segments)


if __name__ == '__main__':
    from pinball.playfield import Playfield

    pf = Playfield(400, 600)
    pf.append(Stud(), [200, 30])

    scad_render_to_file(pf.assembly(), '/tmp/stud_example.scad')
Beispiel #21
0
          ),

          translate([0,-11,1])(
            cylinder(r=9.3/2, h=4, segments = 30)
          )
        )
      )
    )
    return spring_holder

  def popbumper_screws(self):
    return empty_3d() #TODO: implement-me!

  def popbumper_solenoid(self):
    return empty_3d() #TODO: implement-me!

  def popbumper_footprint(self):
    '''2D footprint of the part'''
    return empty_2d() #TODO: implement-me!

if __name__ == '__main__':
  from pinball.playfield import Playfield

  pf = Playfield(400,600)
  pf.append(PopBumper(game="partyland", version="msdos", cap_color="darkred"), [150,180])
  pf.append(PopBumper(game="stonesnbones", version="amiga"), [250,100])
  pf.append(PopBumper(game="stonesnbones", version="msdos"), [350,180])

  scad_render_to_file( pf.assembly(), '/tmp/popbumper_example.scad')