Geom2dConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(0));
if (ArrayOfConcatenated->Length()>=2){
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)
Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
}
Standard_Integer LBs = Bs->NbPoles(), LCb = myCurve->NbPoles();
// myCurve est elle fermee ?
- if (myCurve->Pole(LCb).Distance(myCurve->Pole(1))< myTol){
+ if (myCurve->Pole(LCb).Distance(myCurve->Pole(1)) < myTol){
if(After){
// Ajout Apres ?
- if (myCurve->Pole(LCb).Distance(Bs->Pole(LBs)) < myTol) {Bs->Reverse();}
- if (myCurve->Pole(LCb).Distance(Bs->Pole(1)) < myTol) {
+ Standard_Real d1 = myCurve->Pole(LCb).Distance(Bs->Pole(1));
+ 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);
return Standard_True;
}
}
else{
// Ajout avant ?
- if (myCurve->Pole(1).Distance(Bs->Pole(1)) < myTol) {Bs->Reverse();}
- if (myCurve->Pole(1).Distance(Bs->Pole(LBs)) < myTol) {
+ Standard_Real d1 = myCurve->Pole(1).Distance(Bs->Pole(1));
+ 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);
return Standard_True;
}
--- /dev/null
+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