+ TopoDS_Shape aShape = theShape;
+
+ if ( theShape.ShapeType() == TopAbs_EDGE )
+ {
+ // We make the wire from incoming edge because of other algorithms
+ // are waiting at least the wire from polyline
+ TopoDS_Edge anEdge = TopoDS::Edge( theShape );
+ BRepBuilderAPI_MakeWire aMakeWire( anEdge );
+ aMakeWire.Build();
+ if ( aMakeWire.IsDone() )
+ aShape = aMakeWire.Wire();
+ }
+
+ gp_Pln aPlane( gp_Pnt( 0, 0, 0 ), gp_Dir( 0, 0, 1 ) );
+ BRepBuilderAPI_MakeFace aMakeFace( aPlane );
+ aMakeFace.Build();
+ BRepOffsetAPI_NormalProjection aProj( aMakeFace.Face() );
+ aProj.Add( aShape );
+ aProj.Build();
+ TopoDS_Shape aResult;
+ if( aProj.IsDone() )
+ aResult = aProj.Shape();
+
+ setPolylineShape( aResult );