dotbim: `face_colors` Property missing?

I was trying to create a viewer using three.js and manage to make work fine but I tested some files and found this face_colors that does not exist in the schema.

Looks like this face_colors is the color of each face when the mesh needs to have different colors.

https://github.com/kovacsv/dotbim-archicad/blob/d50b54a33c586090b3fee947cf67c8268c201244/Sources/AddOn/DotbimExporter.cpp#L188

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 30 (26 by maintainers)

Most upvoted comments

Ping me when you agree on the file format modification. I’m happy to implement it in Online3DViewer, and even more happier to see a pull request. πŸ™‚

One thing that is really important to me is backward compatibility, so naturally breaking changes are something I would avoid.

Side note regarding color in elements: I already use it a lot, I have some 3d symbols that I store once and then color it differently, place different metadata for each one, and it works great.

Maybe let’s just make it as it is already in the Online 3d Viewer then, and treat is with these two points only:

  1. If there are face_colors defined on element level, use them. Otherwise:
  2. Use color defined on element level.

Just faces then! 😁

The file is not optimized, I have duplicated meshes in different rotations, and have the colors in the mesh and the face_colors to make work in the 3DViewer, the file is enormous I’m glad that .zip format works.

https://3dviewer.net/#model=https://github.com/ricaun/dotbim.three.js/blob/develop/models/rac_advanced_sample_project.zip

@kovacsv I was trying some implementation in the Online3DViewer and was not able to make work to add color in a vertex mode, like each corner in a triangle with one color. Looks like only supports RGB and not RGBA. This means gonna be a pain to support vertex color, I made work to support one color for the whole mesh or by triangle faces.

Another thing I discovered by testing is all the proprieties in the scheme are obligatory and if someone is missing makes the 3DViewer break. Now I kinda understand the reason the face_colors is in the element level and the color has a default value.

The dotbim.three.js works now with both implementation face_colors in element and colors in mesh.

Kinda work!

image

I just found it a little odd that the face_colors are in the Element and not inside the Mesh with the indices and coordinates.

Could be neat to have work in both places actually. DM probably gonna be better 😁