Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
Download threejs model to .stl

I came to find this library that downloads stl from threejs. https://github.com/mrdoob/three.js/blob/master/examples/js/exporters/STLExporter.js

I am new to js / threejs, so I was wondering how could I incorporate this within my script, or how to link it as a library or other file.

Please note that the model I want to download is either one built from scratch in threejs or one that I imported as glb/gltb and changed some of its features in threejs.

Thank you.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

There is an official example that demonstrates the usage of STLExporter. I suggest you study the respective source code and use it as a foundation for your own app. You can find the mentioned example right here:

https://threejs.org/examples/misc_exporter_stl

Please note that the model I want to download is either one built from scratch in threejs or one that I imported as glb/gltb and changed some of its features in threejs.

Please keep in mind that STL has no concept of materials. It only saves the raw geometry data. STL is also unable to export hierarchical information of a scene (e.g. child-parent relationships). So depending on what you are going to change in your scene, it's likely that the respective data can't be exported as expected.

about 4 years ago · Juan Pablo Isaza Report

0

There is two implementation for export,ASCII & Binary,

        function exportASCII() {

            const result = exporter.parse( mesh );
            saveString( result, 'box.stl' );

        }

        function exportBinary() {

            const result = exporter.parse( mesh, { binary: true } );
            saveArrayBuffer( result, 'box.stl' );

        }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!