Conversion result for breps

This commit is contained in:
Ken Arroyo Ohori
2017-02-06 16:22:36 -06:00
parent 1525cf6bfc
commit 6aff3d0f3d
2 changed files with 34 additions and 34 deletions
+30 -30
View File
@@ -85,29 +85,29 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcManifoldSolidBrep* l, Conv
cgal_shape_t s; cgal_shape_t s;
const SurfaceStyle* collective_style = get_style(l); const SurfaceStyle* collective_style = get_style(l);
if (convert_shape(l->Outer(),s) ) { if (convert_shape(l->Outer(),s) ) {
// const SurfaceStyle* indiv_style = get_style(l->Outer()); const SurfaceStyle* indiv_style = get_style(l->Outer());
//
// IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list); IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list);
// if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) { if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) {
// voids = l->as<IfcSchema::IfcFacetedBrepWithVoids>()->Voids(); voids = l->as<IfcSchema::IfcFacetedBrepWithVoids>()->Voids();
// } }
//#ifdef USE_IFC4 #ifdef USE_IFC4
// if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) { if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) {
// voids = l->as<IfcSchema::IfcAdvancedBrepWithVoids>()->Voids(); voids = l->as<IfcSchema::IfcAdvancedBrepWithVoids>()->Voids();
// } }
//#endif #endif
//
// for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) { for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) {
// TopoDS_Shape s2; // TopoDS_Shape s2;
// /// @todo No extensive shapefixing since shells should be disjoint. // /// @todo No extensive shapefixing since shells should be disjoint.
// /// @todo Awaiting generalized boolean ops module with appropriate checking // /// @todo Awaiting generalized boolean ops module with appropriate checking
// if (convert_shape(l->Outer(), s2)) { // if (convert_shape(l->Outer(), s2)) {
// s = BRepAlgoAPI_Cut(s, s2).Shape(); // s = BRepAlgoAPI_Cut(s, s2).Shape();
// } // }
// } }
//
// shape.push_back(ConversionResult(new OpenCascadeShape(s), indiv_style ? indiv_style : collective_style)); shape.push_back(ConversionResult(new CgalShape(s), indiv_style ? indiv_style : collective_style));
// return true; return true;
} }
return false; return false;
} }
@@ -132,19 +132,19 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcConnectedFaceSet* l, cgal_
face_list.push_back(face); face_list.push_back(face);
} }
for (auto const &face : face_list) { // for (auto const &face : face_list) {
std::cout << "Face" << std::endl; // std::cout << "Face" << std::endl;
std::cout << "\touter: "; // std::cout << "\touter: ";
for (auto const &point: *face->outer) { // for (auto const &point: *face->outer) {
std::cout << "(" << point << ") "; // std::cout << "(" << point << ") ";
} std::cout << std::endl; // } std::cout << std::endl;
for (auto const &inner: face->inner) { // for (auto const &inner: face->inner) {
std::cout << "\tinner: "; // std::cout << "\tinner: ";
for (auto const &point: *inner) { // for (auto const &point: *inner) {
std::cout << "(" << point << ") "; // std::cout << "(" << point << ") ";
} std::cout << std::endl; // } std::cout << std::endl;
} // }
} // }
cgal_shape_t polyhedron = new CGAL::Polyhedron_3<Kernel>(); cgal_shape_t polyhedron = new CGAL::Polyhedron_3<Kernel>();
PolyhedronBuilder builder(&face_list); PolyhedronBuilder builder(&face_list);
+4 -4
View File
@@ -85,18 +85,18 @@ public:
builder.begin_surface(points_map.size(), facet_vertices.size()); builder.begin_surface(points_map.size(), facet_vertices.size());
for (auto const &point: points_map) { for (auto const &point: points_map) {
std::cout << "Adding point " << point.first << std::endl; // std::cout << "Adding point " << point.first << std::endl;
builder.add_vertex(point.first); builder.add_vertex(point.first);
} }
for (auto const &facet: facet_vertices) { for (auto const &facet: facet_vertices) {
builder.begin_facet(); builder.begin_facet();
std::cout << "Adding facet "; // std::cout << "Adding facet ";
for (auto const &vertex: facet) { for (auto const &vertex: facet) {
std::cout << vertex << " "; // std::cout << vertex << " ";
builder.add_vertex_to_facet(vertex); builder.add_vertex_to_facet(vertex);
} }
std::cout << std::endl; // std::cout << std::endl;
builder.end_facet(); builder.end_facet();
} }