1
0

LineGeometry.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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; [page:LineSegmentsGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A chain of vertices, forming a polyline.
  14. </p>
  15. <p class="desc">
  16. This is used in [page:Line2] 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 { LineGeometry } from 'three/addons/lines/LineGeometry.js';
  25. </code>
  26. <h2>Examples</h2>
  27. <p>
  28. [example:webgl_lines_fat WebGL / lines / fat ]<br />
  29. [example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]<br />
  30. [example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]
  31. </p>
  32. <h2>Constructor</h2>
  33. <h3>[name]()</h3>
  34. <p>
  35. Creates a new geometry.
  36. Call [page:LineGeometry.setPositions setPositions] to add segments.
  37. </p>
  38. <h2>Properties</h2>
  39. <p>See the base [page:LineSegmentsGeometry] class for common properties.</p>
  40. <h3>[property:Boolean isLineGeometry]</h3>
  41. <p>Read-only flag to check if a given object is of type [name].</p>
  42. <h2>Methods</h2>
  43. <p>See the base [page:LineSegmentsGeometry] class for common methods.</p>
  44. <h3>[method:this fromLine]( [param:Line line] )</h3>
  45. <p>
  46. Copy the vertex positions of a [page:Line] object into this geometry.
  47. Assumes the source geometry is not using indices.
  48. </p>
  49. <h3>[method:this setColors]( [param:Array array] )</h3>
  50. <p>
  51. Replace the per-vertex colors.
  52. Every triple describes a line vertex: `[r1, g1, b1]`.
  53. The array can be an `Array` or `Float32Array`.
  54. </p>
  55. <h3>[method:this setPositions]( [param:Array array] )</h3>
  56. <p>
  57. Replace the vertex positions with a new set.
  58. The array can be an `Array` or `Float32Array`.
  59. The length must be a multiple of three.
  60. </p>
  61. <h2>Source</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineGeometry.js examples/jsm/lines/LineGeometry.js]
  64. </p>
  65. </body>
  66. </html>