STLExporter.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="en">
  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>[name]</h1>
  11. <p class="desc">
  12. An exporter for the STL file format. <br /><br />
  13. [link:https://en.wikipedia.org/wiki/STL_(file_format) STL] files describe only the surface geometry
  14. of a three-dimensional object without any representation of color, texture or other common model attributes.
  15. The STL format specifies both ASCII and binary representations, with binary being more compact.
  16. STL files contain no scale information or indexes, and the units are arbitrary.
  17. </p>
  18. <h2>Import</h2>
  19. <p>
  20. [name] is an add-on, and must be imported explicitly.
  21. See [link:#manual/introduction/Installation Installation / Addons].
  22. </p>
  23. <code>
  24. import { STLExporter } from 'three/addons/exporters/STLExporter.js';
  25. </code>
  26. <h2>Code Example</h2>
  27. <code>
  28. // Instantiate an exporter
  29. const exporter = new STLExporter();
  30. // Configure export options
  31. const options = { binary: true }
  32. // Parse the input and generate the STL encoded output
  33. const result = exporter.parse( mesh, options );
  34. </code>
  35. <h2>Examples</h2>
  36. <p>
  37. [example:misc_exporter_stl]
  38. </p>
  39. <h2>Constructor</h2>
  40. <h3>[name]()</h3>
  41. <p>
  42. Creates a new [name].
  43. </p>
  44. <h2>Methods</h2>
  45. <h3>[method:Object parse]( [param:Object3D scene], [param:Object options] )</h3>
  46. <p>
  47. [page:Object3D scene] — Scene, Mesh, or other Object3D based class containing Meshes to encode.<br />
  48. [page:Options options] — Optional export options<br />
  49. <ul>
  50. <li>binary - bool. Return an ASCII encoded string or binary data buffer. Default is `false`.</li>
  51. </ul>
  52. </p>
  53. <h2>Source</h2>
  54. <p>
  55. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/STLExporter.js examples/jsm/exporters/STLExporter.js]
  56. </p>
  57. </body>
  58. </html>