diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h index 8a1de806e5..f85c056ae6 100644 --- a/src/ifcgeom/IfcGeomIterator.h +++ b/src/ifcgeom/IfcGeomIterator.h @@ -704,9 +704,10 @@ namespace IfcGeom { next_shape_model = create_shape_model_for_next_entity(); // std::cout << "trsf" << std::endl; +// IfcGeom::CgalPlacement *trsf = next_shape_model->transformation().data(); // for (int i = 0; i < 3; ++i) { // for (int j = 0; j < 4; ++j) { -// std::cout << next_shape_model->transformation().matrix().data() << " "; +// std::cout << << " "; // } std::cout << std::endl; // } } catch (...) {} diff --git a/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp b/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp index 802af766c2..d7c576a4e7 100644 --- a/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp +++ b/src/ifcgeom/kernels/cgal/CgalEntityMapping.cpp @@ -67,7 +67,7 @@ bool IfcGeom::CgalKernel::convert_shape(const IfcBaseClass* l, cgal_shape_t& r) } if ( processed && success ) { - const double precision = getValue(GV_PRECISION); +// const double precision = getValue(GV_PRECISION); // apply_tolerance(r, precision); #ifndef NO_CACHE cache.Shape[id] = r; diff --git a/src/ifcgeom/kernels/cgal/CgalKernel.cpp b/src/ifcgeom/kernels/cgal/CgalKernel.cpp index 7d346c93fc..e67be1c390 100644 --- a/src/ifcgeom/kernels/cgal/CgalKernel.cpp +++ b/src/ifcgeom/kernels/cgal/CgalKernel.cpp @@ -97,12 +97,12 @@ IfcGeom::NativeElement* IfcGeom::CgalKernel::create_brep_for_representat convert(product->ObjectPlacement(), trsf); } catch (...) {} - std::cout << "trsf" << std::endl; - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 4; ++j) { - std::cout << trsf.cartesian(i, j) << " "; - } std::cout << std::endl; - } +// std::cout << "trsf" << std::endl; +// for (int i = 0; i < 3; ++i) { +// for (int j = 0; j < 4; ++j) { +// std::cout << trsf.cartesian(i, j) << " "; +// } std::cout << std::endl; +// } // Does the IfcElement have any IfcOpenings? // Note that openings for IfcOpeningElements are not processed @@ -114,9 +114,24 @@ IfcGeom::NativeElement* IfcGeom::CgalKernel::create_brep_for_representat if (!settings.get(IfcGeom::IteratorSettings::DISABLE_OPENING_SUBTRACTIONS) && openings && openings->size()) { Logger::Message(Logger::LOG_ERROR, "Not implemented opening subtractions"); } - - shape = new IfcGeom::Representation::Native(element_settings, representation->entity->id(), shapes); - + + if (settings.get(IteratorSettings::USE_WORLD_COORDS)) { + // TODO: OpenCascade code uses opened_shapes. Check why. + for ( IfcGeom::ConversionResults::iterator it = shapes.begin(); it != shapes.end(); ++ it ) { + it->prepend(new CgalPlacement(trsf)); + } + trsf = Kernel::Aff_transformation_3(); + shape = new IfcGeom::Representation::Native(element_settings, representation->entity->id(), shapes); + } else if (settings.get(IteratorSettings::USE_WORLD_COORDS)) { + for ( IfcGeom::ConversionResults::iterator it = shapes.begin(); it != shapes.end(); ++ it ) { + it->prepend(new CgalPlacement(trsf)); + } + trsf = Kernel::Aff_transformation_3(); + shape = new IfcGeom::Representation::Native(element_settings, representation->entity->id(), shapes); + } else { + shape = new IfcGeom::Representation::Native(element_settings, representation->entity->id(), shapes); + } + std::string context_string = ""; if (representation->hasRepresentationIdentifier()) { context_string = representation->RepresentationIdentifier();