- Provide logging information to IfcBlender

- Disallow open curves for IfcPolygonalBoundedHalfSpace [fixes #3405490 Incorrectly rendered wall in FZK-Haus-EliteCAD.ifc]
- Disable tolerance on IfcCompositeCurve
- Try to convert IfcConnectedFaceSets to TopoDS_Solids regardless of whether they are open or closed shells, improves openings in IFC files exported by Revit
- Provide debugging information based on shape volume on IfcBooleanClippingResult and IfcOpeningElement
This commit is contained in:
Thomas Krijnen
2011-10-12 16:43:29 +00:00
parent e6c5e5e10c
commit 34efb480d6
11 changed files with 78 additions and 25 deletions
+15
View File
@@ -72,6 +72,9 @@
#include <TopLoc_Location.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
#include "../ifcgeom/IfcGeom.h"
bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr entity,
@@ -91,7 +94,14 @@ bool IfcGeom::convert_openings(const Ifc2x3::IfcProduct::ptr entity,
TopoDS_Shape s;
IfcGeom::convert_shape(*it2,s);
s.Move(trsf);
const float opening_volume = shape_volume(s);
if ( opening_volume <= ALMOST_ZERO )
Ifc::LogMessage("warning","Empty solid for:",fes->entity);
const float original_shape_volume = shape_volume(result);
result = BRepAlgoAPI_Cut(result,s);
const float volume_after_subtraction = shape_volume(result);
if ( ALMOST_THE_SAME(original_shape_volume,volume_after_subtraction) )
Ifc::LogMessage("warning","Warning subtraction yields unchanged volume:",entity->entity);
}
}
}
@@ -140,4 +150,9 @@ bool IfcGeom::profile_helper(int numVerts, float* verts, int numFillets, int* fi
delete[] vertices;
return true;
}
float IfcGeom::shape_volume(const TopoDS_Shape& s) {
GProp_GProps System;
BRepGProp::VolumeProperties(s, System);
return (float) System.Mass();
}