LineSegmentsGeometry.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. [page:BufferGeometry] &rarr; [page:InstancedBufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A series of vertex pairs, forming line segments.
  14. </p>
  15. <p class="desc">
  16. This is used in [page:LineSegments2] to describe the shape.
  17. </p>
  18. <h2>Import</h2>
  19. <p>
  20. [name] is an add-on, and therefore must be imported explicitly.
  21. See [link:#manual/introduction/Installation Installation / Addons].
  22. </p>
  23. <code>
  24. import { LineSegmentsGeometry } from 'three/addons/lines/LineSegmentsGeometry.js';
  25. </code>
  26. <h2>Example</h2>
  27. <p>[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]</p>
  28. <h2>Constructor</h2>
  29. <h3>[name]()</h3>
  30. <p>
  31. Creates a new geometry.
  32. Call [page:LineSegmentsGeometry.setPositions setPositions] to add segments.
  33. </p>
  34. <h2>Properties</h2>
  35. <p>See the base [page:InstancedBufferGeometry] class for common properties.</p>
  36. <h3>[property:Boolean isLineSegmentsGeometry]</h3>
  37. <p>Read-only flag to check if a given object is of type [name].</p>
  38. <h2>Methods</h2>
  39. <p>See the base [page:Mesh] class for common methods.</p>
  40. <h3>[method:this fromEdgesGeometry]( [param:EdgesGeometry geometry] )</h3>
  41. <p>
  42. Copy the vertex positions of an edge geometry into this geometry.
  43. </p>
  44. <h3>[method:this fromLineSegments]( [param:LineSegments lineSegments] )</h3>
  45. <p>
  46. Copy the vertex positions of a [page:LineSegments] object into this geometry.
  47. Assumes the source geometry is not using indices.
  48. </p>
  49. <h3>[method:this fromMesh]( [param:Mesh mesh] )</h3>
  50. <p>
  51. Copy the vertex positions of a mesh object into this geometry.
  52. </p>
  53. <h3>[method:this fromWireframeGeometry]( [param:WireframeGeometry geometry] )</h3>
  54. <p>
  55. Copy the vertex positions of a wireframe geometry into this geometry.
  56. </p>
  57. <h3>[method:this setColors]( [param:Array array] )</h3>
  58. <p>
  59. Replace the per-vertex colors.
  60. Every sixtuple describes a segment: `[r1, g1, b1, r2, g2, b2]`.
  61. The array can be an `Array` or `Float32Array`.
  62. </p>
  63. <h3>[method:this setPositions]( [param:Array array] )</h3>
  64. <p>
  65. Replace the vertex positions with a new set.
  66. The array can be an `Array` or `Float32Array`.
  67. The length must be a multiple of six.
  68. </p>
  69. <p>
  70. See also [page:LineSegmentsGeometry.positions positions].
  71. </p>
  72. <h3>[method:undefined toJSON]()</h3>
  73. <p>
  74. Unimplemented.
  75. </p>
  76. <h2>Source</h2>
  77. <p>
  78. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegmentsGeometry.js examples/jsm/lines/LineSegmentsGeometry.js]
  79. </p>
  80. </body>
  81. </html>