TopoDS_Wire aWire;
if( theType == SECTION_POLYLINE )
{
+ int aNbPoints = thePoints.Length();
BRepBuilderAPI_MakePolygon aMakeWire;
- for ( int i = 1, n = thePoints.Length(); i <= n ; ++i )
+ for ( int i = 1, n = aNbPoints; i <= n ; ++i )
{
gp_XYZ aPoint = thePoints.Value( i );
gp_Pnt aPnt( aPoint.X(), aPoint.Y(), aPoint.Z() );
aMakeWire.Add( aPnt );
}
- if( theIsClosed )
+ if( theIsClosed && ( aNbPoints > 2 ) )
aMakeWire.Close();
if ( aMakeWire.IsDone() )