mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0027679: Wrong offset: overlapping edges
Method BRepFill_OffsetWire::UpdateDetromp(...) is modified for correct treatment of closed bisectors. Test case for issue #27679
This commit is contained in:
parent
56091b56ac
commit
c65f82013b
@ -1310,6 +1310,14 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
|
|||||||
TopoDS_Vertex V1,V2;
|
TopoDS_Vertex V1,V2;
|
||||||
|
|
||||||
const Handle(Geom2d_Curve)& Bis = Bisec.Value();
|
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();
|
U1 = Bis->FirstParameter();
|
||||||
|
|
||||||
@ -1324,7 +1332,7 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
|
|||||||
V2 = TopoDS::Vertex(Vertices.Value(ii));
|
V2 = TopoDS::Vertex(Vertices.Value(ii));
|
||||||
|
|
||||||
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
|
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
|
||||||
if (!Trim.IsInside(P)) {
|
if (!Trim.IsInside(P) || ForceAdd) {
|
||||||
if (!V1.IsNull()) {
|
if (!V1.IsNull()) {
|
||||||
Detromp(Shape1).Append(V1);
|
Detromp(Shape1).Append(V1);
|
||||||
Detromp(Shape2).Append(V1);
|
Detromp(Shape2).Append(V1);
|
||||||
@ -1342,7 +1350,7 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
|
|||||||
if (!EOnE) {
|
if (!EOnE) {
|
||||||
if (!Precision::IsInfinite(U2)) {
|
if (!Precision::IsInfinite(U2)) {
|
||||||
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
|
gp_Pnt2d P = Bis->Value((U2 + U1)*0.5);
|
||||||
if (!Trim.IsInside(P)) {
|
if (!Trim.IsInside(P) || ForceAdd) {
|
||||||
if (!V1.IsNull()) {
|
if (!V1.IsNull()) {
|
||||||
Detromp(Shape1).Append(V1);
|
Detromp(Shape1).Append(V1);
|
||||||
Detromp(Shape2).Append(V1);
|
Detromp(Shape2).Append(V1);
|
||||||
|
16
tests/bugs/modalg_6/bug27679
Normal file
16
tests/bugs/modalg_6/bug27679
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user