LineSegmentsGeometry.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LineSegmentsGeometry - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="InstancedBufferGeometry.html">InstancedBufferGeometry</a> → </p>
  13. <h1 translate="no">LineSegmentsGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A series of vertex pairs, forming line segments.</p>
  17. <p>This is used in <a href="LineSegments2.html">LineSegments2</a> to describe the shape.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">LineSegmentsGeometry</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  22. <pre><code class="language-js">import { LineSegmentsGeometry } from 'three/addons/lines/LineSegmentsGeometry.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="LineSegmentsGeometry" translate="no">new <a href="#LineSegmentsGeometry">LineSegmentsGeometry</a><span class="signature">()</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new line segments geometry.</p>
  29. </div>
  30. </div>
  31. </div>
  32. <h2 class="subsection-title">Properties</h2>
  33. <div class="member">
  34. <h3 class="name" id="isLineSegmentsGeometry" translate="no">.<a href="#isLineSegmentsGeometry">isLineSegmentsGeometry</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  35. <div class="description">
  36. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  37. </div>
  38. </div>
  39. <h2 class="subsection-title">Methods</h2>
  40. <h3 class="name name-method" id="applyMatrix4" translate="no">.<a href="#applyMatrix4">applyMatrix4</a><span class="signature">( matrix : <span class="param-type">Matrix4</span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  41. <div class="method">
  42. <div class="description">
  43. <p>Applies the given 4x4 transformation matrix to the geometry.</p>
  44. </div>
  45. <table class="params">
  46. <tbody>
  47. <tr>
  48. <td class="name"><code>matrix</code></td>
  49. <td class="description last"><p>The matrix to apply.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. <dl class="details">
  54. <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
  55. </dl>
  56. </div>
  57. <h3 class="name name-method" id="fromEdgesGeometry" translate="no">.<a href="#fromEdgesGeometry">fromEdgesGeometry</a><span class="signature">( geometry : <span class="param-type">EdgesGeometry</span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  58. <div class="method">
  59. <div class="description">
  60. <p>Setups this line segments geometry from the given edges geometry.</p>
  61. </div>
  62. <table class="params">
  63. <tbody>
  64. <tr>
  65. <td class="name"><code>geometry</code></td>
  66. <td class="description last"><p>The geometry that should be used as a data source for this geometry.</p></td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <dl class="details">
  71. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  72. </dl>
  73. </div>
  74. <h3 class="name name-method" id="fromLineSegments" translate="no">.<a href="#fromLineSegments">fromLineSegments</a><span class="signature">( lineSegments : <span class="param-type">LineSegments</span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Setups this line segments geometry from the given line segments.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name"><code>lineSegments</code></td>
  83. <td class="description last"><p>The line segments that should be used as a data source for this geometry.
  84. Assumes the source geometry is not using indices.</p></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="fromMesh" translate="no">.<a href="#fromMesh">fromMesh</a><span class="signature">( mesh : <span class="param-type">Mesh</span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Setups this line segments geometry from the given mesh.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>mesh</code></td>
  101. <td class="description last"><p>The mesh geometry that should be used as a data source for this geometry.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. <dl class="details">
  106. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  107. </dl>
  108. </div>
  109. <h3 class="name name-method" id="fromWireframeGeometry" translate="no">.<a href="#fromWireframeGeometry">fromWireframeGeometry</a><span class="signature">( geometry : <span class="param-type">WireframeGeometry</span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  110. <div class="method">
  111. <div class="description">
  112. <p>Setups this line segments geometry from the given wireframe geometry.</p>
  113. </div>
  114. <table class="params">
  115. <tbody>
  116. <tr>
  117. <td class="name"><code>geometry</code></td>
  118. <td class="description last"><p>The geometry that should be used as a data source for this geometry.</p></td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <dl class="details">
  123. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  124. </dl>
  125. </div>
  126. <h3 class="name name-method" id="setColors" translate="no">.<a href="#setColors">setColors</a><span class="signature">( array : <span class="param-type">Float32Array | Array.&lt;number></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>Sets the given line colors for this geometry. The length must be a multiple of six since
  130. each line segment is defined by a start end color in the pattern <code>(rgb rgb)</code>.</p>
  131. </div>
  132. <table class="params">
  133. <tbody>
  134. <tr>
  135. <td class="name"><code>array</code></td>
  136. <td class="description last"><p>The position data to set.</p></td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. <dl class="details">
  141. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  142. </dl>
  143. </div>
  144. <h3 class="name name-method" id="setPositions" translate="no">.<a href="#setPositions">setPositions</a><span class="signature">( array : <span class="param-type">Float32Array | Array.&lt;number></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  145. <div class="method">
  146. <div class="description">
  147. <p>Sets the given line positions for this geometry. The length must be a multiple of six since
  148. each line segment is defined by a start end vertex in the pattern <code>(xyz xyz)</code>.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name"><code>array</code></td>
  154. <td class="description last"><p>The position data to set.</p></td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. <dl class="details">
  159. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  160. </dl>
  161. </div>
  162. <h2 class="subsection-title">Source</h2>
  163. <p>
  164. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegmentsGeometry.js" target="_blank" rel="noopener" translate="no">examples/jsm/lines/LineSegmentsGeometry.js</a>
  165. </p>
  166. </article>
  167. </section>
  168. <script src="../scripts/linenumber.js"></script>
  169. <script src="../scripts/page.js"></script>
  170. </body>
  171. </html>
粤ICP备19079148号