From b04ca74308a4c5bd9d6eb3b372d8a53945a266f2 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 24 May 2016 12:50:05 +0200 Subject: [PATCH] Derive minimal face area from modeling precision --- src/ifcgeom/IfcGeom.h | 5 +---- src/ifcgeom/IfcGeomFunctions.cpp | 7 +++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ifcgeom/IfcGeom.h b/src/ifcgeom/IfcGeom.h index 6397f6d16f..638e410a22 100644 --- a/src/ifcgeom/IfcGeom.h +++ b/src/ifcgeom/IfcGeom.h @@ -82,7 +82,6 @@ private: double deflection_tolerance; double wire_creation_tolerance; - double minimal_face_area; double point_equality_tolerance; double max_faces_to_sew; double ifc_length_unit; @@ -101,7 +100,6 @@ public: Kernel() : deflection_tolerance(0.001) , wire_creation_tolerance(0.0001) - , minimal_face_area(0.000001) , point_equality_tolerance(0.00001) , max_faces_to_sew(-1.0) , ifc_length_unit(1.0) @@ -117,7 +115,6 @@ public: Kernel& operator=(const Kernel& other) { setValue(GV_DEFLECTION_TOLERANCE, other.getValue(GV_DEFLECTION_TOLERANCE)); setValue(GV_WIRE_CREATION_TOLERANCE, other.getValue(GV_WIRE_CREATION_TOLERANCE)); - setValue(GV_MINIMAL_FACE_AREA, other.getValue(GV_MINIMAL_FACE_AREA)); setValue(GV_POINT_EQUALITY_TOLERANCE, other.getValue(GV_POINT_EQUALITY_TOLERANCE)); setValue(GV_MAX_FACES_TO_SEW, other.getValue(GV_MAX_FACES_TO_SEW)); setValue(GV_LENGTH_UNIT, other.getValue(GV_LENGTH_UNIT)); @@ -137,7 +134,7 @@ public: // Defailt: 0.0001m / 0.1mm GV_WIRE_CREATION_TOLERANCE, // Specifies the minimal area of a face to be included in an IfcConnectedFaceset - // Default: 0.000001m 0.01cm2 + // Read-only GV_MINIMAL_FACE_AREA, // Specifies the treshold distance under which cartesian points are deemed equal // Default: 0.00001m / 0.01mm diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 9d3579bc1b..95168585e5 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -666,9 +666,6 @@ void IfcGeom::Kernel::setValue(GeomValue var, double value) { case GV_WIRE_CREATION_TOLERANCE: wire_creation_tolerance = value; break; - case GV_MINIMAL_FACE_AREA: - minimal_face_area = value; - break; case GV_POINT_EQUALITY_TOLERANCE: point_equality_tolerance = value; break; @@ -699,7 +696,9 @@ double IfcGeom::Kernel::getValue(GeomValue var) const { case GV_WIRE_CREATION_TOLERANCE: return wire_creation_tolerance; case GV_MINIMAL_FACE_AREA: - return minimal_face_area; + // Considering a right-angled triangle, this about the smallest + // area you can obtain without the vertices being confused. + return modelling_precision * modelling_precision / 2.; case GV_POINT_EQUALITY_TOLERANCE: return point_equality_tolerance; case GV_MAX_FACES_TO_SEW: