Skip to content

Commit

Permalink
add method addFacesReversed() as a variant to fix open meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcapps committed Nov 21, 2022
1 parent 7e29f5b commit b37dc51
Show file tree
Hide file tree
Showing 5 changed files with 1,055 additions and 871 deletions.
29 changes: 22 additions & 7 deletions IfcPlusPlus/src/ifcpp/geometry/Carve/FaceConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ class FaceConverter : public StatusCallback
}
PolyInputCache3D poly_cache(m_epsMergePoints);
BuildingEntity* report_entity = nullptr;
bool dumpPolygon = false;

for( const shared_ptr<IfcFace>& ifc_face : vec_faces )
{
Expand Down Expand Up @@ -395,15 +396,14 @@ class FaceConverter : public StatusCallback
}

#ifdef _DEBUG
if( ifc_face->m_tag == 3517290 )
{
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
GeomDebugDump::dumpPolyline(loop_points, color, true);
}
//glm::vec4 color(0.5, 0.6, 0.7, 1.0);
//GeomDebugDump::dumpPolyline(loop_points, color, false);
//GeomDebugDump::moveOffset(0.01);
//dumpPolygon = true;
#endif
}

bool dumpPolygon = false;

for( size_t iiLoop = 0; iiLoop < face_loops.size(); ++iiLoop )
{
std::vector<vec3>& loop = face_loops[iiLoop];
Expand All @@ -423,7 +423,22 @@ class FaceConverter : public StatusCallback
}
else if( st == CLOSED_SHELL )
{
item_data->addClosedPolyhedron(poly_cache.m_poly_data);
bool success = item_data->addClosedPolyhedron(poly_cache.m_poly_data);
if( !success )
{
#ifdef _DEBUG
if( item_data->m_meshsets_open.size() > 0)
{
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
GeomDebugDump::dumpMeshset(item_data->m_meshsets_open[0], color, true);
}
if( item_data->m_meshsets.size() > 0)
{
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
GeomDebugDump::dumpMeshset(item_data->m_meshsets[0], color, true);
}
#endif
}
}
}
};
21 changes: 0 additions & 21 deletions IfcPlusPlus/src/ifcpp/geometry/Carve/GeometryConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,27 +792,6 @@ class GeometryConverter : public StatusCallback
return;
}

#ifdef _DEBUG
if( ifc_product->m_GlobalId->m_value.compare("1Ymw2Qiez6buX6OkNzOEaT")==0 || ifc_product->m_GlobalId->m_value.compare("1Ymw2Qiez6buX6OkVzOEnI") == 0 )
{
int wait = ifc_product->m_tag; // 181595
}
if( ifc_product->m_GlobalId->m_value.compare("1GVZve0001O34pDJ0qDZ0m") == 0 )
{
int wait = ifc_product->m_tag; // 181595
}

if( ifc_product->m_GlobalId->m_value.compare("2O2Fr$t4X7Zf8NOew3FLR9") == 0 )
{
int wait = ifc_product->m_tag; // 181595
}

if( ifc_product->m_GlobalId->m_value.compare("3ThA22djr8AQQ9eQMA5s7I") == 0 )
{
int wait = ifc_product->m_tag;
}
#endif

shared_ptr<IfcProductRepresentation>& product_representation = ifc_product->m_Representation;
if( !product_representation )
{
Expand Down
Loading

0 comments on commit b37dc51

Please sign in to comment.