by matthias.peitsch 2 years, 8 months ago
4 times 1.38s avg. build time

Cover

Click to change title and description

License: CreativeCommons-ShareAlike Publicly Listed: False Tags: None

Log in to download models or make your own copy!

Auto Apply Changes

  1. #
  2. # Important MetaData
  3. #
  4. UOM = "mm"
  5. basewidth = FloatParam(min=23.5,max=35.0,presets={'default':26.0,'small':23.5,'big':35.0},group="Basics", desc="Diameter");
  6. constantheight = 7.0;
  7. constanthole = 46.0;
  8. # needs another hole to cover the face above.
  9. # Also needs to be thicker than the below circle by about
  10. topface = FloatParam(min=22.0,max=35.0,presets={'default':25.0,'small':23.5,'big':35.0},group="Basics", desc="Diameter");
  11. topfaceheight = FloatParam(min=1.0,max=20.0,presets={'default':2.0,'small':1.0,'big':15.0},group="Basics", desc="Height");
  12. topfacediameterconstant = 44.0;
  13. strapwidth = 22.0;
  14. strapdepth = 3.0;
  15. sideHole = 2.5;
  16. clipCircle = (constanthole*0.915)*0.5;
  17. #clip
  18. clip = Workplane("XY").circle(clipCircle).extrude(0.5).faces("|Z").shell(basewidth.value-clipCircle)
  19. #case
  20. case = Workplane("XY").circle(basewidth.value).extrude(constantheight)
  21. insidecase = Workplane("XY").circle(constanthole/2).extrude(constantheight)
  22. case.faces(">Z").workplane().cut(insidecase)
  23. #Lip
  24. #lip = Workplane("XY").faces("Z").circle(topface.value).extrude(topfaceheight.value)
  25. #insidelip = Workplane("XY").circle(topfacediameterconstant/2).extrude(topfaceheight.value+constantheight)
  26. #lip.faces(">Z").workplane().cut(insidelip)
  27. #c.faces("+Z").workplane().circle(topface.value).extrude(topfaceheight.value).faces("+Z").workplane().hole(topfacediameterconstant,topfaceheight.value)
  28. #button hole
  29. #c.faces(">X").workplane(offset=0.75).center(0,sideHoleCentre).hole(sideHole)
  30. insidebutton = Workplane("XZ").circle(sideHole).extrude(basewidth.value)
  31. #Strap box
  32. boxSquare = Workplane("XY").box(basewidth.value*2,strapwidth,strapdepth)
  33. #combination of elements for final cuts.
  34. final = case.union(clip)
  35. #final = prefinal.union(lip)
  36. #apply cuts
  37. final.faces("+Z").workplane().cut(boxSquare)
  38. final.faces("+Z").workplane().center(-10.0,0).cut(insidebutton)
  39. def build():
  40. return final