omrips / viewstl

Viewstl Javascript plugin - STL/OBJ 3D files Viewer by viewstl.com
MIT License
200 stars 49 forks source link

does not respect color in binary .stl files #19

Closed astrahan closed 3 years ago

astrahan commented 3 years ago

this project would be much more useful for web projects if it respected the color information that can be embedded in binary stl files. MeshLab, for example, does display stl binary files in which each facet can have a color specified. I have been looking at adding this to the .js files but so far they are not MacOS friendly... and not much documentation is provided... even so I have been able to do a lot just by trail and error... Any interest in a version that displays color?

omrips commented 3 years ago

Viewstl DOES respect colors. but since colors is not part of the official STL format, each software may implement it differently.

Please provide me a link to your STL file and I'll take a look.

astrahan commented 3 years ago

attached is an example (all I get is everything grey in stlview)

but when I test the file in meshlab I do see the colors that I assigned when I created the file

thanks Mel

On Sep 28, 2021, at 12:45 AM, omrips @.***> wrote:

Viewstl DOES respect colors. but since colors is not part of the official STL format, each software may implement it differently.

Please provide me a link to your STL file and I'll take a look.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omrips/viewstl/issues/19#issuecomment-928940658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYMPMQCS2YW7H3LP5IWNITUEFXC7ANCNFSM5E4U77BQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

astrahan commented 3 years ago

also

is there any example of how to call the stlview functions? I would like for example to make an obect translucent

thanks! Mel

On Sep 28, 2021, at 12:45 AM, omrips @.***> wrote:

Viewstl DOES respect colors. but since colors is not part of the official STL format, each software may implement it differently.

Please provide me a link to your STL file and I'll take a look.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omrips/viewstl/issues/19#issuecomment-928940658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYMPMQCS2YW7H3LP5IWNITUEFXC7ANCNFSM5E4U77BQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omrips commented 3 years ago

Mel I can't see the attachment for some reason, can you please send it to my email admin@viewstl.com ?

Docs including examples are here: https://www.viewstl.com/plugin/

astrahan commented 3 years ago

Docs including examples are here: https://www.viewstl.com/plugin/ https://www.viewstl.com/plugin/

I found those examples and have been trying to understand them and have been partially successful

it would help to have a working example that calls some of the add and set methods

thanks M

astrahan commented 3 years ago

one more questiuon if you dont mind,

where do I change the camera field of view in stlviewer? the default setting is much too wide for my needs

thanks Mel

On Sep 28, 2021, at 12:45 AM, omrips @.***> wrote:

Viewstl DOES respect colors. but since colors is not part of the official STL format, each software may implement it differently.

Please provide me a link to your STL file and I'll take a look.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omrips/viewstl/issues/19#issuecomment-928940658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYMPMQCS2YW7H3LP5IWNITUEFXC7ANCNFSM5E4U77BQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omrips commented 3 years ago

Looks like MeshLab uses another non-standard method to represents colored STL (as written here - https://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL) - VisCAM method.

That requires some work on my side in order to support it. next version. Meanwhile you can try to save to file as 3mf (and then you can download it with viewstl.com as supported colored STL file)

astrahan commented 3 years ago

you can see what I have done so far here

https://www.eyephysics.com/PS/PS6/UserGuide/PlaqueModels.html

rotate the eye at lower left

On Sep 30, 2021, at 6:20 AM, omrips @.***> wrote:

Looks like MeshLab uses another non-standard method to represents colored STL (as written here - https://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL https://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL) - VisCAM method.

That requires some work on my side in order to support it. next version. Meanwhile you can try to save to file as 3mf (and then you can download it with viewstl.com as supported colored STL file)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omrips/viewstl/issues/19#issuecomment-931316440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYMPMWAYUVTV7MCW35MKNLUERP2XANCNFSM5E4U77BQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omrips commented 3 years ago

As to camera field of view - not supported directly with the plugin, but you have access the camera object like that: stl_viewer.camera.fov=.....

astrahan commented 3 years ago

I just use MeshLab to test the stl files that I create in my own software for compatibility with other stl and 3D printing applications

I was able to manage color in stlviewer by creating a seperate stl file for each colored component of the 3D eye model I am trying to show on our web user guide and then loading an array of files into stlviewer - by subdividing the model for display (rather than 3D printing) I can vary the opacity of each component in your stlviewer -

although I get some transparency artifacts at times - in general it is working nicely

thanks for this js utility!! Mel

see

https://www.eyephysics.com/PS/PS6/UserGuide/PlaqueModels.html

Looks like MeshLab uses another non-standard method to represents colored STL (as written here - https://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL https://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL) - VisCAM method.

omrips commented 3 years ago

Added an update for file parser.min.js

astrahan commented 3 years ago

awesome

thank you!

Mel

this is an example of how we ares using stlviewer so far

https://www.eyephysics.com/PS/PS6/UserGuide/EP934.html https://www.eyephysics.com/PS/PS6/UserGuide/EP934.html

On Oct 17, 2021, at 2:08 AM, omrips @.***> wrote:

Added an update for file parser.min.js

now supports MeshLab colored-STL method — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omrips/viewstl/issues/19#issuecomment-945077517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYMPMV7PWH57OCQYQAYXR3UHKHBBANCNFSM5E4U77BQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.