by wehosea 1 year, 8 months ago
5 times 1.35s avg. build time

SD Card Holder

Click to change title and description

License: CreativeCommons-ShareAlike Publicly Listed: True Tags: SD_Card

Log in to download models or make your own copy!

Auto Apply Changes

  1. #
  2. # Important MetaData
  3. #
  4. UOM = "mm"
  5. fillet_all= BooleanParam(presets={'default':True}, group='Fillet')
  6. fillet_r = FloatParam(presets={'default': 2.5}, group='Fillet')
  7. sd_x = 3.0
  8. sd_y = 24.75
  9. sd_z = 35.5
  10. col = IntegerParam(min=1, max=10, presets={'default':5}, group='Options')
  11. row= IntegerParam(min=1, max=10, presets={'default':1}, group='Options')
  12. border = FloatParam(presets={'default': 6.0}, group='Options')
  13. x_spacer = FloatParam(presets={'default': 6.0}, group='Options')
  14. y_spacer = FloatParam(presets={'default': 6.0}, group='Options')
  15. base_height = FloatParam(presets={'default': 6.0}, group='Options')
  16. def build():
  17. height = sd_z*.4 + base_height.value
  18. length = border.value * 2 + sd_x * col.value + x_spacer.value * (col.value - 1)
  19. width = border.value * 2 + sd_y * row.value + y_spacer.value * (row.value -1)
  20. sd_points=[]
  21. for c in range(col.value):
  22. for r in range (row.value):
  23. y=border.value+r*(sd_y+y_spacer.value)
  24. x=border.value+c*(sd_x+x_spacer.value)
  25. sd_points.append((x,y))
  26. base = Workplane('XY').box(length, width, height)
  27. sd_grid = base.faces(">Z").vertices("<XY").workplane().pushPoints(sd_points).rect(sd_x,sd_y, centered=False).extrude(-height+base_height.value,False)
  28. holder = base.cut(sd_grid)
  29. if fillet_all.value:
  30. holder = holder.edges("+Z").fillet(fillet_r.value).edges('+X').fillet(fillet_r.value)
  31. return holder