VolumeSlice.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VolumeSlice - 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. <h1 translate="no">VolumeSlice</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class has been made to hold a slice of a volume data.</p></div>
  16. </header>
  17. <article>
  18. <h2 class="subsection-title">Import</h2>
  19. <p><span translate="no">VolumeSlice</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>
  20. <pre><code class="language-js">import { VolumeSlice } from 'three/addons/misc/VolumeSlice.js';</code></pre>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="VolumeSlice" translate="no">new <a href="#VolumeSlice">VolumeSlice</a><span class="signature">( volume : <span class="param-type"><a href="Volume.html">Volume</a></span>, index : <span class="param-type">number</span>, axis : <span class="param-type">'x' | 'y' | 'z'</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new volume slice.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>volume</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The associated volume.</p>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="name">
  40. <strong>index</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The index of the slice.</p>
  44. <p>Default is <code>0</code>.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>axis</strong>
  50. </td>
  51. <td class="description last">
  52. <p>For now only 'x', 'y' or 'z' but later it will change to a normal vector.</p>
  53. <p>Default is <code>'z'</code>.</p>
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. <dl class="details">
  59. <dt class="tag-see">See:</dt>
  60. <dd class="tag-see">
  61. <ul>
  62. <li><a href="Volume.html">Volume</a></li>
  63. </ul>
  64. </dd>
  65. </dl>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="axis" translate="no">.<a href="#axis">axis</a><span class="type-signature"> : 'x' | 'y' | 'z'</span> </h3>
  71. <div class="description">
  72. <p>The normal axis.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="canvas" translate="no">.<a href="#canvas">canvas</a><span class="type-signature"> : HTMLCanvasElement</span> </h3>
  77. <div class="description">
  78. <p>The final canvas used for the texture.</p>
  79. </div>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="canvasBuffer" translate="no">.<a href="#canvasBuffer">canvasBuffer</a><span class="type-signature"> : HTMLCanvasElement</span> </h3>
  83. <div class="description">
  84. <p>The intermediary canvas used to paint the data.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="ctx" translate="no">.<a href="#ctx">ctx</a><span class="type-signature"> : CanvasRenderingContext2D</span> </h3>
  89. <div class="description">
  90. <p>The rendering context of the canvas.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="ctxBuffer" translate="no">.<a href="#ctxBuffer">ctxBuffer</a><span class="type-signature"> : CanvasRenderingContext2D</span> </h3>
  95. <div class="description">
  96. <p>The rendering context of the canvas buffer,</p>
  97. </div>
  98. </div>
  99. <div class="member">
  100. <h3 class="name" id="geometryNeedsUpdate" translate="no">.<a href="#geometryNeedsUpdate">geometryNeedsUpdate</a><span class="type-signature"> : boolean</span> </h3>
  101. <div class="description">
  102. <p>If set to <code>true</code>, <code>updateGeometry()</code> will be triggered at the next repaint.</p>
  103. <p>Default is <code>true</code>.</p>
  104. </div>
  105. </div>
  106. <div class="member">
  107. <h3 class="name" id="iLength" translate="no">.<a href="#iLength">iLength</a><span class="type-signature"> : number</span> </h3>
  108. <div class="description">
  109. <p>Width of slice in the original coordinate system, corresponds to the width of the buffer canvas.</p>
  110. <p>Default is <code>0</code>.</p>
  111. </div>
  112. </div>
  113. <div class="member">
  114. <h3 class="name" id="index" translate="no">.<a href="#index">index</a><span class="type-signature"> : number</span> </h3>
  115. <div class="description">
  116. <p>The index of the slice, if changed, will automatically call updateGeometry at the next repaint.</p>
  117. <p>Default is <code>0</code>.</p>
  118. </div>
  119. </div>
  120. <div class="member">
  121. <h3 class="name" id="jLength" translate="no">.<a href="#jLength">jLength</a><span class="type-signature"> : number</span> </h3>
  122. <div class="description">
  123. <p>Height of slice in the original coordinate system, corresponds to the height of the buffer canvas.</p>
  124. <p>Default is <code>0</code>.</p>
  125. </div>
  126. </div>
  127. <div class="member">
  128. <h3 class="name" id="mesh" translate="no">.<a href="#mesh">mesh</a><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  129. <div class="description">
  130. <p>The mesh ready to get used in the scene.</p>
  131. </div>
  132. </div>
  133. <div class="member">
  134. <h3 class="name" id="sliceAccess" translate="no">.<a href="#sliceAccess">sliceAccess</a><span class="type-signature"> : function</span> </h3>
  135. <div class="description">
  136. <p>Function that allow the slice to access right data.</p>
  137. </div>
  138. <dl class="details">
  139. <dt class="tag-see">See:</dt>
  140. <dd class="tag-see">
  141. <ul>
  142. <li><a href="Volume.html#extractPerpendicularPlane">Volume#extractPerpendicularPlane</a></li>
  143. </ul>
  144. </dd>
  145. </dl>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="volume" translate="no">.<a href="#volume">volume</a><span class="type-signature"> : <a href="Volume.html">Volume</a></span> </h3>
  149. <div class="description">
  150. <p>The associated volume.</p>
  151. </div>
  152. </div>
  153. <h2 class="subsection-title">Methods</h2>
  154. <h3 class="name name-method" id="repaint" translate="no">.<a href="#repaint">repaint</a><span class="signature">()</span> </h3>
  155. <div class="method">
  156. <div class="description">
  157. <p>Refresh the texture and the geometry if geometryNeedsUpdate is set to <code>true</code>.</p>
  158. </div>
  159. </div>
  160. <h3 class="name name-method" id="updateGeometry" translate="no">.<a href="#updateGeometry">updateGeometry</a><span class="signature">()</span> </h3>
  161. <div class="method">
  162. <div class="description">
  163. <p>Refresh the geometry according to axis and index.</p>
  164. </div>
  165. <dl class="details">
  166. <dt class="tag-see">See:</dt>
  167. <dd class="tag-see">
  168. <ul>
  169. <li><a href="Volume.html#extractPerpendicularPlane">Volume#extractPerpendicularPlane</a></li>
  170. </ul>
  171. </dd>
  172. </dl>
  173. </div>
  174. <h2 class="subsection-title">Source</h2>
  175. <p>
  176. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/VolumeSlice.js" translate="no" target="_blank" rel="noopener">examples/jsm/misc/VolumeSlice.js</a>
  177. </p>
  178. </article>
  179. </section>
  180. <script src="../scripts/linenumber.js"></script>
  181. <script src="../scripts/page.js"></script>
  182. </body>
  183. </html>
粤ICP备19079148号