mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
material colours
This commit is contained in:
@@ -34,6 +34,9 @@ bool ifcopenshell::geometry::kernels::AbstractKernel::convert_impl(const taxonom
|
|||||||
}
|
}
|
||||||
for (auto i = s; i < r.size(); ++i) {
|
for (auto i = s; i < r.size(); ++i) {
|
||||||
r[i].prepend(collection->matrix);
|
r[i].prepend(collection->matrix);
|
||||||
|
if (!r[i].hasStyle()) {
|
||||||
|
r[i].setStyle(collection->surface_style);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return r.size() > s;
|
return r.size() > s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,6 +364,14 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcProduct* inst) {
|
|||||||
auto c = new taxonomy::collection;
|
auto c = new taxonomy::collection;
|
||||||
c->matrix = as<taxonomy::matrix4>(map(inst->ObjectPlacement()));
|
c->matrix = as<taxonomy::matrix4>(map(inst->ObjectPlacement()));
|
||||||
|
|
||||||
|
const IfcSchema::IfcMaterial* single_material = get_single_material_association(inst);
|
||||||
|
if (single_material) {
|
||||||
|
auto material_style = map(single_material);
|
||||||
|
if (material_style) {
|
||||||
|
c->surface_style = as<taxonomy::style>(material_style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (openings->size() && !settings_.get(settings::DISABLE_OPENING_SUBTRACTIONS) && use_body) {
|
if (openings->size() && !settings_.get(settings::DISABLE_OPENING_SUBTRACTIONS) && use_body) {
|
||||||
auto ci = c->matrix.components->inverse();
|
auto ci = c->matrix.components->inverse();
|
||||||
|
|
||||||
@@ -387,6 +395,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcProduct* inst) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user