Implemented avoiding force cut of an edge in case of simple edge (that contains just 1 curve).
// Cut
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
- if (nbEdges == 2 && nbResEdges == 0)
+ Handle(BRep_TEdge) TEdge = Handle(BRep_TEdge)::DownCast(E.TShape());
+ const Standard_Integer aNumCurvesInEdge = TEdge->Curves().Size();
+ if (nbEdges == 2 && nbResEdges == 0 && aNumCurvesInEdge > 1)
ForcedCut = 1;
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:33 2000 End
nbResEdges = CutEdge (TopoDS::Edge(aLocalShape), mySpine, ForcedCut, Cuts);
checkshape result
checksection result
- checknbshapes result -vertex 4 -edge 3 -wire 1 -face 0 -shell 0 -solid 0 -compsolid 0 -compound 0 -shape 8
+ checknbshapes result -vertex 3 -edge 2 -wire 1 -face 0 -shell 0 -solid 0 -compsolid 0 -compound 0 -shape 6
}
smallview
--- /dev/null
+puts "============="
+puts "0032964: Modeling Algorithms - 2d Offset sometimes 'split' straight edges"
+puts "============="
+
+pload MODELING
+vertex p1 -90 40 0
+vertex p2 40 40 0
+vertex p3 40 -90 0
+edge e1 p1 p2
+edge e2 p2 p3
+wire w1 e1 e2
+openoffset oo w1 1 40
+checknbshapes oo_1 -vertex 3 -edge 2 -wire 1 -shape 6
+checkview -display oo_1 -2d -path ${imagedir}/${test_image}.png