You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove objectColorSource config, replace with objectsColors
By default, BIMViewer loads whatever object colors and opacities are in the XKT model files, without changing them.
Sometimes, however, certain types of objects may have colors that make it hard for us to view the model.
For example, in some IFC models, IfcPlate types may be used to represent windows, and those types are often given opaque
colors. That results in the windows of our model being opaque. For this example, we can make the windows transparent
by configuring the BIMViewer, or just that model, with a custom color or opacity, for that IfcPlate type. That would make
all IfcPlate types transparent again. There are two ways we can do this - programmatically via BIMViewer.setConfigs, or
for each project individually, via the project's index.json file.
In the code below, we'll configure all IfcSpace, IfcWindow, IfcOpeningElement and IfcPlate types
to be transparent, and while we're at it, we'll make IfcWindow types to be always blue. Note that all values are in range [0..1].
Note that prior to v2.4, BIMViewer did change the colors and opacities of IfcOpening, IfcSpace, IfcWindow and IfcPlate by
default. We've removed that in v2.4, because it was confusing
and users wondered why those object types did not have the colors/opacities defined for them in the model.
// In case the model has opaque colors for IfcSpace, IfcWindow, IfcOpeningElement and IfcPlate // objects, let's make those objects always transparent. To make the model look extra nice,// let's force IfcWindows to always be blue, while we're at it. This will apply to all models,// except where we override the settings per-project, as shown next.bimViewer.setConfigs({"objectColors": {"IfcSpace": {"opacity": 0.3},"IfcWindow": {"opacity": 0.4,"color": [0,0,1]},"IfcOpeningElement": {"opacity": 0.3},"IfcPlate": {"opacity": 0.3}}});
The other way we can set these color/opacity customizations is per-project, within the viewerConfigs section of
a project's index.json file. If we've also set them via BIMViewer.setConFigs, then these will override
the ones set via that method.
As an example, we've done this for the OTCConferenceCenter demo model, which otherwise has its windows opaque, which would make it hard
for us to navigate around that model. Therefore, we provide a custom map of colors and opacities for certain IFC types via
the viewerConfigs in the project index.json for that model, as shown below.
Remove objectColorSource config, replace with objectsColors
By default, BIMViewer loads whatever object colors and opacities are in the XKT model files, without changing them.
Sometimes, however, certain types of objects may have colors that make it hard for us to view the model.
For example, in some IFC models,
IfcPlate
types may be used to represent windows, and those types are often given opaquecolors. That results in the windows of our model being opaque. For this example, we can make the windows transparent
by configuring the BIMViewer, or just that model, with a custom color or opacity, for that
IfcPlate
type. That would makeall
IfcPlate
types transparent again. There are two ways we can do this - programmatically viaBIMViewer.setConfigs
, orfor each project individually, via the project's
index.json
file.In the code below, we'll configure all
IfcSpace
,IfcWindow
,IfcOpeningElement
andIfcPlate
typesto be transparent, and while we're at it, we'll make
IfcWindow
types to be always blue. Note that all values are in range[0..1]
.Note that prior to v2.4, BIMViewer did change the colors and opacities of
IfcOpening
,IfcSpace
,IfcWindow
andIfcPlate
bydefault. We've removed that in v2.4, because it was confusing
and users wondered why those object types did not have the colors/opacities defined for them in the model.
The other way we can set these color/opacity customizations is per-project, within the
viewerConfigs
section ofa project's
index.json
file. If we've also set them viaBIMViewer.setConFigs
, then these will overridethe ones set via that method.
As an example, we've done this for the
OTCConferenceCenter
demo model, which otherwise has its windows opaque, which would make it hardfor us to navigate around that model. Therefore, we provide a custom map of colors and opacities for certain IFC types via
the
viewerConfigs
in the projectindex.json
for that model, as shown below.The text was updated successfully, but these errors were encountered: