diff --git a/src/AppParCurves/AppParCurves_MultiPoint.cxx b/src/AppParCurves/AppParCurves_MultiPoint.cxx index 12fef12342..c5f6e02ef1 100644 --- a/src/AppParCurves/AppParCurves_MultiPoint.cxx +++ b/src/AppParCurves/AppParCurves_MultiPoint.cxx @@ -173,21 +173,30 @@ const gp_Pnt2d& AppParCurves_MultiPoint::Point2d (const Standard_Integer Index) void AppParCurves_MultiPoint::Dump(Standard_OStream& o) const { o << "AppParCurves_MultiPoint dump:" << endl; - o << "It contains " << NbPoints() << " 3d points and " << NbPoints2d() <<" 2d points." << endl; - /* - if (Dimension(i) == 3) { - for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) { - o << " Pole No. " << j << ": " << endl; - o << " Pole x = " << (tabPoint->Value(i)->Point(j)).X() << endl; - o << " Pole y = " << (tabPoint->Value(i)->Point(j)).Y() << endl; - o << " Pole z = " << (tabPoint->Value(i)->Point(j)).Z() << endl; - } + const Standard_Integer aNbPnts3D = NbPoints(), + aNbPnts2D = NbPoints2d(); + o << "It contains " << aNbPnts3D << " 3d points and " << aNbPnts2D <<" 2d points." << endl; + + if(aNbPnts3D > 0) + { + for(Standard_Integer i = tabPoint->Lower(); i <= tabPoint->Upper(); i++) + { + o << "3D-Point #" << i << endl; + + o << " Pole x = " << (tabPoint->Value(i)/*->Point(j)*/).X() << endl; + o << " Pole y = " << (tabPoint->Value(i)/*->Point(j)*/).Y() << endl; + o << " Pole z = " << (tabPoint->Value(i)/*->Point(j)*/).Z() << endl; } - else { - for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) { - o << " Pole No. " << j << ": " << endl; - o << " Pole x = " << (tabPoint->Value(i)->Point2d(j)).X() << endl; - o << " Pole y = " << (tabPoint->Value(i)->Point2d(j)).Y() << endl; - } -*/ + } + + if(aNbPnts2D > 0) + { + for(Standard_Integer i = tabPoint2d->Lower(); i <= tabPoint2d->Upper(); i++) + { + o << "2D-Point #" << i << endl; + + o << " Pole x = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).X() << endl; + o << " Pole y = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).Y() << endl; + } + } } diff --git a/src/BRepFill/BRepFill_LocationLaw.cxx b/src/BRepFill/BRepFill_LocationLaw.cxx index 77b38825bf..5a02d83b98 100644 --- a/src/BRepFill/BRepFill_LocationLaw.cxx +++ b/src/BRepFill/BRepFill_LocationLaw.cxx @@ -608,8 +608,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index, gp_Trsf fila; fila.SetValues(M(1,1), M(1,2), M(1,3), V.X(), M(2,1), M(2,2), M(2,3), V.Y(), - M(3,1), M(3,2), M(3,3), V.Z(), - 1.e-12, 1.e-14); + M(3,1), M(3,2), M(3,3), V.Z()); //TopLoc_Location Loc(fila); //W.Location(Loc.Multiplied(W.Location())); W = BRepBuilderAPI_Transform(W, fila, Standard_True); //copy diff --git a/src/BRepFill/BRepFill_Pipe.cxx b/src/BRepFill/BRepFill_Pipe.cxx index 04a2ec68de..8d8e5eef89 100644 --- a/src/BRepFill/BRepFill_Pipe.cxx +++ b/src/BRepFill/BRepFill_Pipe.cxx @@ -263,8 +263,7 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine, myLoc->Law(1)->D0(first, M, V); fila.SetValues(M(1,1), M(1,2), M(1,3), V.X(), M(2,1), M(2,2), M(2,3), V.Y(), - M(3,1), M(3,2), M(3,3), V.Z(), - 1.e-12, 1.e-14); + M(3,1), M(3,2), M(3,3), V.Z()); fila.Multiply(myTrsf); TopLoc_Location LocFirst(fila); @@ -293,8 +292,7 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine, // try { // Not good, but there are no other means to test SetValues fila.SetValues(M(1,1), M(1,2), M(1,3), V.X(), M(2,1), M(2,2), M(2,3), V.Y(), - M(3,1), M(3,2), M(3,3), V.Z(), - 1.e-12, 1.e-14); + M(3,1), M(3,2), M(3,3), V.Z()); fila.Multiply(myTrsf); TopLoc_Location LocLast(fila); if (! myLoc->IsClosed() || LocFirst != LocLast) { diff --git a/src/BinTools/BinTools_LocationSet.cxx b/src/BinTools/BinTools_LocationSet.cxx index fb4cbcf323..c76b17f9ca 100644 --- a/src/BinTools/BinTools_LocationSet.cxx +++ b/src/BinTools/BinTools_LocationSet.cxx @@ -46,9 +46,7 @@ static Standard_IStream& operator >>(Standard_IStream& IS, gp_Trsf& T) T.SetValues(V1[0],V1[1],V1[2],V[0], V2[0],V2[1],V2[2],V[1], - V3[0],V3[1],V3[2],V[2], - Precision::Angular(), - Precision::Confusion()); + V3[0],V3[1],V3[2],V[2]); return IS; } diff --git a/src/GeomFill/GeomFill_Sweep.cxx b/src/GeomFill/GeomFill_Sweep.cxx index a65f63a3c1..b74a2ee3f4 100644 --- a/src/GeomFill/GeomFill_Sweep.cxx +++ b/src/GeomFill/GeomFill_Sweep.cxx @@ -527,8 +527,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) TfBegin.SetValues(GTfBegin(1,1), GTfBegin(1,2), GTfBegin(1,3), GTfBegin(1,4), GTfBegin(2,1), GTfBegin(2,2), GTfBegin(2,3), GTfBegin(2,4), - GTfBegin(3,1), GTfBegin(3,2), GTfBegin(3,3), GTfBegin(3,4), - 1.e-12, 1.e-14); + GTfBegin(3,1), GTfBegin(3,2), GTfBegin(3,3), GTfBegin(3,4)); // Get the last transformation theLoc->D0(aLast, M, VEnd); @@ -538,8 +537,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) TfEnd.SetValues(GTfEnd(1,1), GTfEnd(1,2), GTfEnd(1,3), GTfEnd(1,4), GTfEnd(2,1), GTfEnd(2,2), GTfEnd(2,3), GTfEnd(2,4), - GTfEnd(3,1), GTfEnd(3,2), GTfEnd(3,3), GTfEnd(3,4), - 1.e-12, 1.e-14); + GTfEnd(3,1), GTfEnd(3,2), GTfEnd(3,3), GTfEnd(3,4)); Handle(Geom_Surface) aSurf = theSec->BSplineSurface(); Standard_Real Umin; @@ -611,8 +609,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) OCC_CATCH_SIGNALS Tf2.SetValues(Tf(1,1), Tf(1,2), Tf(1,3), Tf(1,4), Tf(2,1), Tf(2,2), Tf(2,3), Tf(2,4), - Tf(3,1), Tf(3,2), Tf(3,3), Tf(3,4), - 1.e-12, 1.e-14); + Tf(3,1), Tf(3,2), Tf(3,3), Tf(3,4)); } catch (Standard_ConstructionError) { IsTrsf = Standard_False; @@ -799,8 +796,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) // OCC_CATCH_SIGNALS Tf2.SetValues(Tf(1,1), Tf(1,2), Tf(1,3), Tf(1,4), Tf(2,1), Tf(2,2), Tf(2,3), Tf(2,4), - Tf(3,1), Tf(3,2), Tf(3,3), Tf(3,4), - 1.e-14, 1.e-15); + Tf(3,1), Tf(3,2), Tf(3,3), Tf(3,4)); // } // catch (Standard_ConstructionError) { // IsTrsf = Standard_False; diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 39b53eb01b..8e0ab0cc99 100644 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -1106,6 +1106,38 @@ Handle(Adaptor2d_HCurve2d) V1 = V0 + vsens*vperiod; Pts2d(i).SetCoord(U1,V1); myProjIsDone = Standard_True; + + if((i == 2) && (!IsEqual(uperiod, 0.0) || !IsEqual(vperiod, 0.0))) + {//Make 1st point more precise for periodic surfaces + const Standard_Integer aSize = 3; + const gp_Pnt2d aP(Pts2d(2)); + Standard_Real aUpar[aSize], aVpar[aSize]; + Pts2d(1).Coord(aUpar[1], aVpar[1]); + aUpar[0] = aUpar[1] - uperiod; + aUpar[2] = aUpar[1] + uperiod; + aVpar[0] = aVpar[1] - vperiod; + aVpar[2] = aVpar[1] + vperiod; + + Standard_Real aSQdistMin = RealLast(); + Standard_Integer aBestUInd = 1, aBestVInd = 1; + const Standard_Integer aSizeU = IsEqual(uperiod, 0.0) ? 1 : aSize, + aSizeV = IsEqual(vperiod, 0.0) ? 1 : aSize; + for(Standard_Integer uInd = 0; uInd < aSizeU; uInd++) + { + for(Standard_Integer vInd = 0; vInd < aSizeV; vInd++) + { + Standard_Real aSQdist = aP.SquareDistance(gp_Pnt2d(aUpar[uInd], aVpar[vInd])); + if(aSQdist < aSQdistMin) + { + aSQdistMin = aSQdist; + aBestUInd = uInd; + aBestVInd = vInd; + } + } + } + + Pts2d(1).SetCoord(aUpar[aBestUInd], aVpar[aBestVInd]); + }//if(i == 2) condition } } } diff --git a/src/Prs3d/Prs3d_Presentation.cxx b/src/Prs3d/Prs3d_Presentation.cxx index a205f09122..57bcb11348 100644 --- a/src/Prs3d/Prs3d_Presentation.cxx +++ b/src/Prs3d/Prs3d_Presentation.cxx @@ -195,8 +195,7 @@ TColStd_Array2OfReal matrix(1,4,1,4); trsf.SetValues( matrix.Value(1,1),matrix.Value(1,2),matrix.Value(1,3),matrix.Value(1,4), matrix.Value(2,1),matrix.Value(2,2),matrix.Value(2,3),matrix.Value(2,4), - matrix.Value(3,1),matrix.Value(3,2),matrix.Value(3,3),matrix.Value(3,4), - 0.001,0.0001); + matrix.Value(3,1),matrix.Value(3,2),matrix.Value(3,3),matrix.Value(3,4)); Handle(Geom_Transformation) gtrsf = new Geom_Transformation(trsf); return gtrsf; diff --git a/src/PrsMgr/PrsMgr_Prs.cxx b/src/PrsMgr/PrsMgr_Prs.cxx index 60b214d9c0..5909869b0b 100644 --- a/src/PrsMgr/PrsMgr_Prs.cxx +++ b/src/PrsMgr/PrsMgr_Prs.cxx @@ -58,8 +58,7 @@ Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStruc Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow()); TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3), AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3), - AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3), - Precision::Angular(),Precision::Confusion()); + AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3)); Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf); return myPresentation3d->Compute(aProjector,G); @@ -90,8 +89,7 @@ void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjecto Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow()); TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3), AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3), - AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3), - Precision::Angular(),Precision::Confusion()); + AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3)); Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf); diff --git a/src/TopTools/TopTools_LocationSet.cxx b/src/TopTools/TopTools_LocationSet.cxx index 1c015a8e2d..225624313f 100644 --- a/src/TopTools/TopTools_LocationSet.cxx +++ b/src/TopTools/TopTools_LocationSet.cxx @@ -237,9 +237,7 @@ static void ReadTrsf(gp_Trsf& T, T.SetValues(V1[0],V1[1],V1[2],V[0], V2[0],V2[1],V2[2],V[1], - V3[0],V3[1],V3[2],V[2], - Precision::Angular(), - Precision::Confusion()); + V3[0],V3[1],V3[2],V[2]); return; } //======================================================================= diff --git a/src/Vrml/Vrml_MatrixTransform.cxx b/src/Vrml/Vrml_MatrixTransform.cxx index 0a78a08de4..44060649f6 100644 --- a/src/Vrml/Vrml_MatrixTransform.cxx +++ b/src/Vrml/Vrml_MatrixTransform.cxx @@ -28,8 +28,7 @@ Vrml_MatrixTransform::Vrml_MatrixTransform() gp_Trsf T; T.SetValues ( 1, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 0, - Precision::Angular(), Precision::Confusion()); + 0, 0, 1, 0); T.SetScaleFactor(1); myMatrix = T; diff --git a/src/gp/gp_Trsf.cdl b/src/gp/gp_Trsf.cdl index 2ebff2d577..763090a626 100644 --- a/src/gp/gp_Trsf.cdl +++ b/src/gp/gp_Trsf.cdl @@ -204,8 +204,7 @@ is SetValues(me : in out; a11, a12, a13, a14, a21, a22, a23, a24, - a31, a32, a33, a34 : Real; - Tolang, TolDist : Real) + a31, a32, a33, a34 : Real) ---Purpose: Sets the coefficients of the transformation. The -- transformation of the point x,y,z is the point @@ -213,16 +212,11 @@ is -- -- x' = a11 x + a12 y + a13 z + a14 -- y' = a21 x + a22 y + a23 z + a24 - -- z' = a31 x + a32 y + a43 z + a34 - -- - -- Tolang and TolDist are used to test for null - -- angles and null distances to determine the form of - -- the transformation (identity, translation, etc..). + -- z' = a31 x + a32 y + a33 z + a34 -- -- The method Value(i,j) will return aij. - -- Raises ConstructionError if the determinant of the aij is null. Or if - -- the matrix as not a uniform scale. - + -- Raises ConstructionError if the determinant of the aij is null. + -- The matrix is orthogonalyzed before future using. raises ConstructionError from Standard @@ -371,7 +365,9 @@ is ---C++: inline --- Purpose : Transformation of a triplet XYZ with a Trsf - + Orthogonalize(me: in out) + is protected; + --- Purpose : Makes orthogonalization of "matrix" fields diff --git a/src/gp/gp_Trsf.cxx b/src/gp/gp_Trsf.cxx index 8d7fae2d17..e19b2e4e64 100644 --- a/src/gp/gp_Trsf.cxx +++ b/src/gp/gp_Trsf.cxx @@ -322,14 +322,7 @@ void gp_Trsf::SetValues(const Standard_Real a11, const Standard_Real a31, const Standard_Real a32, const Standard_Real a33, - const Standard_Real a34, -// const Standard_Real Tolang, - const Standard_Real , - const Standard_Real -#ifndef No_Exception - TolDist -#endif - ) + const Standard_Real a34) { gp_XYZ col1(a11,a21,a31); gp_XYZ col2(a12,a22,a32); @@ -341,63 +334,19 @@ void gp_Trsf::SetValues(const Standard_Real a11, Standard_Real As = s; if (As < 0) As = - As; Standard_ConstructionError_Raise_if - (As < gp::Resolution(),"gp_Trsf::SeValues, null determinant"); + (As < gp::Resolution(),"gp_Trsf::SetValues, null determinant"); if (s > 0) s = Pow(s,1./3.); else s = -Pow(-s,1./3.); M.Divide(s); - // check if the matrix is a rotation matrix - // the transposition should be the invert. - gp_Mat TM(M); - TM.Transpose(); - TM.Multiply(M); - // - // don t trust the initial values ! - // - gp_Mat anIdentity ; - anIdentity.SetIdentity() ; - TM.Subtract(anIdentity); - As = TM.Value(1,1); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(1,2); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(1,3); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(2,1); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(2,2); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(2,3); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(3,1); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(3,2); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); - As = TM.Value(3,3); - if (As < 0) As = - As; - Standard_ConstructionError_Raise_if - (As > TolDist,"gp_Trsf::SeValues, non uniform"); scale = s; shape = gp_CompoundTrsf; + matrix = M; + Orthogonalize(); + loc = col4; } @@ -811,3 +760,42 @@ Standard_Boolean gp_Trsf::GetRotation (gp_XYZ& theAxis, theAxis = aVec.XYZ(); return Standard_True; } + +//======================================================================= +//function : Orthogonalize +//purpose : +//======================================================================= +void gp_Trsf::Orthogonalize() +{ + gp_Mat aTM(matrix); + + gp_XYZ aV1 = aTM.Column(1); + gp_XYZ aV2 = aTM.Column(2); + gp_XYZ aV3 = aTM.Column(3); + + aV1.Normalize(); + + aV2 -= aV1*(aV2.Dot(aV1)); + aV2.Normalize(); + + aV3 -= aV1*(aV3.Dot(aV1)) + aV2*(aV3.Dot(aV2)); + aV3.Normalize(); + + aTM.SetCols(aV1, aV2, aV3); + + aV1 = aTM.Row(1); + aV2 = aTM.Row(2); + aV3 = aTM.Row(3); + + aV1.Normalize(); + + aV2 -= aV1*(aV2.Dot(aV1)); + aV2.Normalize(); + + aV3 -= aV1*(aV3.Dot(aV1)) + aV2*(aV3.Dot(aV2)); + aV3.Normalize(); + + aTM.SetRows(aV1, aV2, aV3); + + matrix = aTM; +} diff --git a/src/gp/gp_Trsf2d.cdl b/src/gp/gp_Trsf2d.cdl index 474f82e538..8ca5e235bd 100644 --- a/src/gp/gp_Trsf2d.cdl +++ b/src/gp/gp_Trsf2d.cdl @@ -242,6 +242,31 @@ is Transforms (me; Coord : out XY) is static; ---C++: inline --- Purpose : Transforms a doublet XY with a Trsf2d + + SetValues(me : in out; + a11, a12, a13, a21, a22, a23 : Real) + + ---Purpose: Sets the coefficients of the transformation. The + -- transformation of the point x,y is the point + -- x',y' with : + -- + -- x' = a11 x + a12 y + a13 + -- y' = a21 x + a22 y + a23 + -- + -- The method Value(i,j) will return aij. + -- Raises ConstructionError if the determinant of the aij is null. + -- If the matrix as not a uniform scale it will be orthogonalyzed before future using. + + raises + ConstructionError from Standard + + is static; + + Orthogonalize(me: in out) + is protected; + --- Purpose : Makes orthogonalization of "matrix" + + fields scale : Real; diff --git a/src/gp/gp_Trsf2d.cxx b/src/gp/gp_Trsf2d.cxx index cfaf435a8e..7fae973f69 100644 --- a/src/gp/gp_Trsf2d.cxx +++ b/src/gp/gp_Trsf2d.cxx @@ -23,31 +23,32 @@ void gp_Trsf2d::SetMirror (const gp_Ax2d& A) { shape = gp_Ax1Mirror; - scale = - 1.0; const gp_Dir2d& V = A.Direction (); const gp_Pnt2d& P = A.Location (); Standard_Real VX = V.X(); Standard_Real VY = V.Y(); Standard_Real X0 = P.X(); Standard_Real Y0 = P.Y(); - matrix.SetCol (1, gp_XY (1.0 - 2.0 * VX * VX, -2.0 * VX * VY)); - matrix.SetCol (2, gp_XY (-2.0 * VX * VY, 1.0 - 2.0 * VY * VY)); - loc.SetCoord (-2.0 * ((VX * VX - 1.0) * X0 + (VX * VY * Y0)), - -2.0 * ((VX * VY * X0) + (VY * VY - 1.0) * Y0)); + SetValues(1.0-2.0*VX*VX, -2.0*VX*VY, -2.0*((VX * VX - 1.0)*X0 + (VX*VY*Y0)), + -2.0*VX*VY, 1.0-2.0*VY*VY, -2.0*((VX*VY*X0)+(VY*VY-1.0)*Y0)); + + scale = - 1.0; } void gp_Trsf2d::SetTransformation (const gp_Ax2d& FromA1, const gp_Ax2d& ToA2) { shape = gp_CompoundTrsf; - scale = 1.0; //matrix from XOY to A2 : const gp_XY& V1 = ToA2.Direction().XY(); gp_XY V2 (-V1.Y(), V1.X()); - matrix.SetCol (1, V1); - matrix.SetCol (2, V2); - loc = ToA2.Location().XY(); + + SetValues(V1.X(), V2.X(), ToA2.Location().X(), + V1.Y(), V2.Y(), ToA2.Location().Y()); + + scale = 1.0; + matrix.Transpose(); loc.Multiply (matrix); loc.Reverse(); @@ -65,12 +66,14 @@ void gp_Trsf2d::SetTransformation (const gp_Ax2d& FromA1, void gp_Trsf2d::SetTransformation (const gp_Ax2d& A) { shape = gp_CompoundTrsf; - scale = 1.0; const gp_XY& V1 = A.Direction().XY(); gp_XY V2 (-V1.Y(), V1.X()); - matrix.SetCol (1, V1); - matrix.SetCol (2, V2); - loc = A.Location().XY(); + + SetValues(V1.X(), V2.X(), A.Location().X(), + V1.Y(), V2.Y(), A.Location().Y()); + + scale = 1.0; + matrix.Transpose(); loc.Multiply (matrix); loc.Reverse(); @@ -497,3 +500,73 @@ void gp_Trsf2d::PreMultiply (const gp_Trsf2d& T) } } +//======================================================================= +//function : SetValues +//purpose : +//======================================================================= +void gp_Trsf2d::SetValues(const Standard_Real a11, + const Standard_Real a12, + const Standard_Real a13, + const Standard_Real a21, + const Standard_Real a22, + const Standard_Real a23) +{ + gp_XY col1(a11,a21); + gp_XY col2(a12,a22); + gp_XY col3(a13,a23); + // compute the determinant + gp_Mat2d M(col1,col2); + Standard_Real s = M.Determinant(); + Standard_Real As = s; + if (As < 0) + As = - As; + Standard_ConstructionError_Raise_if + (As < gp::Resolution(),"gp_Trsf2d::SetValues, null determinant"); + + if (s > 0) + s = sqrt(s); + else + s = sqrt(-s); + + M.Divide(s); + + scale = s; + shape = gp_CompoundTrsf; + + matrix = M; + Orthogonalize(); + + loc = col3; +} + + +//======================================================================= +//function : Orthogonalize +//purpose : +//======================================================================= +void gp_Trsf2d::Orthogonalize() +{ + gp_Mat2d aTM(matrix); + + gp_XY aV1 = aTM.Column(1); + gp_XY aV2 = aTM.Column(2); + + aV1.Normalize(); + + aV2 -= aV1*(aV2.Dot(aV1)); + aV2.Normalize(); + + aTM.SetCols(aV1, aV2); + + aV1 = aTM.Row(1); + aV2 = aTM.Row(2); + + aV1.Normalize(); + + aV2 -= aV1*(aV2.Dot(aV1)); + aV2.Normalize(); + + aTM.SetRows(aV1, aV2); + + matrix = aTM; +} diff --git a/tests/bugs/modalg_5/bug22831 b/tests/bugs/modalg_5/bug22831 index 9929eb05aa..ed76b72127 100644 --- a/tests/bugs/modalg_5/bug22831 +++ b/tests/bugs/modalg_5/bug22831 @@ -1,7 +1,3 @@ -puts "TODO DEBUG_OCC24121 Debian60-64 Windows: \\*\\* Exception \\*\\*.*" -puts "TODO DEBUG_OCC24121 Debian60-64 Windows: An exception was caught" -puts "TODO DEBUG_OCC24121 Debian60-64 Windows: TEST INCOMPLETE" - puts "============" puts "OCC22831" puts "============" diff --git a/tests/de/iges_1/J9 b/tests/de/iges_1/J9 index 33c68b37f5..3ff8684b74 100644 --- a/tests/de/iges_1/J9 +++ b/tests/de/iges_1/J9 @@ -8,8 +8,8 @@ set ref_data { DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 1 ) Summary = 0 ( 1 ) TPSTAT : Faulties = 0 ( 28 ) Warnings = 115 ( 7 ) Summary = 115 ( 35 ) CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 1 ) Solids = 0 ( 1 ) -NBSHAPES : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) Summary = 15075 ( 7693 ) -STATSHAPE : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 6284 ( 3134 ) +NBSHAPES : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) Summary = 15073 ( 7693 ) +STATSHAPE : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 6283 ( 3134 ) TOLERANCE : MaxTol = 0.2496383637 ( 0.2496258832 ) AvgTol = 0.002193043247 ( 0.004111699336 ) LABELS : N0Labels = 27 ( 27 ) N1Labels = 0 ( 0 ) N2Labels = 0 ( 0 ) TotalLabels = 27 ( 27 ) NameLabels = 27 ( 27 ) ColorLabels = 0 ( 0 ) LayerLabels = 0 ( 0 ) PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 ) diff --git a/tests/de/iges_1/K3 b/tests/de/iges_1/K3 index a68c905db2..ea16d18962 100644 --- a/tests/de/iges_1/K3 +++ b/tests/de/iges_1/K3 @@ -12,7 +12,7 @@ CHECKSHAPE : Wires = 12 ( 18 ) Faces = 16 ( 16 ) Shells = 0 ( 0 ) NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 5163 ( 5163 ) Summary = 68418 ( 68418 ) STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 5163 ( 5163 ) FreeWire = 10 ( 10 ) FreeEdge = 283 ( 283 ) SharedEdge = 29071 ( 29075 ) TOLERANCE : MaxTol = 0.9874083984 ( 0.9875071265 ) AvgTol = 0.0111430941 ( 0.01115568387 ) -LABELS : N0Labels = 5392 ( 5458 ) N1Labels = 18 ( 4437 ) N2Labels = 0 ( 0 ) TotalLabels = 5410 ( 9895 ) NameLabels = 5392 ( 5458 ) ColorLabels = 5391 ( 9829 ) LayerLabels = 5391 ( 9829 ) +LABELS : N0Labels = 5392 ( 5458 ) N1Labels = 18 ( 4443 ) N2Labels = 0 ( 0 ) TotalLabels = 5410 ( 9901 ) NameLabels = 5392 ( 5458 ) ColorLabels = 5391 ( 9835 ) LayerLabels = 5391 ( 9835 ) PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 ) NCOLORS : NColors = 4 ( 4 ) COLORS : Colors = BLACK BLUE1 CYAN1 GREEN ( BLACK BLUE1 CYAN1 GREEN ) diff --git a/tests/de/iges_2/B8 b/tests/de/iges_2/B8 index 222077ef71..fdda334316 100644 --- a/tests/de/iges_2/B8 +++ b/tests/de/iges_2/B8 @@ -16,7 +16,7 @@ CHECKSHAPE : Wires = 12 ( 17 ) Faces = 12 ( 11 ) Shells = 0 ( 0 ) NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 4729 ( 4729 ) Summary = 63154 ( 63144 ) STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 4729 ( 4729 ) FreeWire = 18 ( 18 ) FreeEdge = 452 ( 452 ) SharedEdge = 26794 ( 26793 ) TOLERANCE : MaxTol = 0.9804479161 ( 0.9805459497 ) AvgTol = 0.01153089029 ( 0.01154870945 ) -LABELS : N0Labels = 5089 ( 5165 ) N1Labels = 26 ( 3844 ) N2Labels = 0 ( 0 ) TotalLabels = 5115 ( 9009 ) NameLabels = 5089 ( 5165 ) ColorLabels = 5086 ( 8933 ) LayerLabels = 5086 ( 8933 ) +LABELS : N0Labels = 5089 ( 5165 ) N1Labels = 26 ( 3846 ) N2Labels = 0 ( 0 ) TotalLabels = 5115 ( 9011 ) NameLabels = 5089 ( 5165 ) ColorLabels = 5086 ( 8935 ) LayerLabels = 5086 ( 8935 ) PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 ) NCOLORS : NColors = 3 ( 3 ) COLORS : Colors = BLUE1 CYAN1 GREEN ( BLUE1 CYAN1 GREEN ) diff --git a/tests/de/iges_2/E6 b/tests/de/iges_2/E6 index 1ad5fe8d17..fc944857b5 100644 --- a/tests/de/iges_2/E6 +++ b/tests/de/iges_2/E6 @@ -15,7 +15,7 @@ CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) So NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1177 ( 1177 ) Summary = 18232 ( 18230 ) STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1177 ( 1177 ) FreeWire = 5 ( 5 ) FreeEdge = 714 ( 714 ) SharedEdge = 7614 ( 7614 ) TOLERANCE : MaxTol = 0.9436610236 ( 0.8261873283 ) AvgTol = 0.01104814109 ( 0.0107628002 ) -LABELS : N0Labels = 1884 ( 1885 ) N1Labels = 0 ( 1020 ) N2Labels = 0 ( 0 ) TotalLabels = 1884 ( 2905 ) NameLabels = 1884 ( 1885 ) ColorLabels = 1873 ( 2904 ) LayerLabels = 1873 ( 2904 ) +LABELS : N0Labels = 1884 ( 1885 ) N1Labels = 0 ( 1019 ) N2Labels = 0 ( 0 ) TotalLabels = 1884 ( 2904 ) NameLabels = 1884 ( 1885 ) ColorLabels = 1873 ( 2903 ) LayerLabels = 1873 ( 2903 ) PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 ) NCOLORS : NColors = 7 ( 7 ) COLORS : Colors = BLACK BLUE1 CYAN1 GREEN RED WHITE YELLOW ( BLACK BLUE1 CYAN1 GREEN RED WHITE YELLOW ) diff --git a/tests/de/iges_2/G1 b/tests/de/iges_2/G1 index 8e96c58bcf..1704c39fa7 100755 --- a/tests/de/iges_2/G1 +++ b/tests/de/iges_2/G1 @@ -1,6 +1,5 @@ # !!!! This file is generated automatically, do not edit manually! See end script puts "TODO CR23096 ALL: TPSTAT : Faulty" -puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" puts "TODO CR23096 ALL: LABELS : Faulty" diff --git a/tests/mesh/data/standard/J1 b/tests/mesh/data/standard/J1 index b39110db37..69a06e7d79 100755 --- a/tests/mesh/data/standard/J1 +++ b/tests/mesh/data/standard/J1 @@ -1,3 +1,3 @@ set TheFileName shading_082.brep set bug_cross "OCC22687" -set nbcross(All) 16 +set nbcross(All) 0 diff --git a/tests/offset/wire_closed_inside_0_075/C7 b/tests/offset/wire_closed_inside_0_075/C7 index 066233d4ec..497da0a356 100644 --- a/tests/offset/wire_closed_inside_0_075/C7 +++ b/tests/offset/wire_closed_inside_0_075/C7 @@ -1,16 +1,6 @@ -set os "ALL" -if {[array get env os_type] != ""} { - set os $env(os_type) -} - -if { - [string compare $os "Debian40"] == 0 - || [string compare $os "Mandriva2008"] == 0 - } { - puts "TODO OCC23068 $os: Faulty shapes in variables faulty_1 to faulty_4" - puts "TODO OCC23068 $os: Error : The length of result shape is" - puts "TODO OCC23068 $os: Error : Result shape is WRONG" -} +puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_4" +puts "TODO OCC23068 ALL: Error : The length of the resulting shape is" +puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG because it must contain" restore [locate_data_file offset_wire_038.brep] s