ShapePath.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. Questa classe viene utilizzata per convertire una serie di forme in un array di [page:Path], ad esempio una
  13. forma SVG in un path (vedere l'esempio seguente).
  14. </p>
  15. <h2>Esempi</h2>
  16. <p>
  17. [example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2]
  18. </p>
  19. <h2>Costruttore</h2>
  20. <h3>[name]( )</h3>
  21. <p>
  22. Crea un nuovo ShapePath. Diversamente da un [page:Path], non vengono passati punti poiché lo ShapePath
  23. è progettato per essere generato dopo la creazione.
  24. </p>
  25. <h2>Proprietà</h2>
  26. <h3>[property:Array subPaths]</h3>
  27. <p>
  28. Un array di [page:Path].
  29. </p>
  30. <h3>[property:Array currentPath]</h3>
  31. <p>
  32. Il [page:Path] corrente che viene generato.
  33. </p>
  34. <h3>[property:Color color]</h3>
  35. <p>Il [page:Color Colore] della shape, da impostazione predefinita impostato su bianco (0xffffff).</p>
  36. <h2>Metodi</h2>
  37. <h3>[method:this moveTo]( [param:Float x], [param:Float y] )</h3>
  38. <p>
  39. Inizia un nuovo [page:Path] e chiama [page:Path.moveTo]( x, y ) su questo [page:Path].
  40. Punta anche [page:ShapePath.currentPath currentPath] a quel [page:Path].
  41. </p>
  42. <h3>[method:this lineTo]( [param:Float x], [param:Float y] )</h3>
  43. <p>
  44. Crea una linea dall'offset del [page:ShapePath.currentPath currentPath]
  45. a X e Y e aggiorna l'offset di X e Y.
  46. </p>
  47. <h3>[method:this quadraticCurveTo]( [param:Float cpX], [param:Float cpY], [param:Float x], [param:Float y] )</h3>
  48. <p>
  49. Crea una curva quadratica dall'offset del [page:ShapePath.currentPath currentPath] a x e y con cpX e cpY
  50. come punto di controllo e aggiorna l'offset del [page:ShapePath.currentPath currentPath] di x e y.
  51. </p>
  52. <h3>[method:this bezierCurveTo]( [param:Float cp1X], [param:Float cp1Y], [param:Float cp2X], [param:Float cp2Y], [param:Float x], [param:Float y] )</h3>
  53. <p>
  54. Crea una curva bazier dall'offset del [page:ShapePath.currentPath currentPath] a x e y con
  55. cp1X, cp1Y e cp2X, cp2Y come punti di controllo e aggiorna l'offset del [page:ShapePath.currentPath currentPath] a x e y.
  56. </p>
  57. <h3>[method:this splineThru] ( [param:Array points] ) </h3>
  58. <p>points - Un array di [page:Vector2]</p>
  59. <p>Collega una nuova [page:SplineCurve] al [page:ShapePath.currentPath currentPath].</p>
  60. <h3>[method:Array toShapes]( [param:Boolean isCCW] )</h3>
  61. <p>
  62. isCCW -- Modifica la modalità di generazione degli hole e dei solidi<br/>
  63. </p>
  64. <p>
  65. Converte l'array [page:ShapePath.subPaths subPaths] in un array di Shape. Per impostazione predefinita
  66. le forme solide sono definite in senso orario (CW) e i fori sono definiti in senso antiorario (CCW).
  67. Se isCCW è impostato su `true`, le forme sono capovolte.
  68. </p>
  69. <h2>Source</h2>
  70. <p>
  71. [link:https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js src/extras/core/ShapePath.js]
  72. </p>
  73. </body>
  74. </html>