File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ IfcGeom::Representation::Serialization::Serialization(const BRep& brep)
149149 int sid = -1 ;
150150
151151 if (it->hasStyle ()) {
152- const auto & clr = it->Style ().diffuse .ccomponents ();
152+ const auto & clr = it->Style ().get_color () .ccomponents ();
153153 surface_styles_.push_back (clr (0 ));
154154 surface_styles_.push_back (clr (1 ));
155155 surface_styles_.push_back (clr (2 ));
Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ void IfcGeom::set_default_style_file(const std::string& json_file) {
8989 boost::optional<pt::ptree&> diffuse = material.get_child_optional (" diffuse" );
9090 default_materials[name]->diffuse = read_colour_component (diffuse);
9191
92+ // @todo Is it necessary to get the surface too?
93+ // boost::optional<pt::ptree&> surface = material.get_child_optional("surface");
94+ // default_materials[name]->surface = read_colour_component(surface);
95+
9296 boost::optional<pt::ptree&> specular = material.get_child_optional (" specular" );
9397 default_materials[name]->specular = read_colour_component (specular);
9498
Original file line number Diff line number Diff line change @@ -354,8 +354,8 @@ class Entity : public Command {
354354 std::vector<boost::optional<std::array<float , 4 > > > diffuse_color_array;
355355 for (auto it = geom->geometry ().materials ().begin (); it != geom->geometry ().materials ().end (); ++it) {
356356 const auto & mat = **it;
357- if (mat.diffuse ) {
358- const auto & color = mat.diffuse .ccomponents ();
357+ if (mat.get_color () ) {
358+ const auto & color = mat.get_color () .ccomponents ();
359359 diffuse_color_array.push_back (std::array<float , 4 >{
360360 static_cast <float >(color (0 )),
361361 static_cast <float >(color (1 )),
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ void WaveFrontOBJSerializer::writeMaterial(const ifcopenshell::geometry::taxonom
6767 mtl_stream.stream << " newmtl " << material_name << " \n " ;
6868
6969 {
70- auto & diffuse = style.diffuse .ccomponents ();
70+ auto & diffuse = style.get_color () .ccomponents ();
7171 mtl_stream.stream << " Kd " << diffuse (0 ) << " " << diffuse (1 ) << " " << diffuse (2 ) << " \n " ;
7272 }
7373 if (style.specular ) {
You can’t perform that action at this time.
0 commit comments