process IfcIndexedPolyCurve without segments #549

This commit is contained in:
hlg
2019-02-14 03:05:38 +08:00
committed by Thomas Krijnen
parent 5db91e52da
commit acde878946
+8
View File
@@ -873,6 +873,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
BRepBuilderAPI_MakeWire w; BRepBuilderAPI_MakeWire w;
if(l->hasSegments()) {
IfcEntityList::ptr segments = l->Segments(); IfcEntityList::ptr segments = l->Segments();
for (IfcEntityList::it it = segments->begin(); it != segments->end(); ++it) { for (IfcEntityList::it it = segments->begin(); it != segments->end(); ++it) {
IfcUtil::IfcBaseClass* segment = *it; IfcUtil::IfcBaseClass* segment = *it;
@@ -911,6 +912,13 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi
throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + IfcSchema::Type::ToString(segment->type())); throw IfcParse::IfcException("Unexpected IfcIndexedPolyCurve segment of type " + IfcSchema::Type::ToString(segment->type()));
} }
} }
} else {
std::vector<gp_Pnt>::const_iterator previous = points.begin();
for (std::vector<gp_Pnt>::const_iterator current = previous+1; current < points.end(); ++current){
w.Add(BRepBuilderAPI_MakeEdge(*previous, *current));
previous = current;
}
}
result = w.Wire(); result = w.Wire();
return true; return true;