TopoDS_Vertex V1,V2;
const Handle(Geom2d_Curve)& Bis = Bisec.Value();
-
+ Standard_Boolean ForceAdd = Standard_False;
+ Handle(Geom2d_TrimmedCurve) aTC = Handle(Geom2d_TrimmedCurve)::DownCast(Bis);
+ if(!aTC.IsNull() && aTC->BasisCurve()->IsPeriodic())
+ {
+ gp_Pnt2d Pf = Bis->Value(Bis->FirstParameter());
+ gp_Pnt2d Pl = Bis->Value(Bis->LastParameter());
+ ForceAdd = Pf.Distance(Pl) <= Precision::Confusion();
+ }
+
U1 = Bis->FirstParameter();
if (SOnE) {
V2 = TopoDS::Vertex(Vertices.Value(ii));
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
- if (!Trim.IsInside(P)) {
+ if (!Trim.IsInside(P) || ForceAdd) {
if (!V1.IsNull()) {
Detromp(Shape1).Append(V1);
Detromp(Shape2).Append(V1);
if (!EOnE) {
if (!Precision::IsInfinite(U2)) {
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
- if (!Trim.IsInside(P)) {
+ if (!Trim.IsInside(P) || ForceAdd) {
if (!V1.IsNull()) {
Detromp(Shape1).Append(V1);
Detromp(Shape2).Append(V1);
--- /dev/null
+puts "========"
+puts "OCC27679"
+puts "========"
+puts ""
+###################################
+# Wrong offset: overlapping edges
+###################################
+
+restore [locate_data_file bug27679_w.brep] w
+
+mkoffset r w 1 20
+renamevar r_1 result
+
+checknbshapes result -edge 23
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png