Debug code

This commit is contained in:
Ken Arroyo Ohori
2017-03-10 17:44:19 -06:00
parent 287fb9f0ed
commit b5e79b2558
2 changed files with 25 additions and 4 deletions
@@ -37,8 +37,6 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcMappedItem* l, ConversionR
IfcSchema::IfcCartesianTransformationOperator* transform = l->MappingTarget();
if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator3DnonUniform) ) {
IfcGeom::CgalKernel::convert((IfcSchema::IfcCartesianTransformationOperator3DnonUniform*)transform,gtrsf);
Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
return false;
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2DnonUniform) ) {
Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
return false;
@@ -46,8 +44,6 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcMappedItem* l, ConversionR
cgal_placement_t trsf;
IfcGeom::CgalKernel::convert((IfcSchema::IfcCartesianTransformationOperator3D*)transform,trsf);
gtrsf = trsf;
// Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
// return false;
} else if ( transform->is(IfcSchema::Type::IfcCartesianTransformationOperator2D) ) {
cgal_placement_t trsf_2d;
Logger::Message(Logger::LOG_ERROR, "Unsupported MappingTarget:", transform->entity);
+25
View File
@@ -213,6 +213,13 @@ bool IfcGeom::CgalKernel::convert_openings(const IfcSchema::IfcProduct* entity,
// Move the opening into the coordinate system of the IfcProduct
opening_trsf = opening_trsf * entity_trsf.inverse();
// std::cout << "opening_trsf" << std::endl;
// for (int i = 0; i < 3; ++i) {
// for (int j = 0; j < 4; ++j) {
// std::cout << opening_trsf.cartesian(i, j) << " ";
// } std::cout << std::endl;
// }
IfcSchema::IfcProductRepresentation* prodrep = fes->Representation();
IfcSchema::IfcRepresentation::list::ptr reps = prodrep->Representations();
@@ -246,7 +253,25 @@ bool IfcGeom::CgalKernel::convert_openings(const IfcSchema::IfcProduct* entity,
cgal_shape_t brep_cut_result(entity_shape);
for (auto &opening: opening_shapelist) {
CGAL::Polyhedron_3<Kernel> polyhedron;
brep_cut_result.convert_to_polyhedron(polyhedron);
std::ofstream fresult;
fresult.open("/Users/ken/Desktop/before.off");
fresult << polyhedron << std::endl;
fresult.close();
opening.convert_to_polyhedron(polyhedron);
fresult.open("/Users/ken/Desktop/opening.off");
fresult << polyhedron << std::endl;
fresult.close();
brep_cut_result -= opening;
brep_cut_result.convert_to_polyhedron(polyhedron);
fresult.open("/Users/ken/Desktop/after.off");
fresult << polyhedron << std::endl;
fresult.close();
}
if (brep_cut_result.is_valid()) {