Closed Glavin001 closed 1 year ago
I prefer to use material groups instead of vertex colors, but both can work. A Pull Request is always welcome!
Good to know, thanks! I'm relatively new to Threejs and learning these concerns this week. Appreciate your feedback.
I've been trying to learn from https://github.com/kovacsv/Online3DViewer/blob/master/source/engine/import/importerocct.js Could more of the code from Online3DViewer be brought into this library, such as color support, or is this separation intentional?
Thanks for creating this awesome library! 🎉
The separation is intentional, actually the dependency is reversed: Online3DViewer uses occt-import-js under the hood. This library should be independent from Online 3D Viewer to make it usable more widely.
How to show face colors with this library? Will it be done in near future? Thanks very much.
I've added face color handling to the example: https://github.com/kovacsv/occt-import-js/blob/main/examples/three_viewer.html#L62-L89
Appreciate your feedback, thanks very much! Problem is resultMesh.face_colors is undefined, file "dm1-id-214.stp" from test directory has face colors, but cann't display.
Oh, that's another issue than. I've created a new issue for this: #23
THREE.js viewer example: https://github.com/kovacsv/occt-import-js/blob/main/examples/three_viewer.html#L28-L64
I've added a working (so far in my tests)
face_colors
implementation to this Codesandbox: https://codesandbox.io/s/convert-step-file-to-glb-with-three-js-occt-import-js-v0-3-5hk66o?file=/src/StepLoader.js