Fixed issue with transformations?

This commit is contained in:
Ken Arroyo Ohori
2017-02-21 18:40:27 -06:00
parent c0732f5197
commit 64eb707996
3 changed files with 27 additions and 11 deletions
+2 -1
View File
@@ -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 (...) {}
@@ -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;
+24 -9
View File
@@ -97,12 +97,12 @@ IfcGeom::NativeElement<double>* 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<double>* 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();