PLYExporter.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PLYExporter - 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">PLYExporter</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>An exporter for PLY.</p>
  16. <p>PLY (Polygon or Stanford Triangle Format) is a file format for efficient delivery and
  17. loading of simple, static 3D content in a dense format. Both binary and ascii formats are
  18. supported. PLY can store vertex positions, colors, normals and uv coordinates. No textures
  19. or texture references are saved.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const exporter = new PLYExporter();
  22. const data = exporter.parse( scene, options );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <p><span translate="no">PLYExporter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  28. <pre><code class="language-js">import { PLYExporter } from 'three/addons/exporters/PLYExporter.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="PLYExporter" translate="no">new <a href="#PLYExporter">PLYExporter</a><span class="signature">()</span> </h3>
  32. <div class="method">
  33. </div>
  34. </div>
  35. <h2 class="subsection-title">Methods</h2>
  36. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( object : <span class="param-type">Object3D</span>, onDone : <span class="param-type">PLYExporter~OnDone</span>, options : <span class="param-type">PLYExporter~Options</span> )</span><span class="type-signature"> : string | ArrayBuffer</span> </h3>
  37. <div class="method">
  38. <div class="description">
  39. <p>Parses the given 3D object and generates the PLY output.</p>
  40. <p>If the 3D object is composed of multiple children and geometry, they are merged into a single mesh in the file.</p>
  41. </div>
  42. <table class="params">
  43. <tbody>
  44. <tr>
  45. <td class="name"><code>object</code></td>
  46. <td class="description last"><p>The 3D object to export.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>onDone</code></td>
  50. <td class="description last"><p>A callback function that is executed when the export has finished.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>options</code></td>
  54. <td class="description last"><p>The export options.</p></td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. <dl class="details">
  59. <dt class="tag-returns"><strong>Returns:</strong> The exported PLY.</dt>
  60. </dl>
  61. </div>
  62. <h2 class="subsection-title">Type Definitions</h2>
  63. <h3 class="name name-method" id="~OnDone" translate="no">.<a href="#~OnDone">OnDone</a><span class="signature">( result : <span class="param-type">string | ArrayBuffer</span> )</span> </h3>
  64. <div class="method">
  65. <div class="description">
  66. <p>onDone callback of <code>PLYExporter</code>.</p>
  67. </div>
  68. <table class="params">
  69. <tbody>
  70. <tr>
  71. <td class="name"><code>result</code></td>
  72. <td class="description last"><p>The generated PLY ascii or binary.</p></td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </div>
  77. <div class="member">
  78. <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
  79. <div class="description">
  80. <p>Export options of <code>PLYExporter</code>.</p>
  81. </div>
  82. <h5 class="subsection-title">Properties:</h5>
  83. <table class="props">
  84. <thead>
  85. <tr>
  86. <th>Name</th>
  87. <th>Type</th>
  88. <th>Attributes</th>
  89. <th>Default</th>
  90. <th class="last">Description</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <tr>
  95. <td class="name"><code>binary</code></td>
  96. <td class="type">
  97. <span class="param-type">boolean</span>
  98. </td>
  99. <td class="attributes">
  100. &lt;optional><br>
  101. </td>
  102. <td class="default">
  103. false
  104. </td>
  105. <td class="description last"><p>Whether to export in binary format or ASCII.</p></td>
  106. </tr>
  107. <tr>
  108. <td class="name"><code>excludeAttributes</code></td>
  109. <td class="type">
  110. <span class="param-type">Array.&lt;string></span>
  111. </td>
  112. <td class="attributes">
  113. &lt;optional><br>
  114. </td>
  115. <td class="default">
  116. </td>
  117. <td class="description last"><p>Which properties to explicitly exclude from
  118. the exported PLY file. Valid values are <code>'color'</code>, <code>'normal'</code>, <code>'uv'</code>, and <code>'index'</code>. If triangle
  119. indices are excluded, then a point cloud is exported.</p></td>
  120. </tr>
  121. <tr>
  122. <td class="name"><code>littleEndian</code></td>
  123. <td class="type">
  124. <span class="param-type">boolean</span>
  125. </td>
  126. <td class="attributes">
  127. &lt;optional><br>
  128. </td>
  129. <td class="default">
  130. false
  131. </td>
  132. <td class="description last"><p>Whether the binary export uses little or big endian.</p></td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. </div>
  137. <h2 class="subsection-title">Source</h2>
  138. <p>
  139. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/PLYExporter.js" target="_blank" rel="noopener" translate="no">examples/jsm/exporters/PLYExporter.js</a>
  140. </p>
  141. </article>
  142. </section>
  143. <script src="../scripts/linenumber.js"></script>
  144. <script src="../scripts/page.js"></script>
  145. </body>
  146. </html>
粤ICP备19079148号