4
4
#include " ifcpp/Geometry/CurveConverter.h"
5
5
#include " ifcpp/Geometry/Extruder.h"
6
6
#include " ifcpp/Geometry/GeomUtils.h"
7
+ #include " ifcpp/Geometry/Helpers.h"
7
8
#include " ifcpp/Geometry/Matrix.h"
8
9
#include " ifcpp/Geometry/Parameters.h"
9
10
#include " ifcpp/Geometry/PrimitiveTypesConverter.h"
20
21
#include " ifcpp/Ifc/IfcFace.h"
21
22
#include " ifcpp/Ifc/IfcFaceBound.h"
22
23
#include " ifcpp/Ifc/IfcFaceOuterBound.h"
24
+ #include " ifcpp/Ifc/IfcFaceSurface.h"
23
25
#include " ifcpp/Ifc/IfcLoop.h"
24
26
#include " ifcpp/Ifc/IfcOrientedEdge.h"
25
27
#include " ifcpp/Ifc/IfcPlane.h"
@@ -128,7 +130,11 @@ class GeometryConverter {
128
130
return {};
129
131
}
130
132
131
- TLoop ConvertFace ( const std::shared_ptr<IfcFace>& face ) {
133
+ std::vector<TLoop> ConvertFace ( const std::shared_ptr<IfcFace>& face ) {
134
+ if ( auto faceSurface = std::dynamic_pointer_cast<IfcFaceSurface>( face ) ) {
135
+ return this ->ConvertSurface ( faceSurface->m_FaceSurface );
136
+ }
137
+
132
138
TLoop outer;
133
139
std::vector<TLoop> inners;
134
140
@@ -147,20 +153,20 @@ class GeometryConverter {
147
153
148
154
if ( outer.empty () ) {
149
155
if ( inners.size () == 1 ) {
150
- outer = inners[0 ];
156
+ outer = inners[ 0 ];
151
157
inners.clear ();
152
158
} else {
153
159
return {};
154
160
}
155
161
}
156
162
157
- return this ->m_geomUtils ->IncorporateHoles ( outer, loops );
163
+ return { this ->m_geomUtils ->IncorporateHoles ( outer, loops ) } ;
158
164
}
159
165
160
166
std::vector<TLoop> ConvertFaces ( const std::vector<std::shared_ptr<IfcFace>>& loops ) {
161
167
std::vector<TLoop> result;
162
168
for ( const auto & face: loops ) {
163
- result. push_back ( this ->ConvertFace ( face ) );
169
+ Helpers::AppendTo ( &result, this ->ConvertFace ( face ) );
164
170
}
165
171
return result;
166
172
}
@@ -242,8 +248,8 @@ class GeometryConverter {
242
248
243
249
shared_ptr<IfcSurfaceOfLinearExtrusion> linear_extrusion = dynamic_pointer_cast<IfcSurfaceOfLinearExtrusion>( swept_surface );
244
250
if ( linear_extrusion ) {
245
- const auto extrusion = this -> m_primitivesConverter -> ConvertPoint ( linear_extrusion-> m_ExtrudedDirection -> m_DirectionRatios ) *
246
- linear_extrusion->m_Depth ->m_value ;
251
+ const auto extrusion =
252
+ this -> m_primitivesConverter -> ConvertPoint ( linear_extrusion-> m_ExtrudedDirection -> m_DirectionRatios ) * linear_extrusion->m_Depth ->m_value ;
247
253
auto result = this ->m_extruder ->Extrude ( curve, extrusion, false );
248
254
m.TransformLoops ( &result );
249
255
return result;
0 commit comments