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.

78 lines
3.8 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Arcs Testing</title>
  6. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  7. <script type="text/paperscript" canvas="canvas">
  8. project.importSVG(document.getElementById('svg'), {
  9. applyMatrix: false
  10. });
  11. </script>
  12. </head>
  13. <body>
  14. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1000" height="500" id="svg" viewBox="0 0 1000 500">
  15. <g transform="scale(0.5)">
  16. <path d="M300,200 h-150 a150,150 0 1,0 150,-150 z"
  17. fill="red" stroke="blue" stroke-width="5" />
  18. <path d="M275,175 v-150 a150,150 0 0,0 -150,150 z"
  19. fill="yellow" stroke="blue" stroke-width="5" />
  20. <path d="M600,350 l 50,-25
  21. a25,25 -30 0,1 50,-25 l 50,-25
  22. a25,50 -30 0,1 50,-25 l 50,-25
  23. a25,75 -30 0,1 50,-25 l 50,-25
  24. a25,100 -30 0,1 50,-25 l 50,-25"
  25. fill="none" stroke="red" stroke-width="5" />
  26. <g font-family="Verdana" transform="translate(0,400)">
  27. <defs>
  28. <g id="baseEllipses" font-size="20" >
  29. <ellipse cx="125" cy="125" rx="100" ry="50"
  30. fill="none" stroke="#888888" stroke-width="2" />
  31. <ellipse cx="225" cy="75" rx="100" ry="50"
  32. fill="none" stroke="#888888" stroke-width="2" />
  33. <text x="35" y="70">Arc start</text>
  34. <text x="225" y="145">Arc end</text>
  35. </g>
  36. </defs>
  37. <rect x="1" y="1" width="1198" height="523"
  38. fill="none" stroke="blue" stroke-width="1" />
  39. <g font-size="30" >
  40. <g transform="translate(0,0)">
  41. <use xlink:href="#baseEllipses"/>
  42. </g>
  43. <g transform="translate(400,0)">
  44. <text x="50" y="210">large-arc-flag=0</text>
  45. <text x="50" y="250">sweep-flag=0</text>
  46. <use xlink:href="#baseEllipses"/>
  47. <path d="M 125,75 a100,50 0 0,0 100,50"
  48. fill="none" stroke="red" stroke-width="6" />
  49. </g>
  50. <g transform="translate(800,0)">
  51. <text x="50" y="210">large-arc-flag=0</text>
  52. <text x="50" y="250">sweep-flag=1</text>
  53. <use xlink:href="#baseEllipses"/>
  54. <path d="M 125,75 a100,50 0 0,1 100,50"
  55. fill="none" stroke="red" stroke-width="6" />
  56. </g>
  57. <g transform="translate(400,250)">
  58. <text x="50" y="210">large-arc-flag=1</text>
  59. <text x="50" y="250">sweep-flag=0</text>
  60. <use xlink:href="#baseEllipses"/>
  61. <path d="M 125,75 a100,50 0 1,0 100,50"
  62. fill="none" stroke="red" stroke-width="6" />
  63. </g>
  64. <g transform="translate(800,250)">
  65. <text x="50" y="210">large-arc-flag=1</text>
  66. <text x="50" y="250">sweep-flag=1</text>
  67. <use xlink:href="#baseEllipses"/>
  68. <path d="M 125,75 a100,50 0 1,1 100,50"
  69. fill="none" stroke="red" stroke-width="6" />
  70. </g>
  71. </g>
  72. </g>
  73. </g>
  74. </svg>
  75. <canvas id="canvas" width="1000" height="500"></canvas>
  76. </body>
  77. </html>