docs(tutorials): add STL loading to the Loading Models guide - #3787
Open
BenMalaga wants to merge 1 commit into
Open
docs(tutorials): add STL loading to the Loading Models guide#3787BenMalaga wants to merge 1 commit into
BenMalaga wants to merge 1 commit into
Conversation
Covers loading STL via useLoader + STLLoader, in the same style as the GLTF/OBJ/FBX sections. Notes that STLLoader returns a BufferGeometry (attach to your own mesh + material) and that it fills the normal attribute from the file's per-face normals, so computeVertexNormals() is only needed for smooth shading or files missing valid normals.
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1e8e0a7:
|
Member
|
If you can point to an open standard/test STL like the print boat or similar we could use that. CSB is being finicky, if you have an example you can pr it to: https://github.com/pmndrs/examples There are big docs additions coming with v10 but I'm totally down to have a STL example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Loading Models tutorial covers GLTF, FBX, and OBJ but not STL, which is one of the most common formats for 3D printing, CAD, and hardware work. This adds a short STL section in the same
useLoaderstyle as the others.STL loads a little differently from the existing three, and the section calls that out:
STLLoaderreturns aBufferGeometryrather than a scene or group, so you attach it to your ownmeshwith a material. The example shows that.STLLoaderfills thenormalattribute from the per-face normals in the file, so the geometry renders flat-shaded by default. The section notes thatcomputeVertexNormals()is what you reach for when you want smooth shading or the file has missing/zero normals, rather than implying it is always required.I left out a CodeSandbox demo to avoid referencing an asset that does not exist; happy to add one if you point me at a hosted STL model to match the other sections.