1
0

PLYExporter.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>PLY导出器([name])</h1>
  11. <p class="desc">
  12. 一个用于 `PLY` 文件格式的导出器。
  13. <br /><br />
  14. [link:https://en.wikipedia.org/wiki/PLY_(file_format) PLY] (Polygon or Stanford Triangle Format)
  15. 是一种用于高效传输和加载简单、静态的3D内容的文件格式,采用紧凑的格式。支持二进制和 ASCII 两种格式。PLY 可以存储顶点位置、颜色、法线和 UV 坐标。不保存纹理或纹理引用。
  16. </p>
  17. <h2>导入</h2>
  18. <p>
  19. [name] 是一个附加组件,必须显式导入。请参阅 [link:#manual/introduction/Installation Installation / Addons]。
  20. </p>
  21. <code>
  22. import { PLYExporter } from 'three/addons/exporters/PLYExporter.js';
  23. </code>
  24. <h2>代码示例</h2>
  25. <code>
  26. // Instantiate an exporter
  27. const exporter = new PLYExporter();
  28. // Parse the input and generate the ply output
  29. const data = exporter.parse( scene, options );
  30. downloadFile( data );
  31. </code>
  32. <h2>构造函数</h2>
  33. <h3>[name]()</h3>
  34. <p>
  35. </p>
  36. <p>
  37. 创建一个新的 [name] 实例。
  38. </p>
  39. <h2>方法</h2>
  40. <h3>[method:Object parse]( [param:Object3D input], [param:Function onDone], [param:Object options] )</h3>
  41. <p>
  42. [page:Object input] — Object3D<br />
  43. [page:Function onCompleted] — 将在导出完成时调用。参数将是生成的 ply ascii 或二进制 ArrayBuffer。<br />
  44. [page:Options options] — 导出选项<br />
  45. <ul>
  46. <li>excludeAttributes - array. 要从导出的 PLY 文件中显式排除哪些属性。有效值为 'color'、'normal'、'uv' 和 'index'。如果排除三角形索引,则导出点云。默认是一个空数组。
  47. </li>
  48. <li>binary - bool. 以二进制格式导出,返回 ArrayBuffer。默认为 false。</li>
  49. </ul>
  50. </p>
  51. <p>
  52. 从输入对象生成 PLY 文件数据作为字符串或 ArrayBuffer(ASCII 或二进制)输出。返回的数据与传递给 "onCompleted" 函数的数据相同。如果对象由多个子元素和几何体组成,它们将在文件中合并为一个单独的网格。
  53. </p>
  54. <h2>源代码</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/PLYExporter.js examples/jsm/exporters/PLYExporter.js]
  57. </p>
  58. </body>
  59. </html>