mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0028230: Convert C0 2d curve to C1 raises exception
The treatment of small curves (length of curves is less then tolerance used for checking G1) is added in Geom2dConvert_CompCurveToBSplineCurve.cxx
This commit is contained in:
parent
712879c808
commit
2dad173d8b
@ -1480,7 +1480,7 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS,
|
|||||||
Geom2dConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(0));
|
Geom2dConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(0));
|
||||||
if (ArrayOfConcatenated->Length()>=2){
|
if (ArrayOfConcatenated->Length()>=2){
|
||||||
for (i=1;i<ArrayOfConcatenated->Length();i++){
|
for (i=1;i<ArrayOfConcatenated->Length();i++){
|
||||||
fusion=C.Add(ArrayOfConcatenated->Value(i),tolerance);
|
fusion=C.Add(ArrayOfConcatenated->Value(i),tolerance, Standard_True);
|
||||||
if (fusion==Standard_False)
|
if (fusion==Standard_False)
|
||||||
Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
|
Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
|
||||||
}
|
}
|
||||||
|
@ -88,19 +88,29 @@ Add(const Handle(Geom2d_BoundedCurve)& NewCurve,
|
|||||||
Standard_Integer LBs = Bs->NbPoles(), LCb = myCurve->NbPoles();
|
Standard_Integer LBs = Bs->NbPoles(), LCb = myCurve->NbPoles();
|
||||||
|
|
||||||
// myCurve est elle fermee ?
|
// myCurve est elle fermee ?
|
||||||
if (myCurve->Pole(LCb).Distance(myCurve->Pole(1))< myTol){
|
if (myCurve->Pole(LCb).Distance(myCurve->Pole(1)) < myTol){
|
||||||
if(After){
|
if(After){
|
||||||
// Ajout Apres ?
|
// Ajout Apres ?
|
||||||
if (myCurve->Pole(LCb).Distance(Bs->Pole(LBs)) < myTol) {Bs->Reverse();}
|
Standard_Real d1 = myCurve->Pole(LCb).Distance(Bs->Pole(1));
|
||||||
if (myCurve->Pole(LCb).Distance(Bs->Pole(1)) < myTol) {
|
Standard_Real d2 = myCurve->Pole(LCb).Distance(Bs->Pole(LBs));
|
||||||
|
if (d2 < d1) {
|
||||||
|
Bs->Reverse();
|
||||||
|
d1 = d2;
|
||||||
|
}
|
||||||
|
if (d1 < myTol) {
|
||||||
Add(myCurve, Bs, Standard_True);
|
Add(myCurve, Bs, Standard_True);
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// Ajout avant ?
|
// Ajout avant ?
|
||||||
if (myCurve->Pole(1).Distance(Bs->Pole(1)) < myTol) {Bs->Reverse();}
|
Standard_Real d1 = myCurve->Pole(1).Distance(Bs->Pole(1));
|
||||||
if (myCurve->Pole(1).Distance(Bs->Pole(LBs)) < myTol) {
|
Standard_Real d2 = myCurve->Pole(1).Distance(Bs->Pole(LBs));
|
||||||
|
if (d1 < d2) {
|
||||||
|
Bs->Reverse();
|
||||||
|
d2 = d1;
|
||||||
|
}
|
||||||
|
if (d2 < myTol) {
|
||||||
Add(Bs, myCurve, Standard_False);
|
Add(Bs, myCurve, Standard_False);
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
11
tests/bugs/moddata_3/bug28230
Normal file
11
tests/bugs/moddata_3/bug28230
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR28230"
|
||||||
|
puts "==========="
|
||||||
|
puts ""
|
||||||
|
###############################################################################
|
||||||
|
# Convert C0 2d curve to C1 raises exception
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28230_edge.brep] e
|
||||||
|
mk2dcurve pc e 2
|
||||||
|
splitc12d pc 0
|
Loading…
x
Reference in New Issue
Block a user