You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Random Path Testing</title>
  6. <link rel="stylesheet" href="../css/style.css">
  7. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  8. <script type="text/paperscript" canvas="canvas1">
  9. var center = new Point(100, 100);
  10. var sides = 3;
  11. var radius = 50;
  12. var triangle = new Path.RegularPolygon(center, sides, radius);
  13. triangle.fillColor = 'black';
  14. copy = triangle.clone();
  15. copy.strokeColor = 'blue';
  16. copy.rotate(45);
  17. var center = new Point(100, 300);
  18. var sides = 10;
  19. var radius = 50;
  20. var decahedron = new Path.RegularPolygon(center, sides, radius);
  21. decahedron.fillColor = 'black';
  22. var center = new Point(100, 400);
  23. var points = 6;
  24. var radius1 = 20;
  25. var radius2 = 50;
  26. var path = new Path.Star(center, points, radius1, radius2);
  27. path.fillColor = 'black';
  28. window._json = project.exportJSON();
  29. console.log(window._json);
  30. </script>
  31. <script type="text/paperscript" canvas="canvas2">
  32. project.importJSON(window._json);
  33. </script>
  34. </head>
  35. <body>
  36. <canvas id="canvas1" width="500" height="500"></canvas>
  37. <canvas id="canvas2" width="500" height="500"></canvas>
  38. </body>
  39. </html>