1
0

STLExporter.html 1.9 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>STL导出器([name])</h1>
  11. <p class="desc">
  12. 一个用于 STL 文件格式的导出器。<br /><br />
  13. [link:https://en.wikipedia.org/wiki/STL_(file_format) STL] 文件仅描述三维对象的表面几何,不包含颜色、纹理或其他常见的模型属性。STL 格式指定了 ASCII
  14. 和二进制两种表示方式,其中二进制表示更加紧凑。STL 文件不包含比例信息或索引,单位是任意的。
  15. </p>
  16. <h2>导入</h2>
  17. <p>
  18. [name] 是一个附加组件,必须显式导入。请参阅 [link:#manual/introduction/Installation Installation / Addons]。
  19. </p>
  20. <code>
  21. import { STLExporter } from 'three/addons/exporters/STLExporter.js';
  22. </code>
  23. <h2>代码示例</h2>
  24. <code>
  25. // Instantiate an exporter
  26. const exporter = new STLExporter();
  27. // Configure export options
  28. const options = { binary: true }
  29. // Parse the input and generate the STL encoded output
  30. const result = exporter.parse( mesh, options );
  31. </code>
  32. <h2>例子</h2>
  33. <p>
  34. [example:misc_exporter_stl]
  35. </p>
  36. <h2>构造函数</h2>
  37. <h3>[name]()</h3>
  38. <p>
  39. 创建一个新的 [name] 实例。
  40. </p>
  41. <h2>方法</h2>
  42. <h3>[method:Object parse]( [param:Object3D scene], [param:Object options] )</h3>
  43. <p>
  44. [page:Object3D scene] — 场景、网格或其他包含要编码的网格的基于 Object3D 的类。<br />
  45. [page:Options options] — 可选的导出选项<br />
  46. <ul>
  47. <li>binary - bool. 返回 ASCII 编码字符串或二进制数据缓冲区。默认为 `false`。</li>
  48. </ul>
  49. </p>
  50. <h2>源代码</h2>
  51. <p>
  52. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/STLExporter.js examples/jsm/exporters/STLExporter.js]
  53. </p>
  54. </body>
  55. </html>