From 98dbbeb43380b2d4cef806ace45040066a6efcec Mon Sep 17 00:00:00 2001 From: JGV <> Date: Thu, 28 Apr 2011 15:44:28 +0000 Subject: [PATCH] OCC22361 Incorrect result of BRepOffsetAPI_MakePipeShell algorithm: it tries to build conical surface between two non-coaxial circles --- src/GeomFill/GeomFill_NSections.cdl | 12 +++++---- src/GeomFill/GeomFill_NSections.cxx | 40 ++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/GeomFill/GeomFill_NSections.cdl b/src/GeomFill/GeomFill_NSections.cdl index c29c683f78..6e559af856 100755 --- a/src/GeomFill/GeomFill_NSections.cdl +++ b/src/GeomFill/GeomFill_NSections.cdl @@ -21,8 +21,8 @@ uses Array1OfVec from TColgp, Array1OfInteger from TColStd, Array1OfReal from TColStd, - SequenceOfReal from TColStd - + SequenceOfReal from TColStd, + SequenceOfTrsf from GeomFill raises OutOfRange @@ -56,8 +56,9 @@ is returns NSections from GeomFill; - Create(NC : SequenceOfCurve from TColGeom; - NP : SequenceOfReal from TColStd; + Create(NC : SequenceOfCurve from TColGeom; + Trsfs : SequenceOfTrsf from GeomFill; + NP : SequenceOfReal from TColStd; UF, UL, VF, VL : Real from Standard; Surf : BSplineSurface from Geom) ---Purpose: Make a SectionLaw with N Curves and N associated parameters. @@ -264,7 +265,8 @@ is fields UFirst, ULast, VFirst, VLast : Real; mySections : SequenceOfCurve from TColGeom; - myParams : SequenceOfReal from TColStd; + myTrsfs : SequenceOfTrsf from GeomFill; + myParams : SequenceOfReal from TColStd; mySurface : BSplineSurface from Geom; myRefSurf : BSplineSurface from Geom; end NSections; diff --git a/src/GeomFill/GeomFill_NSections.cxx b/src/GeomFill/GeomFill_NSections.cxx index 4727466f96..2ff8f73225 100755 --- a/src/GeomFill/GeomFill_NSections.cxx +++ b/src/GeomFill/GeomFill_NSections.cxx @@ -249,6 +249,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, //======================================================================= GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, + const GeomFill_SequenceOfTrsf& Trsfs, const TColStd_SequenceOfReal& NP, const Standard_Real UF, const Standard_Real UL, @@ -257,6 +258,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const Handle(Geom_BSplineSurface)& Surf) { mySections = NC; + myTrsfs = Trsfs; myParams = NP; UFirst = UF; ULast = UL; @@ -936,29 +938,43 @@ void GeomFill_NSections::GetMinimalWeight(TColStd_Array1OfReal& Weights) const && ( AC2.GetType() == GeomAbs_Circle ) ; if (isconic) { gp_Circ C1 = AC1.Circle(); + if (!myTrsfs.IsEmpty()) + C1.Transform(myTrsfs(1).Inverted()); gp_Circ C2 = AC2.Circle(); + if (!myTrsfs.IsEmpty()) + C2.Transform(myTrsfs(2).Inverted()); Standard_Real Tol = 1.e-7; - Standard_Boolean samedir, linearrad, sameaxis; - samedir = (C1.Axis().IsParallel(C2.Axis(),1.e-4)); + //Standard_Boolean samedir, linearrad, sameaxis; + isconic = (C1.Axis().IsParallel(C2.Axis(),1.e-4)); // pour 2 sections, la variation du rayon est forcement lineaire - linearrad = Standard_True; + //linearrad = Standard_True; // formule plus generale pour 3 sections au moins // Standard_Real param0 = C2.Radius()*myParams(1) - C1.Radius()*myParams(2); // param0 = param0 / (C2.Radius()-C1.Radius()) ; // linearrad = ( Abs( C3.Radius()*myParams(1)-C1.Radius()*myParams(3) // - param0*(C3.Radius()-C1.Radius()) ) < Tol); - sameaxis = (C1.Location().Distance(C2.Location())