Closed muren400 closed 2 months ago
Interesting catch. I had a look at the respective code and agree that for this particular case, the BIMsurfer3 rendering would probably look as expected after removing those three lines. It seems like BIMsurfer V1 used in BIMvie.ws just uses the GeometryData#color attribute which contains the most-used color for one product's geometry and would continue to look like that.
I have a little doubt about triangles with no color assigned. Since the render engine returns byte buffers (see RenderEngineGeometry.java), it cannot easily communicate null values in other ways than with zeros. They should not be transparent either, so they will have alpha 1. If that is the case, then we have no chance of distinguishing explicit black from no color. This might be why the three lines of code are there on purpose, even though originally the isBlack
method was just introduced for debugging purposes.
It could just skip those colors in the material array and set the material index to -1;
It does that anyway if it can't find the material I think?
Yes, it seems you are right, there was a change in IfcOpenShell to render geometries with materials that have no information on which color to use for its presentation with material index set to -1, hence no material assigned. Before that change, the IfcOpenShell behaviour was as I suspected: https://github.com/IfcOpenShell/IfcOpenShell/commit/f9b76ce022047d3e68bb5c5dc1c5019f239221ff?diff=unified&w=1. Can you verify with a sample with a no-color material assigned? If that works fine, I think those three lines can indeed be deleted.
Hi,
there is this bit of code in GeometryRunner starting with line 341:
From the git history it seems like this block was added for debugging purposes and shouldn't be there. This causes the model to be rendered incorrectly in BimSurfer, if an object has black material.
I have this example file.
It should look like this:
In BIMView.ws it looks like this:
In BimSurfer 3 it looks like this:
I'm pretty sure, this can be resolved by just commenting out those 3 lines again, but maybe there's a reason they're there after all?