index.html 827 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <html>
  2. <head>
  3. <title>test</title>
  4. </head>
  5. <body>
  6. <div id="txt">
  7. function r_from_dia(d) = d / 2;
  8. module rotcy(rot, r, h) {
  9. rotate(90, rot)
  10. cylinder(r = r, h = h, center = true);
  11. }
  12. difference() {
  13. sphere(r = r_from_dia(size));
  14. rotcy([0, 0, 0], cy_r, cy_h);
  15. rotcy([1, 0, 0], cy_r, cy_h);
  16. rotcy([0, 1, 0], cy_r, cy_h);
  17. }
  18. size = 50;
  19. hole = 25;
  20. cy_r = r_from_dia(hole);
  21. cy_h = r_from_dia(size * 2.5);
  22. </div>
  23. <script type="text/javascript" src="../lib/underscore.js"></script>
  24. <script type="text/javascript" src="../lib/jquery.js"></script>
  25. <script src="../dist/web-built.js"></script>
  26. <script type="text/javascript">
  27. $(function(){
  28. console.log(openscadOpenJscadParser.parse($('#txt').text()));
  29. })
  30. </script>
  31. </body>
  32. </html>