LineSegmentsGeometry.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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" rel="noopener">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.</p>
  37. <p>Default is <code>true</code>.</p>
  38. </div>
  39. </div>
  40. <h2 class="subsection-title">Methods</h2>
  41. <h3 class="name name-method" id="applyMatrix4" translate="no">.<a href="#applyMatrix4">applyMatrix4</a><span class="signature">( matrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  42. <div class="method">
  43. <div class="description">
  44. <p>Applies the given 4x4 transformation matrix to the geometry.</p>
  45. </div>
  46. <table class="params">
  47. <tbody>
  48. <tr>
  49. <td class="name">
  50. <strong>matrix</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The matrix to apply.</p>
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. <dl class="details">
  59. <dt class="tag-returns"><strong>Returns:</strong> A reference to this instance.</dt>
  60. </dl>
  61. </div>
  62. <h3 class="name name-method" id="fromEdgesGeometry" translate="no">.<a href="#fromEdgesGeometry">fromEdgesGeometry</a><span class="signature">( geometry : <span class="param-type"><a href="EdgesGeometry.html">EdgesGeometry</a></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  63. <div class="method">
  64. <div class="description">
  65. <p>Setups this line segments geometry from the given edges geometry.</p>
  66. </div>
  67. <table class="params">
  68. <tbody>
  69. <tr>
  70. <td class="name">
  71. <strong>geometry</strong>
  72. </td>
  73. <td class="description last">
  74. <p>The geometry that should be used as a data source for this geometry.</p>
  75. </td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. <dl class="details">
  80. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  81. </dl>
  82. </div>
  83. <h3 class="name name-method" id="fromLineSegments" translate="no">.<a href="#fromLineSegments">fromLineSegments</a><span class="signature">( lineSegments : <span class="param-type"><a href="LineSegments.html">LineSegments</a></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  84. <div class="method">
  85. <div class="description">
  86. <p>Setups this line segments geometry from the given line segments.</p>
  87. </div>
  88. <table class="params">
  89. <tbody>
  90. <tr>
  91. <td class="name">
  92. <strong>lineSegments</strong>
  93. </td>
  94. <td class="description last">
  95. <p>The line segments that should be used as a data source for this geometry.
  96. Assumes the source geometry is not using indices.</p>
  97. </td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <dl class="details">
  102. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  103. </dl>
  104. </div>
  105. <h3 class="name name-method" id="fromMesh" translate="no">.<a href="#fromMesh">fromMesh</a><span class="signature">( mesh : <span class="param-type"><a href="Mesh.html">Mesh</a></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  106. <div class="method">
  107. <div class="description">
  108. <p>Setups this line segments geometry from the given mesh.</p>
  109. </div>
  110. <table class="params">
  111. <tbody>
  112. <tr>
  113. <td class="name">
  114. <strong>mesh</strong>
  115. </td>
  116. <td class="description last">
  117. <p>The mesh geometry that should be used as a data source for this geometry.</p>
  118. </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="fromWireframeGeometry" translate="no">.<a href="#fromWireframeGeometry">fromWireframeGeometry</a><span class="signature">( geometry : <span class="param-type"><a href="WireframeGeometry.html">WireframeGeometry</a></span> )</span><span class="type-signature"> : <a href="LineSegmentsGeometry.html">LineSegmentsGeometry</a></span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>Setups this line segments geometry from the given wireframe geometry.</p>
  130. </div>
  131. <table class="params">
  132. <tbody>
  133. <tr>
  134. <td class="name">
  135. <strong>geometry</strong>
  136. </td>
  137. <td class="description last">
  138. <p>The geometry that should be used as a data source for this geometry.</p>
  139. </td>
  140. </tr>
  141. </tbody>
  142. </table>
  143. <dl class="details">
  144. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  145. </dl>
  146. </div>
  147. <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>
  148. <div class="method">
  149. <div class="description">
  150. <p>Sets the given line colors for this geometry. The length must be a multiple of six since
  151. each line segment is defined by a start end color in the pattern <code>(rgb rgb)</code>.</p>
  152. </div>
  153. <table class="params">
  154. <tbody>
  155. <tr>
  156. <td class="name">
  157. <strong>array</strong>
  158. </td>
  159. <td class="description last">
  160. <p>The position data to set.</p>
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. <dl class="details">
  166. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  167. </dl>
  168. </div>
  169. <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>
  170. <div class="method">
  171. <div class="description">
  172. <p>Sets the given line positions for this geometry. The length must be a multiple of six since
  173. each line segment is defined by a start end vertex in the pattern <code>(xyz xyz)</code>.</p>
  174. </div>
  175. <table class="params">
  176. <tbody>
  177. <tr>
  178. <td class="name">
  179. <strong>array</strong>
  180. </td>
  181. <td class="description last">
  182. <p>The position data to set.</p>
  183. </td>
  184. </tr>
  185. </tbody>
  186. </table>
  187. <dl class="details">
  188. <dt class="tag-returns"><strong>Returns:</strong> A reference to this geometry.</dt>
  189. </dl>
  190. </div>
  191. <h2 class="subsection-title">Source</h2>
  192. <p>
  193. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegmentsGeometry.js" translate="no" target="_blank" rel="noopener">examples/jsm/lines/LineSegmentsGeometry.js</a>
  194. </p>
  195. </article>
  196. </section>
  197. <script src="../scripts/linenumber.js"></script>
  198. <script src="../scripts/page.js"></script>
  199. </body>
  200. </html>
粤ICP备19079148号