mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-30 12:14:08 +03:00
0032809: Sweep algorithm with Round Corner mode failed
Fix indentation within GeomFill_Sweep.cxx 0032809: Sweep algorithm with Round Corner mode failed Add fix what repair shipping at corner after circle edge at path Add fix test for bug 24909_3
This commit is contained in:
parent
5078d0d84e
commit
a793b75e21
@ -861,7 +861,8 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
|
|||||||
Prof2 = BRep_Tool::Curve(E2, f2, l2);
|
Prof2 = BRep_Tool::Curve(E2, f2, l2);
|
||||||
|
|
||||||
// Indeed, both Prof1 and Prof2 are the same curves but in different positions
|
// Indeed, both Prof1 and Prof2 are the same curves but in different positions
|
||||||
|
// Prof1's param domain may equals to Prof2's param domain *(-1), which means EF.Orientation() == EL.Orientation()
|
||||||
|
Standard_Boolean bSameCurveDomain = EF.Orientation() != EL.Orientation();
|
||||||
gp_Pnt P1, P2, P;
|
gp_Pnt P1, P2, P;
|
||||||
|
|
||||||
// Choose the angle of opening
|
// Choose the angle of opening
|
||||||
@ -887,7 +888,8 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const gp_Pnt aP2 = Prof2->Value(aPrm[aMaxIdx]).Transformed(aTf);
|
const Standard_Real aPrm2[] = { f2, 0.5*(f2 + l2), l2 };
|
||||||
|
const gp_Pnt aP2 = Prof2->Value(aPrm2[bSameCurveDomain ? aMaxIdx : 2 - aMaxIdx]).Transformed(aTf);
|
||||||
const gp_Vec2d aV1(aP1[aMaxIdx].Z(), aP1[aMaxIdx].X());
|
const gp_Vec2d aV1(aP1[aMaxIdx].Z(), aP1[aMaxIdx].X());
|
||||||
const gp_Vec2d aV2(aP2.Z(), aP2.X());
|
const gp_Vec2d aV2(aP2.Z(), aP2.X());
|
||||||
if (aV1.SquareMagnitude() <= gp::Resolution() ||
|
if (aV1.SquareMagnitude() <= gp::Resolution() ||
|
||||||
|
@ -250,11 +250,8 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
|
|||||||
// Function ::Build2d
|
// Function ::Build2d
|
||||||
// Purpose :A venir...
|
// Purpose :A venir...
|
||||||
//===============================================================
|
//===============================================================
|
||||||
// Standard_Boolean GeomFill_Sweep::Build2d(const GeomAbs_Shape Continuity,
|
|
||||||
Standard_Boolean GeomFill_Sweep::Build2d(const GeomAbs_Shape,
|
Standard_Boolean GeomFill_Sweep::Build2d(const GeomAbs_Shape,
|
||||||
// const Standard_Integer Degmax,
|
|
||||||
const Standard_Integer,
|
const Standard_Integer,
|
||||||
// const Standard_Integer Segmax)
|
|
||||||
const Standard_Integer)
|
const Standard_Integer)
|
||||||
{
|
{
|
||||||
Standard_Boolean Ok = Standard_False;
|
Standard_Boolean Ok = Standard_False;
|
||||||
@ -420,9 +417,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
|
|||||||
{
|
{
|
||||||
Standard_Boolean Ok = Standard_False;
|
Standard_Boolean Ok = Standard_False;
|
||||||
|
|
||||||
Handle(Geom_BSplineSurface) BSurf;
|
Handle(Geom_BSplineSurface) BSurf = Handle(Geom_BSplineSurface)::DownCast(mySec->BSplineSurface()->Copy());
|
||||||
BSurf = Handle(Geom_BSplineSurface)::DownCast(
|
|
||||||
mySec->BSplineSurface()->Copy());
|
|
||||||
if (BSurf.IsNull()) return Ok; // Ce mode de construction est impossible
|
if (BSurf.IsNull()) return Ok; // Ce mode de construction est impossible
|
||||||
|
|
||||||
|
|
||||||
@ -437,8 +432,7 @@ GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location,
|
|||||||
myLoc->Intervals(Param_de_decoupeC3, GeomAbs_C3);
|
myLoc->Intervals(Param_de_decoupeC3, GeomAbs_C3);
|
||||||
|
|
||||||
|
|
||||||
AdvApprox_PrefAndRec Preferentiel(Param_de_decoupeC2,
|
AdvApprox_PrefAndRec Preferentiel(Param_de_decoupeC2, Param_de_decoupeC3);
|
||||||
Param_de_decoupeC3);
|
|
||||||
|
|
||||||
Handle(TColStd_HArray1OfReal) ThreeDTol = new (TColStd_HArray1OfReal) (1, 4);
|
Handle(TColStd_HArray1OfReal) ThreeDTol = new (TColStd_HArray1OfReal) (1, 4);
|
||||||
ThreeDTol->Init(Tol3d); // A Affiner...
|
ThreeDTol->Init(Tol3d); // A Affiner...
|
||||||
@ -1010,9 +1004,12 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
|
|||||||
Handle(Geom_Line) CL = new (Geom_Line)(L);
|
Handle(Geom_Line) CL = new (Geom_Line)(L);
|
||||||
uf = CL->ReversedParameter(ULast);
|
uf = CL->ReversedParameter(ULast);
|
||||||
ul = CL->ReversedParameter(UFirst);
|
ul = CL->ReversedParameter(UFirst);
|
||||||
UFirst = uf;
|
|
||||||
ULast = ul;
|
// Following the example of the code for the sphere:
|
||||||
isUReversed = Standard_True;
|
// "we cannot control U because myExchUV = Standard_True,
|
||||||
|
// so it is necessary to change UFirst and ULast"
|
||||||
|
UFirst = ul;
|
||||||
|
ULast = uf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else SError = 0.;
|
else SError = 0.;
|
||||||
@ -1139,7 +1136,6 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
|
|||||||
if (IsFirst)
|
if (IsFirst)
|
||||||
return myCurve2d->Value(1);
|
return myCurve2d->Value(1);
|
||||||
return myCurve2d->Value(myCurve2d->Length());
|
return myCurve2d->Value(myCurve2d->Length());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===============================================================
|
//===============================================================
|
||||||
@ -1155,8 +1151,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
|
|||||||
// Function :
|
// Function :
|
||||||
// Purpose :
|
// Purpose :
|
||||||
//===============================================================
|
//===============================================================
|
||||||
Handle(Geom2d_Curve)
|
Handle(Geom2d_Curve) GeomFill_Sweep::Trace(const Standard_Integer IndexOfTrace) const
|
||||||
GeomFill_Sweep::Trace(const Standard_Integer IndexOfTrace) const
|
|
||||||
{
|
{
|
||||||
Standard_Integer ind = IndexOfTrace + 1;
|
Standard_Integer ind = IndexOfTrace + 1;
|
||||||
if (IndexOfTrace > myLoc->TraceNumber())
|
if (IndexOfTrace > myLoc->TraceNumber())
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC24909 ALL: TEST INCOMPLETE"
|
puts "TODO OCC24909 ALL: Error: sweep failed"
|
||||||
|
|
||||||
puts "========"
|
puts "========"
|
||||||
puts "OCC24909"
|
puts "OCC24909"
|
||||||
@ -28,4 +28,8 @@ trotate Circle001 0 0 0 0.577350269189625731 0.577350269189625731 0.577350269189
|
|||||||
ttranslate Circle001 0 -71 203.5
|
ttranslate Circle001 0 -71 203.5
|
||||||
addsweep Circle001
|
addsweep Circle001
|
||||||
|
|
||||||
buildsweep Sweep001 -C -S
|
set result [buildsweep Sweep001 -C -S]
|
||||||
|
|
||||||
|
if {[regexp "Not Done" $result]} {
|
||||||
|
puts "Error: sweep failed"
|
||||||
|
}
|
16
tests/pipe/bugs/bug32809
Normal file
16
tests/pipe/bugs/bug32809
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "bug32809: Sweep algorithm with Round Corner doesnot work"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug32809_path.brep] p
|
||||||
|
restore [locate_data_file bug32809_profile.brep] pr
|
||||||
|
|
||||||
|
mksweep p
|
||||||
|
setsweep -CF
|
||||||
|
addsweep pr
|
||||||
|
|
||||||
|
buildsweep result -R -S
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checknbshapes result -vertex 140 -edge 285 -wire 140 -face 140 -shell 1
|
1
tests/pipe/bugs/end
Normal file
1
tests/pipe/bugs/end
Normal file
@ -0,0 +1 @@
|
|||||||
|
puts "TEST COMPLETED"
|
Loading…
x
Reference in New Issue
Block a user