Is there three.js as .stl file load and preview?

Hi its possible way three.js from load the .stl file from users and preview it??

three.js provides a STLLoader that can be used to load binary and ASCII STL files. The following example demonstrates its usage:

https://threejs.org/examples/webgl_loader_stl

The three.js editor already supports a preview feature for STL files. Meaning you can drag’n’drop the file to the viewport and it will be automatically displayed.

2 Likes

Thank you so much… as per its possible available free source code ??

Well, at least the code in the official repository is Open-Source and MIT-licenced :wink:

Oh… i see so the open free source can get from github? i found your github… and isn’t it you developed within team? :thinking:

Sorry, I don’t understand why you mean. This is the official repository:

I’m sorry, I too am finding this answer confusing because in the example STLLoader is not imported from the official repository, it’s acquired as
import { STLLoader } from './jsm/loaders/STLLoader.js';

so I’m still not sure how to get it from three.js.

See this section of the docs, particularly the part on Examples:

https://threejs.org/docs/#manual/en/introduction/Installation

If you’re installing three.js from NPM (which is the method I’d recommend) then you’d write:

 import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';

If you’re facing this much trouble, I’d suggest just COPYING the entire volume into your project as a variable and go forward from there.

Hi, can you guide me that can is there any functionality that after previewing the 3d model in three.js. Can we edit it?
LIke i loaded a modal nad saw that it requires some fixes so, i fix them while previewing.
Fixing model can be in two ways
joining points(is those points are visblr)
through a pen like i fill the oles if there is nay in the modal.