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