VolumeSlice.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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">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">Volume</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"><code>volume</code></td>
  32. <td class="description last"><p>The associated volume.</p></td>
  33. </tr>
  34. <tr>
  35. <td class="name"><code>index</code></td>
  36. <td class="description last"><p>The index of the slice.<br/>Default is <code>0</code>.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>axis</code></td>
  40. <td class="description last"><p>For now only 'x', 'y' or 'z' but later it will change to a normal vector.<br/>Default is <code>'z'</code>.</p></td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. <dl class="details">
  45. <dt class="tag-see">See:</dt>
  46. <dd class="tag-see">
  47. <ul>
  48. <li><a href="Volume.html">Volume</a></li>
  49. </ul>
  50. </dd>
  51. </dl>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="axis" translate="no">.<a href="#axis">axis</a><span class="type-signature"> : 'x' | 'y' | 'z'</span> </h3>
  57. <div class="description">
  58. <p>The normal axis.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="canvas" translate="no">.<a href="#canvas">canvas</a><span class="type-signature"> : HTMLCanvasElement</span> </h3>
  63. <div class="description">
  64. <p>The final canvas used for the texture.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="canvasBuffer" translate="no">.<a href="#canvasBuffer">canvasBuffer</a><span class="type-signature"> : HTMLCanvasElement</span> </h3>
  69. <div class="description">
  70. <p>The intermediary canvas used to paint the data.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <h3 class="name" id="ctx" translate="no">.<a href="#ctx">ctx</a><span class="type-signature"> : CanvasRenderingContext2D</span> </h3>
  75. <div class="description">
  76. <p>The rendering context of the canvas.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="ctxBuffer" translate="no">.<a href="#ctxBuffer">ctxBuffer</a><span class="type-signature"> : CanvasRenderingContext2D</span> </h3>
  81. <div class="description">
  82. <p>The rendering context of the canvas buffer,</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="geometryNeedsUpdate" translate="no">.<a href="#geometryNeedsUpdate">geometryNeedsUpdate</a><span class="type-signature"> : boolean</span> </h3>
  87. <div class="description">
  88. <p>If set to <code>true</code>, <code>updateGeometry()</code> will be triggered at the next repaint.<br/>Default is <code>true</code>.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <h3 class="name" id="iLength" translate="no">.<a href="#iLength">iLength</a><span class="type-signature"> : number</span> </h3>
  93. <div class="description">
  94. <p>Width of slice in the original coordinate system, corresponds to the width of the buffer canvas.<br/>Default is <code>0</code>.</p>
  95. </div>
  96. </div>
  97. <div class="member">
  98. <h3 class="name" id="index" translate="no">.<a href="#index">index</a><span class="type-signature"> : number</span> </h3>
  99. <div class="description">
  100. <p>The index of the slice, if changed, will automatically call updateGeometry at the next repaint.<br/>Default is <code>0</code>.</p>
  101. </div>
  102. </div>
  103. <div class="member">
  104. <h3 class="name" id="jLength" translate="no">.<a href="#jLength">jLength</a><span class="type-signature"> : number</span> </h3>
  105. <div class="description">
  106. <p>Height of slice in the original coordinate system, corresponds to the height of the buffer canvas.<br/>Default is <code>0</code>.</p>
  107. </div>
  108. </div>
  109. <div class="member">
  110. <h3 class="name" id="mesh" translate="no">.<a href="#mesh">mesh</a><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
  111. <div class="description">
  112. <p>The mesh ready to get used in the scene.</p>
  113. </div>
  114. </div>
  115. <div class="member">
  116. <h3 class="name" id="sliceAccess" translate="no">.<a href="#sliceAccess">sliceAccess</a><span class="type-signature"> : function</span> </h3>
  117. <div class="description">
  118. <p>Function that allow the slice to access right data.</p>
  119. </div>
  120. <dl class="details">
  121. <dt class="tag-see">See:</dt>
  122. <dd class="tag-see">
  123. <ul>
  124. <li><a href="Volume.html#extractPerpendicularPlane">Volume#extractPerpendicularPlane</a></li>
  125. </ul>
  126. </dd>
  127. </dl>
  128. </div>
  129. <div class="member">
  130. <h3 class="name" id="volume" translate="no">.<a href="#volume">volume</a><span class="type-signature"> : <a href="Volume.html">Volume</a></span> </h3>
  131. <div class="description">
  132. <p>The associated volume.</p>
  133. </div>
  134. </div>
  135. <h2 class="subsection-title">Methods</h2>
  136. <h3 class="name name-method" id="repaint" translate="no">.<a href="#repaint">repaint</a><span class="signature">()</span> </h3>
  137. <div class="method">
  138. <div class="description">
  139. <p>Refresh the texture and the geometry if geometryNeedsUpdate is set to <code>true</code>.</p>
  140. </div>
  141. </div>
  142. <h3 class="name name-method" id="updateGeometry" translate="no">.<a href="#updateGeometry">updateGeometry</a><span class="signature">()</span> </h3>
  143. <div class="method">
  144. <div class="description">
  145. <p>Refresh the geometry according to axis and index.</p>
  146. </div>
  147. <dl class="details">
  148. <dt class="tag-see">See:</dt>
  149. <dd class="tag-see">
  150. <ul>
  151. <li><a href="Volume.html#extractPerpendicularPlane">Volume#extractPerpendicularPlane</a></li>
  152. </ul>
  153. </dd>
  154. </dl>
  155. </div>
  156. <h2 class="subsection-title">Source</h2>
  157. <p>
  158. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/VolumeSlice.js" target="_blank" rel="noopener" translate="no">examples/jsm/misc/VolumeSlice.js</a>
  159. </p>
  160. </article>
  161. </section>
  162. <script src="../scripts/linenumber.js"></script>
  163. <script src="../scripts/page.js"></script>
  164. </body>
  165. </html>
粤ICP备19079148号