Replies: 2 comments
-
xeokit does not currently support per-face coloring unfortunately, but can have multiple meshes, each of a different color, belonging to each object (Entity). So you can have an object that has one mesh representing red faces, another representing green faces, and so on. What could be an option is to make the loader separate each object into multiple meshes by face color, but in the viewer still represent them as single objects. The downside is that if you have a triangle mesh with 100 differently colored triangles, you get an object with a hundred different meshes. It depends how the colors are used - if they are intended to contain many shades of color, it could create a lot of meshes. Having said that though, I think it is possible to extend xeokit Viewer's triangle mesh renderer to support per-face colors. What sort of use cases are triangle colors used for? |
Beta Was this translation helpful? Give feedback.
-
Ok I see. Triangle colors were added, because of the feedback recieved from Revit and Archicad users, where you can have some more detailed elements e.g. windows, doors, furniture with various different colors. This .bim file exported from Archicad can be good example: At the beginning in 1.0.0 there was only 1 color per element, cause in structural engineering world I haven't found any practical example of such multicolor feature: beams, plates, bolts, rebars, etc. all these things are fine with having single color each. But it turned out that for architectural models it's better to have it. |
Beta Was this translation helpful? Give feedback.
-
I'm very excited about this loader, and had a quick look at this branch, the only thing I miss probably are face_colors that were introduced in 1.1.0 :) I don't know however if there is an easy way in Xeokit v2 to attach colors for each face separately. This tag (face_colors) is optional and is in side element.
CubesWithFaceColorsAndWithout_WithFixedNormals.zip
This tiny example above can be good representation and test file.
Beta Was this translation helpful? Give feedback.
All reactions