mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
always apply in diffuse color, if doens't have surface color
Signed-off-by: Cristian Ritter <cristian_ritter@hotmail.com>
This commit is contained in:
@@ -571,15 +571,13 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcStyledItem* inst) {
|
||||
double rgb[3];
|
||||
if (process_colour(shading->SurfaceColour(), rgb)) {
|
||||
surface_style->surface.components() << rgb[0], rgb[1], rgb[2];
|
||||
surface_style->diffuse = surface_style->surface;
|
||||
}
|
||||
|
||||
if (auto rendering_style = shading->as<IfcSchema::IfcSurfaceStyleRendering>()) {
|
||||
if (rendering_style->DiffuseColour() && process_colour(rendering_style->DiffuseColour(), rgb)) {
|
||||
const taxonomy::colour& old_diffuse = surface_style->diffuse ? surface_style->diffuse : white;
|
||||
surface_style->diffuse = taxonomy::colour(old_diffuse.r() * rgb[0], old_diffuse.g() * rgb[1], old_diffuse.b() * rgb[2]);
|
||||
if (!surface_style->surface) {
|
||||
surface_style->surface = surface_style->diffuse;
|
||||
}
|
||||
}
|
||||
if (rendering_style->DiffuseTransmissionColour()) {
|
||||
// Not supported
|
||||
|
||||
@@ -327,10 +327,10 @@ typedef item const* ptr;
|
||||
style(const std::string& name) : name(name), specularity(std::numeric_limits<double>::quiet_NaN()), transparency(std::numeric_limits<double>::quiet_NaN()), use_surface_color(false) {}
|
||||
|
||||
const colour& get_color() const {
|
||||
if ((use_surface_color && surface) || !diffuse) {
|
||||
if (use_surface_color && surface) {
|
||||
return surface;
|
||||
}
|
||||
return diffuse;
|
||||
}
|
||||
return diffuse;
|
||||
}
|
||||
|
||||
bool has_specularity() const {
|
||||
|
||||
Reference in New Issue
Block a user