Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THREE.js viewer example missing face colors #15

Closed
Glavin001 opened this issue Oct 25, 2022 · 7 comments
Closed

THREE.js viewer example missing face colors #15

Glavin001 opened this issue Oct 25, 2022 · 7 comments

Comments

@Glavin001
Copy link

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

  • Does my implementation look to be on the right track?
  • Would you like a Pull Request updating the THREE.js viewer example?
@kovacsv
Copy link
Owner

kovacsv commented Oct 25, 2022

I prefer to use material groups instead of vertex colors, but both can work. A Pull Request is always welcome!

@Glavin001
Copy link
Author

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! 🎉

@kovacsv
Copy link
Owner

kovacsv commented Oct 27, 2022

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.

@hyfbeetle
Copy link

How to show face colors with this library?
Will it be done in near future? Thanks very much.

@kovacsv
Copy link
Owner

kovacsv commented Mar 23, 2023

I've added face color handling to the example:
https://github.com/kovacsv/occt-import-js/blob/main/examples/three_viewer.html#L62-L89

@kovacsv kovacsv closed this as completed Mar 23, 2023
@hyfbeetle
Copy link

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.

@kovacsv
Copy link
Owner

kovacsv commented Mar 24, 2023

Oh, that's another issue than. I've created a new issue for this: #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants