7373#include < ShapeFix_ShapeTolerance.hxx>
7474#include < ShapeFix_Solid.hxx>
7575
76- #include < BRepFilletAPI_MakeFillet2d.hxx>
77-
7876#include < TopLoc_Location.hxx>
7977
8078#include " ../ifcgeom/IfcGeom.h"
@@ -97,28 +95,33 @@ bool IfcGeom::convert(const Ifc2x3::IfcFace::ptr l, TopoDS_Face& face) {
9795 if ( er != BRepBuilderAPI_FaceDone ) return false ;
9896 if ( bounds->Size () == 1 ) {
9997 face = mf.Face ();
100- return true ;
101- }
102- for ( ++it; it != bounds->end (); ++ it) {
103- Ifc2x3::IfcLoop::ptr loop = (*it)->Bound ();
104- TopoDS_Wire wire;
105- if ( ! IfcGeom::convert_wire (loop,wire) ) return false ;
106- mf.Add (wire);
107- }
108- if ( mf.IsDone () ) {
109- ShapeFix_Shape sfs (mf.Face ());
110- sfs.Perform ();
111- TopoDS_Shape sfs_shape = sfs.Shape ();
112- bool is_face = sfs_shape.ShapeType () == TopAbs_FACE;
113- if ( is_face ) {
114- face = TopoDS::Face (sfs_shape);
115- return true ;
98+ } else {
99+ for ( ++it; it != bounds->end (); ++ it) {
100+ Ifc2x3::IfcLoop::ptr loop = (*it)->Bound ();
101+ TopoDS_Wire wire;
102+ if ( ! IfcGeom::convert_wire (loop,wire) ) return false ;
103+ mf.Add (wire);
104+ }
105+ if ( mf.IsDone () ) {
106+ ShapeFix_Shape sfs (mf.Face ());
107+ sfs.Perform ();
108+ TopoDS_Shape sfs_shape = sfs.Shape ();
109+ bool is_face = sfs_shape.ShapeType () == TopAbs_FACE;
110+ if ( is_face ) {
111+ face = TopoDS::Face (sfs_shape);
112+ } else {
113+ return false ;
114+ }
116115 } else {
117116 return false ;
118117 }
119- } else {
120- return false ;
121118 }
119+ // It might be a good idea to globally discard faces
120+ // smaller than a certain treshold value. But for now
121+ // only when processing IfcConnectedFacesets the small
122+ // faces are skipped.
123+ // return face_area(face) > 0.0001;
124+ return true ;
122125}
123126bool IfcGeom::convert (const Ifc2x3::IfcArbitraryClosedProfileDef::ptr l, TopoDS_Face& face) {
124127 TopoDS_Wire wire;
0 commit comments