From bf0ba8139ae56f73d3871689c29deffc8aac5d50 Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 21 Dec 2012 16:05:58 +0400 Subject: [PATCH] 0023643: Intersection algorithm produces B-Spline curve in case of coaxial cones --- src/IntPatch/IntPatch_Intersection.cxx | 45 ++++++++++++++------------ tests/bugs/moddata/bug23643 | 29 +++++++++++++++++ 2 files changed, 54 insertions(+), 20 deletions(-) create mode 100755 tests/bugs/moddata/bug23643 diff --git a/src/IntPatch/IntPatch_Intersection.cxx b/src/IntPatch/IntPatch_Intersection.cxx index a38f12582c..369d9af020 100755 --- a/src/IntPatch/IntPatch_Intersection.cxx +++ b/src/IntPatch/IntPatch_Intersection.cxx @@ -745,10 +745,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, if(ps<0.0) { ps=-ps; } - //modified by NIZNHY-PKV Thu Jul 01 12:14:29 2010f - //if(ps<0.1) { if(ps<0.015) { - //modified by NIZNHY-PKV Thu Jul 01 12:14:35 2010t TreatAsBiParametric = Standard_True; } } @@ -769,10 +766,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, if(ps<0.0) { ps=-ps; } - //modified by NIZNHY-PKV Thu Jul 01 12:15:04 2010f - //if(ps<0.1){ if(ps<0.015){ - //modified by NIZNHY-PKV Thu Jul 01 12:15:08 2010t TreatAsBiParametric = Standard_True; } } @@ -793,7 +787,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, } } } - else if (a1 > 1.55 && a2 > 1.55) {//quasi-planes: if same domain, treat as canonic + else if (a1 > 1.55 && a2 > 1.55) { //quasi-planes: if same domain, treat as canonic gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis(); if (A1.IsParallel(A2,Precision::Angular())) { gp_Pnt Apex1 = Con1.Apex(), Apex2 = Con2.Apex(); @@ -803,11 +797,18 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, } } } - } - ////////////////////////////////////////////// - } + else if ((a1 > 1.55 && a2 < 1.55) || (a2 > 1.55 && a1 < 1.55) ) { + gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis(); + if (A1.IsCoaxial(A2,Precision::Angular(),Precision::Confusion())) { + TreatAsBiParametric = Standard_False; + } + } + }// if (typs1 == GeomAbs_Cone) { + }// if(typs2 == GeomAbs_Cone) { // - if(D1->DomainIsInfinite() || D2->DomainIsInfinite()) TreatAsBiParametric= Standard_False; + if(D1->DomainIsInfinite() || D2->DomainIsInfinite()) { + TreatAsBiParametric= Standard_False; + } // Modified by skv - Mon Sep 26 14:58:30 2005 Begin // if(TreatAsBiParametric) { typs1 = typs2 = GeomAbs_BezierSurface; } @@ -1079,10 +1080,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, if(ps<0.0) { ps=-ps; } - //modified by NIZNHY-PKV Thu Jul 01 12:17:56 2010f - //if(ps<0.1) { if(ps<0.015) { - //modified by NIZNHY-PKV Thu Jul 01 12:18:09 2010t TreatAsBiParametric = Standard_True; } } @@ -1104,10 +1102,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, if(ps<0.0){ ps=-ps; } - //modified by NIZNHY-PKV Thu Jul 01 12:17:44 2010f - //if(ps<0.1){ if(ps<0.015){ - //modified by NIZNHY-PKV Thu Jul 01 12:17:48 2010t TreatAsBiParametric = Standard_True; } } @@ -1147,12 +1142,22 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1, TreatAsBiParametric = Standard_False; } } + else if ((a1 > 1.55 && a2 < 1.55) || (a2 > 1.55 && a1 < 1.55) ) { + gp_Ax1 A1 = Con1.Axis(), A2 = Con2.Axis(); + if (A1.IsCoaxial(A2,Precision::Angular(),Precision::Confusion())) { + TreatAsBiParametric = Standard_False; + } + } } ////////////////////////////////////////////// - if(D1->DomainIsInfinite() || D2->DomainIsInfinite()) TreatAsBiParametric= Standard_False; - - if(TreatAsBiParametric) { typs1 = typs2 = GeomAbs_BezierSurface; } + if(D1->DomainIsInfinite() || D2->DomainIsInfinite()) { + TreatAsBiParametric= Standard_False; + } + if(TreatAsBiParametric) { + typs1 = GeomAbs_BezierSurface; + typs2 = GeomAbs_BezierSurface; + } // Surface type definition Standard_Integer ts1 = 0; diff --git a/tests/bugs/moddata/bug23643 b/tests/bugs/moddata/bug23643 new file mode 100755 index 0000000000..18d74e47e8 --- /dev/null +++ b/tests/bugs/moddata/bug23643 @@ -0,0 +1,29 @@ +puts "========================" +puts "OCC23643" +puts "========================" +puts "" +####################################################################### +# Intersection algorithm produces B-Spline curve in case of coaxial cones +####################################################################### + +restore [locate_data_file bug23643_qf3.brep] b + +explode b +copy b_1 f1 +copy b_2 f2 + +mksurface s1 f1 +mksurface s2 f2 + +trim s1t s1 0 2*pi -18 10 +trim s2t s2 0 2*pi -18 10 + +intersect result s1t s2t + +set log [dump result] + +if {[regexp {Trimmed +curve} ${log}]} { + puts "Intersection algorithm work OK" +} else { + puts "Error: Intersection algorithm work bad" +}