How to load STL file #1267
-
👋 hi there, i have a problem, I try load model from .stl file but received error "TypeError: Proto is not a constructor" can you help me? thanks.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
stlloader is not part of objloader import { STLLoader } from 'three/examples/jsm/loaders/STLLoader' the error message tells you what you did
you don't need to check against null, it will never be null, and you can't just return the output. import scene = useLoader(STLLoader, url)
return <primitive object={scene} /> that is ... if STLLoader really gives you a scene, i have never used it. but if you want to dump an existing object into the scene then you do that with |
Beta Was this translation helpful? Give feedback.
stlloader is not part of objloader
the error message tells you what you did
TypeError: Proto is not a constructor
you give itundefined
as the loader.you don't need to check against null, it will never be null, and you can't just return the output.
that is ... if STLLoader really gives you a scene, i have never used it. but if you want to dump an existing object into the scene then you do that with
primitive
.