Skip to content

Commit b37dc51

Browse files
committed
add method addFacesReversed() as a variant to fix open meshes
1 parent 7e29f5b commit b37dc51

File tree

5 files changed

+1055
-871
lines changed

5 files changed

+1055
-871
lines changed

IfcPlusPlus/src/ifcpp/geometry/Carve/FaceConverter.h

+22-7
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ class FaceConverter : public StatusCallback
319319
}
320320
PolyInputCache3D poly_cache(m_epsMergePoints);
321321
BuildingEntity* report_entity = nullptr;
322+
bool dumpPolygon = false;
322323

323324
for( const shared_ptr<IfcFace>& ifc_face : vec_faces )
324325
{
@@ -395,15 +396,14 @@ class FaceConverter : public StatusCallback
395396
}
396397

397398
#ifdef _DEBUG
398-
if( ifc_face->m_tag == 3517290 )
399-
{
400-
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
401-
GeomDebugDump::dumpPolyline(loop_points, color, true);
402-
}
399+
//glm::vec4 color(0.5, 0.6, 0.7, 1.0);
400+
//GeomDebugDump::dumpPolyline(loop_points, color, false);
401+
//GeomDebugDump::moveOffset(0.01);
402+
//dumpPolygon = true;
403403
#endif
404404
}
405405

406-
bool dumpPolygon = false;
406+
407407
for( size_t iiLoop = 0; iiLoop < face_loops.size(); ++iiLoop )
408408
{
409409
std::vector<vec3>& loop = face_loops[iiLoop];
@@ -423,7 +423,22 @@ class FaceConverter : public StatusCallback
423423
}
424424
else if( st == CLOSED_SHELL )
425425
{
426-
item_data->addClosedPolyhedron(poly_cache.m_poly_data);
426+
bool success = item_data->addClosedPolyhedron(poly_cache.m_poly_data);
427+
if( !success )
428+
{
429+
#ifdef _DEBUG
430+
if( item_data->m_meshsets_open.size() > 0)
431+
{
432+
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
433+
GeomDebugDump::dumpMeshset(item_data->m_meshsets_open[0], color, true);
434+
}
435+
if( item_data->m_meshsets.size() > 0)
436+
{
437+
glm::vec4 color(0.5, 0.6, 0.7, 1.0);
438+
GeomDebugDump::dumpMeshset(item_data->m_meshsets[0], color, true);
439+
}
440+
#endif
441+
}
427442
}
428443
}
429444
};

IfcPlusPlus/src/ifcpp/geometry/Carve/GeometryConverter.h

-21
Original file line numberDiff line numberDiff line change
@@ -792,27 +792,6 @@ class GeometryConverter : public StatusCallback
792792
return;
793793
}
794794

795-
#ifdef _DEBUG
796-
if( ifc_product->m_GlobalId->m_value.compare("1Ymw2Qiez6buX6OkNzOEaT")==0 || ifc_product->m_GlobalId->m_value.compare("1Ymw2Qiez6buX6OkVzOEnI") == 0 )
797-
{
798-
int wait = ifc_product->m_tag; // 181595
799-
}
800-
if( ifc_product->m_GlobalId->m_value.compare("1GVZve0001O34pDJ0qDZ0m") == 0 )
801-
{
802-
int wait = ifc_product->m_tag; // 181595
803-
}
804-
805-
if( ifc_product->m_GlobalId->m_value.compare("2O2Fr$t4X7Zf8NOew3FLR9") == 0 )
806-
{
807-
int wait = ifc_product->m_tag; // 181595
808-
}
809-
810-
if( ifc_product->m_GlobalId->m_value.compare("3ThA22djr8AQQ9eQMA5s7I") == 0 )
811-
{
812-
int wait = ifc_product->m_tag;
813-
}
814-
#endif
815-
816795
shared_ptr<IfcProductRepresentation>& product_representation = ifc_product->m_Representation;
817796
if( !product_representation )
818797
{

0 commit comments

Comments
 (0)