mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
56
src/Plate/Plate.cdl
Executable file
56
src/Plate/Plate.cdl
Executable file
@@ -0,0 +1,56 @@
|
||||
-- File: Plate.cdl
|
||||
-- Created: Tue Oct 17 16:44:41 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
--
|
||||
|
||||
package Plate
|
||||
|
||||
uses
|
||||
TCollection, TColStd,
|
||||
math, gp, TColgp
|
||||
is
|
||||
|
||||
class Plate;
|
||||
|
||||
-- Basic Constraints Class
|
||||
class PinpointConstraint;
|
||||
class LinearScalarConstraint;
|
||||
class LinearXYZConstraint;
|
||||
--
|
||||
-- geometric Constraints Class
|
||||
--
|
||||
class GlobalTranslationConstraint;
|
||||
--
|
||||
class PlaneConstraint;
|
||||
class LineConstraint;
|
||||
--
|
||||
class SampledCurveConstraint;
|
||||
--
|
||||
-- class LinearizedHighlightConstraint;
|
||||
--
|
||||
-- class DirectionalPressureConstraint;
|
||||
--
|
||||
--
|
||||
-- Geometric contact of order k Constraint
|
||||
class GtoCConstraint;
|
||||
class FreeGtoCConstraint;
|
||||
|
||||
|
||||
-- utilities and internal Classes
|
||||
class D1;
|
||||
class D2;
|
||||
class D3;
|
||||
class SequenceOfPinpointConstraint instantiates Sequence from TCollection
|
||||
(PinpointConstraint from Plate);
|
||||
class SequenceOfLinearXYZConstraint instantiates Sequence from TCollection
|
||||
(LinearXYZConstraint from Plate);
|
||||
class SequenceOfLinearScalarConstraint instantiates Sequence from TCollection
|
||||
(LinearScalarConstraint from Plate);
|
||||
class Array1OfPinpointConstraint instantiates Array1 from TCollection
|
||||
(PinpointConstraint from Plate);
|
||||
class HArray1OfPinpointConstraint instantiates HArray1 from TCollection
|
||||
(PinpointConstraint from Plate,
|
||||
Array1OfPinpointConstraint from Plate);
|
||||
end Plate;
|
34
src/Plate/Plate_D1.cdl
Executable file
34
src/Plate/Plate_D1.cdl
Executable file
@@ -0,0 +1,34 @@
|
||||
-- File: Plate_D1.cdl
|
||||
-- Created: Thu Oct 19 17:38:21 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
--
|
||||
class D1 from Plate
|
||||
---Purpose : define an order 1 derivatives of a 3d valued
|
||||
-- function of a 2d variable
|
||||
--
|
||||
|
||||
uses XYZ from gp
|
||||
|
||||
is
|
||||
Create(du,dv : XYZ from gp) returns D1;
|
||||
Create(ref : D1 from Plate) returns D1;
|
||||
-- Accessors :
|
||||
DU(me) returns XYZ from gp;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
DV(me) returns XYZ from gp;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
Du, Dv : XYZ from gp;
|
||||
|
||||
friends
|
||||
class GtoCConstraint from Plate,
|
||||
class FreeGtoCConstraint from Plate
|
||||
end;
|
||||
|
||||
|
18
src/Plate/Plate_D1.cxx
Executable file
18
src/Plate/Plate_D1.cxx
Executable file
@@ -0,0 +1,18 @@
|
||||
// File: Plate_D1.cxx
|
||||
// Created: Fri Oct 20 20:00:09 1995
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
|
||||
#include <Plate_D1.ixx>
|
||||
|
||||
Plate_D1::Plate_D1(const gp_XYZ& du, const gp_XYZ& dv)
|
||||
:Du(du),Dv(dv)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Plate_D1::Plate_D1(const Plate_D1& ref)
|
||||
:Du(ref.Du),Dv(ref.Dv)
|
||||
{
|
||||
}
|
14
src/Plate/Plate_D1.lxx
Executable file
14
src/Plate/Plate_D1.lxx
Executable file
@@ -0,0 +1,14 @@
|
||||
// File: Plate_D1.lxx
|
||||
// Created: Tue Jun 9 18:32:43 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const gp_XYZ& Plate_D1::DU() const
|
||||
{
|
||||
return Du;
|
||||
}
|
||||
|
||||
|
||||
inline const gp_XYZ& Plate_D1::DV() const
|
||||
{
|
||||
return Dv;
|
||||
}
|
25
src/Plate/Plate_D2.cdl
Executable file
25
src/Plate/Plate_D2.cdl
Executable file
@@ -0,0 +1,25 @@
|
||||
-- File: Plate_D2.cdl
|
||||
-- Created: Thu Oct 19 18:01:25 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
class D2 from Plate
|
||||
---Purpose : define an order 2 derivatives of a 3d valued
|
||||
-- function of a 2d variable
|
||||
--
|
||||
|
||||
uses XYZ from gp
|
||||
|
||||
is
|
||||
Create(duu,duv,dvv : XYZ from gp) returns D2;
|
||||
Create(ref : D2 from Plate) returns D2;
|
||||
|
||||
fields
|
||||
|
||||
Duu, Duv,Dvv : XYZ from gp;
|
||||
|
||||
friends
|
||||
class GtoCConstraint from Plate,
|
||||
class FreeGtoCConstraint from Plate
|
||||
end;
|
17
src/Plate/Plate_D2.cxx
Executable file
17
src/Plate/Plate_D2.cxx
Executable file
@@ -0,0 +1,17 @@
|
||||
// File: Plate_D2.cxx
|
||||
// Created: Fri Oct 20 20:01:38 1995
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
|
||||
#include <Plate_D2.ixx>
|
||||
|
||||
Plate_D2::Plate_D2(const gp_XYZ& duu, const gp_XYZ& duv, const gp_XYZ& dvv)
|
||||
:Duu(duu),Duv(duv),Dvv(dvv)
|
||||
{
|
||||
}
|
||||
|
||||
Plate_D2::Plate_D2(const Plate_D2& ref)
|
||||
:Duu(ref.Duu),Duv(ref.Duv),Dvv(ref.Dvv)
|
||||
{
|
||||
}
|
26
src/Plate/Plate_D3.cdl
Executable file
26
src/Plate/Plate_D3.cdl
Executable file
@@ -0,0 +1,26 @@
|
||||
-- File: Plate_D3.cdl
|
||||
-- Created: Oct 1998
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
class D3 from Plate
|
||||
---Purpose : define an order 3 derivatives of a 3d valued
|
||||
-- function of a 2d variable
|
||||
--
|
||||
|
||||
uses XYZ from gp
|
||||
|
||||
is
|
||||
Create(duuu,duuv,duvv,dvvv : XYZ from gp) returns D3;
|
||||
Create(ref : D3 from Plate) returns D3;
|
||||
|
||||
fields
|
||||
|
||||
Duuu, Duuv,Duvv,Dvvv : XYZ from gp;
|
||||
|
||||
friends
|
||||
class GtoCConstraint from Plate,
|
||||
class FreeGtoCConstraint from Plate
|
||||
|
||||
end;
|
17
src/Plate/Plate_D3.cxx
Executable file
17
src/Plate/Plate_D3.cxx
Executable file
@@ -0,0 +1,17 @@
|
||||
// File: Plate_D3.cxx
|
||||
// Created: Feb 17 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
|
||||
#include <Plate_D3.ixx>
|
||||
|
||||
Plate_D3::Plate_D3(const gp_XYZ& duuu, const gp_XYZ& duuv, const gp_XYZ& duvv, const gp_XYZ& dvvv)
|
||||
:Duuu(duuu),Duuv(duuv),Duvv(duvv),Dvvv(dvvv)
|
||||
{
|
||||
}
|
||||
|
||||
Plate_D3::Plate_D3(const Plate_D3& ref)
|
||||
:Duuu(ref.Duuu),Duuv(ref.Duuv),Duvv(ref.Duvv),Dvvv(ref.Dvvv)
|
||||
{
|
||||
}
|
80
src/Plate/Plate_FreeGtoCConstraint.cdl
Executable file
80
src/Plate/Plate_FreeGtoCConstraint.cdl
Executable file
@@ -0,0 +1,80 @@
|
||||
-- File: Plate_FreeGtoCConstraint.cdl
|
||||
-- Created: Thu Mar 26 11:55:26 1998
|
||||
-- Author: # Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
|
||||
class FreeGtoCConstraint from Plate
|
||||
---Purpose: define a G1, G2 or G3 constraint on the Plate using weaker
|
||||
-- constraint than GtoCConstraint
|
||||
--
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
XYZ from gp,
|
||||
D1 from Plate,
|
||||
D2 from Plate,
|
||||
D3 from Plate,
|
||||
PinpointConstraint from Plate,
|
||||
LinearScalarConstraint from Plate
|
||||
|
||||
is
|
||||
Create(point2d : XY ; D1S , D1T : D1 from Plate;
|
||||
IncrementalLoad: Real =1.0; orientation: Integer = 0 ) returns FreeGtoCConstraint;
|
||||
-- G1 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate;
|
||||
IncrementalLoad: Real =1.0; orientation: Integer = 0 ) returns FreeGtoCConstraint;
|
||||
-- G2 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate;
|
||||
D3S, D3T : D3 from Plate;
|
||||
IncrementalLoad: Real =1.0; orientation: Integer = 0 ) returns FreeGtoCConstraint;
|
||||
-- G3 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
-- D3S : third derivative of S, the surface we want to correct
|
||||
-- D3T : third derivative of the reference surface
|
||||
|
||||
-- Accessors :
|
||||
nb_PPC(me) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
GetPPC(me; Index: Integer) returns PinpointConstraint;
|
||||
-- "C style" Index : Index : 0 --> nb_PPC-1
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
nb_LSC(me) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
LSC(me; Index: Integer) returns LinearScalarConstraint;
|
||||
-- "C style" Index : Index : 0 --> nb_PPC-1
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
|
||||
fields
|
||||
|
||||
pnt2d : XY ;
|
||||
nb_PPConstraints : Integer;
|
||||
nb_LSConstraints : Integer;
|
||||
myPPC : PinpointConstraint[5];
|
||||
myLSC : LinearScalarConstraint[4];
|
||||
|
||||
end;
|
||||
|
394
src/Plate/Plate_FreeGtoCConstraint.cxx
Executable file
394
src/Plate/Plate_FreeGtoCConstraint.cxx
Executable file
@@ -0,0 +1,394 @@
|
||||
// File: Plate_FreeGtoCConstraint.cxx
|
||||
// Created: Fri Mar 27 08:39:45 1998
|
||||
// Author: # Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Gauss.hxx>
|
||||
|
||||
#include <Plate_FreeGtoCConstraint.ixx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
|
||||
|
||||
static const Standard_Real NORMIN = 1.e-10;
|
||||
static const Standard_Real COSMIN = 1.e-2;
|
||||
|
||||
|
||||
// G1 Constraints
|
||||
|
||||
Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T,
|
||||
const Standard_Real IncrementalLoad, const Standard_Integer orientation)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
nb_LSConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
if(IncrementalLoad!=1.)
|
||||
{
|
||||
gp_XYZ N0 = D1S.Du^D1S.Dv;
|
||||
if(N0.Modulus()< NORMIN) return;
|
||||
N0.Normalize();
|
||||
gp_XYZ N1 = normale;
|
||||
if(orientation!=0) N1 *= orientation;
|
||||
Standard_Real c = N0*N1;
|
||||
if(orientation==0)
|
||||
{
|
||||
if (c <0.)
|
||||
{
|
||||
c *= -1.;
|
||||
N1 *= -1.;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real s = N0.CrossMagnitude(N1);
|
||||
if((s < 1.e-2)&&(c<0.)) return;
|
||||
Standard_Real angle = atan2(c,s);
|
||||
//if (angle < 0.) angle += PI;
|
||||
|
||||
gp_XYZ d = N0^N1;
|
||||
d.Normalize();
|
||||
gp_Dir dir = gp_Dir(d);
|
||||
gp_Trsf rota;
|
||||
gp_Ax1 Axe(gp_Pnt(0,0,0), dir);
|
||||
rota.SetRotation(Axe,angle*(IncrementalLoad-1.));
|
||||
// gp_Trsf rota = gce_MakeRotation(gp_Pnt(0,0,0), dir, angle*(IncrementalLoad-1.));
|
||||
rota.Transforms(normale);
|
||||
}
|
||||
|
||||
gp_XYZ du = D1S.Du*(-1.);
|
||||
gp_XYZ dv = D1S.Dv*(-1.);
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, du,1,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dv,0,1), normale);
|
||||
nb_LSConstraints = 2;
|
||||
|
||||
}
|
||||
|
||||
// G1 + G2 Constraints
|
||||
|
||||
Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T0,
|
||||
const Plate_D2& D2S,const Plate_D2& D2T0,
|
||||
const Standard_Real IncrementalLoad, const Standard_Integer orientation)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
nb_LSConstraints = 0;
|
||||
Plate_D1 D1T = D1T0;
|
||||
Plate_D2 D2T = D2T0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
if(normaleS.Modulus() < NORMIN)
|
||||
{
|
||||
if(IncrementalLoad!=1.) return;
|
||||
gp_XYZ du = D1S.Du*(-1.);
|
||||
gp_XYZ dv = D1S.Dv*(-1.);
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, du,1,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dv,0,1), normale);
|
||||
nb_LSConstraints = 2;
|
||||
return;
|
||||
}
|
||||
normaleS.Normalize();
|
||||
|
||||
|
||||
if(IncrementalLoad!=1.)
|
||||
{
|
||||
gp_XYZ N0 = normaleS;
|
||||
gp_XYZ N1 = normale;
|
||||
if(orientation!=0) N1 *= orientation;
|
||||
Standard_Real c = N0*N1;
|
||||
if(orientation==0)
|
||||
{
|
||||
if (c <0.)
|
||||
{
|
||||
c *= -1.;
|
||||
N1 *= -1.;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Real s = N0.CrossMagnitude(N1);
|
||||
if((s < 1.e-2)&&(c<0.)) return;
|
||||
Standard_Real angle = atan2(c,s);
|
||||
|
||||
gp_XYZ d = N0^N1;
|
||||
d.Normalize();
|
||||
gp_Dir dir = gp_Dir(d);
|
||||
gp_Trsf rota;
|
||||
gp_Ax1 Axe(gp_Pnt(0,0,0), dir);
|
||||
rota.SetRotation(Axe,angle*(IncrementalLoad-1.));
|
||||
// gp_Trsf rota = gce_MakeRotation(gp_Pnt(0,0,0), dir, angle*(IncrementalLoad-1.));
|
||||
rota.Transforms(normale);
|
||||
rota.Transforms(D1T.Du);
|
||||
rota.Transforms(D1T.Dv);
|
||||
rota.Transforms(D2T.Duu);
|
||||
rota.Transforms(D2T.Duv);
|
||||
rota.Transforms(D2T.Dvv);
|
||||
}
|
||||
|
||||
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN)
|
||||
{
|
||||
gp_XYZ du = D1S.Du*(-1.);
|
||||
gp_XYZ dv = D1S.Dv*(-1.);
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, du,1,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dv,0,1), normale);
|
||||
nb_LSConstraints = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = Suu-D2S.Duu;
|
||||
gp_XYZ duv = Suv-D2S.Duv;
|
||||
gp_XYZ dvv = Svv-D2S.Dvv;
|
||||
duu *= IncrementalLoad;
|
||||
duv *= IncrementalLoad;
|
||||
dvv *= IncrementalLoad;
|
||||
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, duu,2,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, duv,1,1), normale);
|
||||
myLSC[2] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dvv,0,2), normale);
|
||||
nb_LSConstraints = 3;
|
||||
}
|
||||
|
||||
// G1 + G2 + G3 Constraints
|
||||
|
||||
Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T0,
|
||||
const Plate_D2& D2S,const Plate_D2& D2T0,
|
||||
const Plate_D3& D3S,const Plate_D3& D3T0,
|
||||
const Standard_Real IncrementalLoad, const Standard_Integer orientation)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
nb_LSConstraints = 0;
|
||||
Plate_D1 D1T = D1T0;
|
||||
Plate_D2 D2T = D2T0;
|
||||
Plate_D3 D3T = D3T0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
if(normaleS.Modulus() < NORMIN)
|
||||
{
|
||||
if(IncrementalLoad!=1.) return;
|
||||
gp_XYZ du = D1S.Du*(-1.);
|
||||
gp_XYZ dv = D1S.Dv*(-1.);
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, du,1,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dv,0,1), normale);
|
||||
nb_LSConstraints = 2;
|
||||
return;
|
||||
}
|
||||
normaleS.Normalize();
|
||||
|
||||
if(IncrementalLoad!=1.)
|
||||
{
|
||||
gp_XYZ N0 = normaleS;
|
||||
gp_XYZ N1 = normale;
|
||||
if(orientation!=0) N1 *= orientation;
|
||||
Standard_Real c = N0*N1;
|
||||
if(orientation==0)
|
||||
{
|
||||
if (c <0.)
|
||||
{
|
||||
c *= -1.;
|
||||
N1 *= -1.;
|
||||
}
|
||||
}
|
||||
Standard_Real s = N0.CrossMagnitude(N1);
|
||||
if((s < 1.e-2)&&(c<0.)) return;
|
||||
Standard_Real angle = atan2(c,s);
|
||||
|
||||
gp_XYZ d = N0^N1;
|
||||
d.Normalize();
|
||||
gp_Dir dir = gp_Dir(d);
|
||||
gp_Trsf rota;
|
||||
gp_Ax1 Axe(gp_Pnt(0,0,0), dir);
|
||||
rota.SetRotation(Axe,angle*(IncrementalLoad-1.));
|
||||
// gp_Trsf rota = gce_MakeRotation(gp_Pnt(0,0,0), dir, angle*(IncrementalLoad-1.));
|
||||
rota.Transforms(normale);
|
||||
rota.Transforms(D1T.Du);
|
||||
rota.Transforms(D1T.Dv);
|
||||
rota.Transforms(D2T.Duu);
|
||||
rota.Transforms(D2T.Duv);
|
||||
rota.Transforms(D2T.Dvv);
|
||||
rota.Transforms(D3T.Duuu);
|
||||
rota.Transforms(D3T.Duuv);
|
||||
rota.Transforms(D3T.Duvv);
|
||||
rota.Transforms(D3T.Dvvv);
|
||||
}
|
||||
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN)
|
||||
{
|
||||
gp_XYZ du = D1S.Du*(-1.);
|
||||
gp_XYZ dv = D1S.Dv*(-1.);
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, du,1,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dv,0,1), normale);
|
||||
nb_LSConstraints = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = normaleS * (normale*(Suu-D2S.Duu))*invcos;
|
||||
gp_XYZ duv = normaleS * (normale*(Suv-D2S.Duv))*invcos;
|
||||
gp_XYZ dvv = normaleS * (normale*(Svv-D2S.Dvv))*invcos;
|
||||
|
||||
myPPC[2] = Plate_PinpointConstraint(pnt2d, duu,2,0);
|
||||
myPPC[3] = Plate_PinpointConstraint(pnt2d, duv,1,1);
|
||||
myPPC[4] = Plate_PinpointConstraint(pnt2d, dvv,0,2);
|
||||
nb_PPConstraints = 5;
|
||||
|
||||
// G3 Constraints
|
||||
|
||||
vec(0) = (D2S.Duu + duu - Suu)*Su;
|
||||
vec(1) = (D2S.Duu + duu - Suu)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uu = sol(0);
|
||||
Standard_Real B1uu = sol(1);
|
||||
|
||||
vec(0) = (D2S.Duv + duv - Suv)*Su;
|
||||
vec(1) = (D2S.Duv + duv - Suv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uv = sol(0);
|
||||
Standard_Real B1uv = sol(1);
|
||||
|
||||
vec(0) = (D2S.Dvv + dvv - Svv)*Su;
|
||||
vec(1) = (D2S.Dvv + dvv - Svv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0vv = sol(0);
|
||||
Standard_Real B1vv = sol(1);
|
||||
|
||||
gp_XYZ Suuu = D3T.Duuu*(a*a*a) + D3T.Duuv*(3*a*a*b) + D3T.Duvv*(3*a*b*b) + D3T.Dvvv*(b*b*b);
|
||||
gp_XYZ Suuv = D3T.Duuu*(a*a*c) + D3T.Duuv*(a*a*d+2*a*b*c) + D3T.Duvv*(b*b*c+2*a*b*d) + D3T.Dvvv*(b*b*d);
|
||||
gp_XYZ Suvv = D3T.Duuu*(a*c*c) + D3T.Duuv*(b*c*c+2*a*c*d) + D3T.Duvv*(a*d*d+2*b*c*d) + D3T.Dvvv*(b*d*d);
|
||||
gp_XYZ Svvv = D3T.Duuu*(c*c*c) + D3T.Duuv*(3*c*c*d) + D3T.Duvv*(3*c*d*d) + D3T.Dvvv*(d*d*d);
|
||||
|
||||
Standard_Real &A0u = a;
|
||||
Standard_Real &A1u = b;
|
||||
Standard_Real &A0v = c;
|
||||
Standard_Real &A1v = d;
|
||||
Suuu += D2T.Duu*(3*A0u*B0uu) + D2T.Duv*(3*(A0u*B1uu+A1u*B0uu)) + D2T.Dvv*(3*A1u*B1uu);
|
||||
Suuv += D2T.Duu*(2*A0u*B0uv+A0v*B0uu) + D2T.Duv*(2*(A0u*B1uv+A1u*B0uv)+A0v*B1uu+A1v*B0uu) + D2T.Dvv*(2*A1u*B1uv+A1v*B1uu);
|
||||
Suvv += D2T.Duu*(A0u*B0vv+2*A0v*B0uv) + D2T.Duv*(2*(A0v*B1uv+A1v*B0uv)+A0u*B1vv+A1u*B0vv) + D2T.Dvv*(2*A1v*B1uv+A1u*B1vv);
|
||||
Svvv += D2T.Duu*(3*A0v*B0vv) + D2T.Duv*(3*(A0v*B1vv+A1v*B0vv)) + D2T.Dvv*(3*A1v*B1vv);
|
||||
|
||||
|
||||
|
||||
gp_XYZ duuu = Suuu-D3S.Duuu;
|
||||
gp_XYZ duuv = Suuv-D3S.Duuv;
|
||||
gp_XYZ duvv = Suvv-D3S.Duvv;
|
||||
gp_XYZ dvvv = Svvv-D3S.Dvvv;
|
||||
duuu *= IncrementalLoad;
|
||||
duuv *= IncrementalLoad;
|
||||
duvv *= IncrementalLoad;
|
||||
dvvv *= IncrementalLoad;
|
||||
|
||||
|
||||
myLSC[0] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, duuu,3,0), normale);
|
||||
myLSC[1] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, duuv,2,1), normale);
|
||||
myLSC[2] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, duvv,1,2), normale);
|
||||
myLSC[3] = Plate_LinearScalarConstraint(Plate_PinpointConstraint(pnt2d, dvvv,0,3), normale);
|
||||
nb_LSConstraints = 4;
|
||||
}
|
26
src/Plate/Plate_FreeGtoCConstraint.lxx
Executable file
26
src/Plate/Plate_FreeGtoCConstraint.lxx
Executable file
@@ -0,0 +1,26 @@
|
||||
// File: Plate_FreeGtoCConstraint.lxx
|
||||
// Created: Mon May 25 09:08:34 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const Standard_Integer& Plate_FreeGtoCConstraint::nb_PPC() const
|
||||
{
|
||||
return nb_PPConstraints;
|
||||
}
|
||||
|
||||
|
||||
inline const Plate_PinpointConstraint& Plate_FreeGtoCConstraint::GetPPC(const Standard_Integer Index) const
|
||||
{
|
||||
return myPPC[Index];
|
||||
}
|
||||
|
||||
|
||||
inline const Standard_Integer& Plate_FreeGtoCConstraint::nb_LSC() const
|
||||
{
|
||||
return nb_LSConstraints;
|
||||
}
|
||||
|
||||
|
||||
inline const Plate_LinearScalarConstraint& Plate_FreeGtoCConstraint::LSC(const Standard_Integer Index) const
|
||||
{
|
||||
return myLSC[Index];
|
||||
}
|
36
src/Plate/Plate_GlobalTranslationConstraint.cdl
Executable file
36
src/Plate/Plate_GlobalTranslationConstraint.cdl
Executable file
@@ -0,0 +1,36 @@
|
||||
-- File: Plate_GlobalTranslationConstraint.cdl
|
||||
-- Created: Thu Mar 26 13:13:17 1998
|
||||
-- Author: # Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
class GlobalTranslationConstraint from Plate
|
||||
---Purpose: force a set of UV points to translate without deformation
|
||||
--
|
||||
--
|
||||
uses
|
||||
XY from gp,
|
||||
SequenceOfXY from TColgp,
|
||||
LinearXYZConstraint from Plate
|
||||
|
||||
is
|
||||
Create(SOfXY : SequenceOfXY) returns GlobalTranslationConstraint;
|
||||
-- SofXY is a set of UV parametres for which The Plate function
|
||||
-- will give the same value
|
||||
--
|
||||
-- The Sequence length have to be at least 2.
|
||||
|
||||
|
||||
--
|
||||
-- Accessors :
|
||||
LXYZC(me) returns LinearXYZConstraint;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
|
||||
fields
|
||||
myLXYZC : LinearXYZConstraint;
|
||||
|
||||
end;
|
||||
|
||||
|
26
src/Plate/Plate_GlobalTranslationConstraint.cxx
Executable file
26
src/Plate/Plate_GlobalTranslationConstraint.cxx
Executable file
@@ -0,0 +1,26 @@
|
||||
// File: Plate_GlobalTranslationConstraint.cxx
|
||||
// Created: Mon Mar 30 12:49:46 1998
|
||||
// Author: # Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_GlobalTranslationConstraint.ixx>
|
||||
|
||||
Plate_GlobalTranslationConstraint::Plate_GlobalTranslationConstraint(const TColgp_SequenceOfXY& SOfXY)
|
||||
:myLXYZC(SOfXY.Length()-1,SOfXY.Length() )
|
||||
{
|
||||
Standard_Integer i ;
|
||||
for( i=1;i<=SOfXY.Length();i++)
|
||||
{
|
||||
myLXYZC.SetPPC(i,Plate_PinpointConstraint (SOfXY(i),gp_XYZ(0.,0.,0.),0,0));
|
||||
}
|
||||
for(i=1;i<=SOfXY.Length()-1;i++)
|
||||
{
|
||||
myLXYZC.SetCoeff(i,1,-1.);
|
||||
for(Standard_Integer j=2;j<=SOfXY.Length();j++)
|
||||
{
|
||||
if(j==(i+1)) myLXYZC.SetCoeff(i,j,1.);
|
||||
else myLXYZC.SetCoeff(i,j,0.);
|
||||
}
|
||||
}
|
||||
}
|
8
src/Plate/Plate_GlobalTranslationConstraint.lxx
Executable file
8
src/Plate/Plate_GlobalTranslationConstraint.lxx
Executable file
@@ -0,0 +1,8 @@
|
||||
// File: Plate_GlobalTranslationConstraint.lxx
|
||||
// Created: Mon May 25 09:16:59 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const Plate_LinearXYZConstraint& Plate_GlobalTranslationConstraint::LXYZC() const
|
||||
{
|
||||
return myLXYZC;
|
||||
}
|
102
src/Plate/Plate_GtoCConstraint.cdl
Executable file
102
src/Plate/Plate_GtoCConstraint.cdl
Executable file
@@ -0,0 +1,102 @@
|
||||
-- File: Plate_GtoCConstraint.cdl
|
||||
-- Created: Thu Oct 19 18:06:18 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
class GtoCConstraint from Plate
|
||||
---Purpose: define a G1, G2 or G3 constraint on the Plate
|
||||
--
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
XYZ from gp,
|
||||
D1 from Plate,
|
||||
D2 from Plate,
|
||||
D3 from Plate,
|
||||
PinpointConstraint from Plate
|
||||
|
||||
is
|
||||
Create(ref : GtoCConstraint from Plate) returns GtoCConstraint;
|
||||
|
||||
Create(point2d : XY ; D1S , D1T : D1 ) returns GtoCConstraint;
|
||||
-- G1 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
|
||||
Create(point2d : XY ; D1S , D1T : D1;
|
||||
nP : XYZ from gp ) returns GtoCConstraint;
|
||||
-- G1 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- nP : normal vector to tge Plane in which we want the correction to occur
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate) returns GtoCConstraint;
|
||||
-- G2 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate;
|
||||
nP : XYZ from gp ) returns GtoCConstraint;
|
||||
-- G2 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
-- nP : normal vector to tge Plane in which we want the correction to occur
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate;
|
||||
D3S, D3T : D3 from Plate) returns GtoCConstraint;
|
||||
-- G3 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
-- D3S : third derivative of S, the surface we want to correct
|
||||
-- D3T : third derivative of the reference surface
|
||||
|
||||
Create(point2d : XY from gp; D1S , D1T : D1 from Plate;
|
||||
D2S, D2T : D2 from Plate;
|
||||
D3S, D3T : D3 from Plate;
|
||||
nP : XYZ from gp ) returns GtoCConstraint;
|
||||
-- G3 constraint:
|
||||
-- D1S : first derivative of S, the surface we want to correct
|
||||
-- D1T : first derivative of the reference surface
|
||||
-- D2S : second derivative of S, the surface we want to correct
|
||||
-- D2T : second derivative of the reference surface
|
||||
-- D3S : third derivative of S, the surface we want to correct
|
||||
-- D3T : third derivative of the reference surface
|
||||
-- nP : normal vector to tge Plane in which we want the correction to occur
|
||||
|
||||
-- Accessors :
|
||||
nb_PPC(me) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
GetPPC(me; Index: Integer) returns PinpointConstraint;
|
||||
-- "C style" Index : Index : 0 --> nb_PPC-1
|
||||
--
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
D1SurfInit(me) returns D1;
|
||||
--
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
myPPC : PinpointConstraint[9];
|
||||
myD1SurfInit : D1;
|
||||
pnt2d : XY ;
|
||||
nb_PPConstraints : Integer;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
478
src/Plate/Plate_GtoCConstraint.cxx
Executable file
478
src/Plate/Plate_GtoCConstraint.cxx
Executable file
@@ -0,0 +1,478 @@
|
||||
// File: Plate_GtoCConstraint.cxx
|
||||
// Created: Fri Oct 20 20:05:53 1995
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Gauss.hxx>
|
||||
|
||||
|
||||
#include <Plate_GtoCConstraint.ixx>
|
||||
|
||||
//alr le 12/11/96
|
||||
static const Standard_Real NORMIN = 1.e-10;
|
||||
static const Standard_Real COSMIN = 1.e-2;
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const Plate_GtoCConstraint& ref)
|
||||
:myD1SurfInit(ref.myD1SurfInit)
|
||||
{
|
||||
pnt2d = ref.pnt2d;
|
||||
nb_PPConstraints = ref.nb_PPConstraints;
|
||||
for(Standard_Integer i = 0; i<nb_PPConstraints; i++)
|
||||
myPPC[i] = ref.myPPC[i];
|
||||
}
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d, const Plate_D1& D1S, const Plate_D1& D1T)
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
|
||||
nb_PPConstraints = 2;
|
||||
}
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d,
|
||||
const Plate_D1& D1S, const Plate_D1& D1T, const gp_XYZ& nP)
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
|
||||
gp_XYZ nSP = normaleS - nP*(nP*normaleS);
|
||||
if(nSP.Modulus() < NORMIN) return;
|
||||
nSP.Normalize();
|
||||
|
||||
Standard_Real cos_normales = normale*nSP;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = nSP* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = nSP* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
|
||||
nb_PPConstraints = 2;
|
||||
}
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d, const Plate_D1& D1S, const Plate_D1& D1T,
|
||||
const Plate_D2& D2S, const Plate_D2& D2T)
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = normaleS * (normale*(Suu-D2S.Duu))*invcos;
|
||||
gp_XYZ duv = normaleS * (normale*(Suv-D2S.Duv))*invcos;
|
||||
gp_XYZ dvv = normaleS * (normale*(Svv-D2S.Dvv))*invcos;
|
||||
|
||||
|
||||
myPPC[2] = Plate_PinpointConstraint(pnt2d, duu,2,0);
|
||||
myPPC[3] = Plate_PinpointConstraint(pnt2d, duv,1,1);
|
||||
myPPC[4] = Plate_PinpointConstraint(pnt2d, dvv,0,2);
|
||||
nb_PPConstraints = 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d, const Plate_D1& D1S, const Plate_D1& D1T,
|
||||
const Plate_D2& D2S, const Plate_D2& D2T, const gp_XYZ& nP)
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
//alr le 12/11/96
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
|
||||
gp_XYZ nSP = normaleS - nP*(nP*normaleS);
|
||||
if(nSP.Modulus() < NORMIN) return;
|
||||
nSP.Normalize();
|
||||
|
||||
Standard_Real cos_normales = normale*nSP;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = nSP* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = nSP* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = nSP * (normale*(Suu-D2S.Duu))*invcos;
|
||||
gp_XYZ duv = nSP * (normale*(Suv-D2S.Duv))*invcos;
|
||||
gp_XYZ dvv = nSP * (normale*(Svv-D2S.Dvv))*invcos;
|
||||
|
||||
|
||||
myPPC[2] = Plate_PinpointConstraint(pnt2d, duu,2,0);
|
||||
myPPC[3] = Plate_PinpointConstraint(pnt2d, duv,1,1);
|
||||
myPPC[4] = Plate_PinpointConstraint(pnt2d, dvv,0,2);
|
||||
nb_PPConstraints = 5;
|
||||
}
|
||||
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d, const Plate_D1& D1S, const Plate_D1& D1T,
|
||||
const Plate_D2& D2S, const Plate_D2& D2T,
|
||||
const Plate_D3& D3S, const Plate_D3& D3T)
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = normaleS * (normale*(Suu-D2S.Duu))*invcos;
|
||||
gp_XYZ duv = normaleS * (normale*(Suv-D2S.Duv))*invcos;
|
||||
gp_XYZ dvv = normaleS * (normale*(Svv-D2S.Dvv))*invcos;
|
||||
|
||||
|
||||
myPPC[2] = Plate_PinpointConstraint(pnt2d, duu,2,0);
|
||||
myPPC[3] = Plate_PinpointConstraint(pnt2d, duv,1,1);
|
||||
myPPC[4] = Plate_PinpointConstraint(pnt2d, dvv,0,2);
|
||||
nb_PPConstraints = 5;
|
||||
|
||||
// G3 Constraints
|
||||
|
||||
vec(0) = (D2S.Duu + duu - Suu)*Su;
|
||||
vec(1) = (D2S.Duu + duu - Suu)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uu = sol(0);
|
||||
Standard_Real B1uu = sol(1);
|
||||
|
||||
vec(0) = (D2S.Duv + duv - Suv)*Su;
|
||||
vec(1) = (D2S.Duv + duv - Suv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uv = sol(0);
|
||||
Standard_Real B1uv = sol(1);
|
||||
|
||||
vec(0) = (D2S.Dvv + dvv - Svv)*Su;
|
||||
vec(1) = (D2S.Dvv + dvv - Svv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0vv = sol(0);
|
||||
Standard_Real B1vv = sol(1);
|
||||
|
||||
gp_XYZ Suuu = D3T.Duuu*(a*a*a) + D3T.Duuv*(3*a*a*b) + D3T.Duvv*(3*a*b*b) + D3T.Dvvv*(b*b*b);
|
||||
gp_XYZ Suuv = D3T.Duuu*(a*a*c) + D3T.Duuv*(a*a*d+2*a*b*c) + D3T.Duvv*(b*b*c+2*a*b*d) + D3T.Dvvv*(b*b*d);
|
||||
gp_XYZ Suvv = D3T.Duuu*(a*c*c) + D3T.Duuv*(b*c*c+2*a*c*d) + D3T.Duvv*(a*d*d+2*b*c*d) + D3T.Dvvv*(b*d*d);
|
||||
gp_XYZ Svvv = D3T.Duuu*(c*c*c) + D3T.Duuv*(3*c*c*d) + D3T.Duvv*(3*c*d*d) + D3T.Dvvv*(d*d*d);
|
||||
|
||||
Standard_Real &A0u = a;
|
||||
Standard_Real &A1u = b;
|
||||
Standard_Real &A0v = c;
|
||||
Standard_Real &A1v = d;
|
||||
Suuu += D2T.Duu*(3*A0u*B0uu) + D2T.Duv*(3*(A0u*B1uu+A1u*B0uu)) + D2T.Dvv*(3*A1u*B1uu);
|
||||
Suuv += D2T.Duu*(2*A0u*B0uv+A0v*B0uu) + D2T.Duv*(2*(A0u*B1uv+A1u*B0uv)+A0v*B1uu+A1v*B0uu) + D2T.Dvv*(2*A1u*B1uv+A1v*B1uu);
|
||||
Suvv += D2T.Duu*(A0u*B0vv+2*A0v*B0uv) + D2T.Duv*(2*(A0v*B1uv+A1v*B0uv)+A0u*B1vv+A1u*B0vv) + D2T.Dvv*(2*A1v*B1uv+A1u*B1vv);
|
||||
Svvv += D2T.Duu*(3*A0v*B0vv) + D2T.Duv*(3*(A0v*B1vv+A1v*B0vv)) + D2T.Dvv*(3*A1v*B1vv);
|
||||
|
||||
gp_XYZ duuu = normaleS * (normale*(Suuu-D3S.Duuu))*invcos;
|
||||
gp_XYZ duuv = normaleS * (normale*(Suuv-D3S.Duuv))*invcos;
|
||||
gp_XYZ duvv = normaleS * (normale*(Suvv-D3S.Duvv))*invcos;
|
||||
gp_XYZ dvvv = normaleS * (normale*(Svvv-D3S.Dvvv))*invcos;
|
||||
|
||||
myPPC[5] = Plate_PinpointConstraint(pnt2d, duuu,3,0);
|
||||
myPPC[6] = Plate_PinpointConstraint(pnt2d, duuv,2,1);
|
||||
myPPC[7] = Plate_PinpointConstraint(pnt2d, duvv,1,2);
|
||||
myPPC[8] = Plate_PinpointConstraint(pnt2d, dvvv,0,3);
|
||||
nb_PPConstraints = 9;
|
||||
}
|
||||
|
||||
|
||||
Plate_GtoCConstraint::Plate_GtoCConstraint(const gp_XY& point2d, const Plate_D1& D1S, const Plate_D1& D1T,
|
||||
const Plate_D2& D2S, const Plate_D2& D2T,
|
||||
const Plate_D3& D3S, const Plate_D3& D3T,
|
||||
// const gp_XYZ& nP)
|
||||
const gp_XYZ& )
|
||||
:myD1SurfInit(D1S)
|
||||
{
|
||||
|
||||
pnt2d = point2d;
|
||||
nb_PPConstraints = 0;
|
||||
|
||||
gp_XYZ normale = D1T.Du^D1T.Dv;
|
||||
if(normale.Modulus() < NORMIN) return;
|
||||
normale.Normalize();
|
||||
|
||||
// G1 Constraints
|
||||
gp_XYZ normaleS = D1S.Du^D1S.Dv;
|
||||
if(normaleS.Modulus() < NORMIN) return;
|
||||
normaleS.Normalize();
|
||||
|
||||
Standard_Real cos_normales = normale*normaleS;
|
||||
if( fabs(cos_normales)<COSMIN) return;
|
||||
Standard_Real invcos = 1./cos_normales;
|
||||
|
||||
gp_XYZ du = normaleS* -(normale*D1S.Du)*invcos;
|
||||
gp_XYZ dv = normaleS* -(normale*D1S.Dv)*invcos;
|
||||
|
||||
myPPC[0] = Plate_PinpointConstraint(pnt2d, du,1,0);
|
||||
myPPC[1] = Plate_PinpointConstraint(pnt2d, dv,0,1);
|
||||
nb_PPConstraints = 2;
|
||||
|
||||
// G2 Constraints
|
||||
gp_XYZ Su = D1S.Du+du;
|
||||
gp_XYZ Sv = D1S.Dv+dv;
|
||||
|
||||
math_Matrix mat(0,1,0,1);
|
||||
mat(0,0) = Su*D1T.Du;
|
||||
mat(0,1) = Su*D1T.Dv;
|
||||
mat(1,0) = Sv*D1T.Du;
|
||||
mat(1,1) = Sv*D1T.Dv;
|
||||
math_Gauss gauss(mat);
|
||||
|
||||
if(!gauss.IsDone()) return;
|
||||
|
||||
math_Vector vec(0,1);
|
||||
vec(0) = Su*Su;
|
||||
vec(1) = Su*Sv;
|
||||
math_Vector sol(0,1);
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real a = sol(0);
|
||||
Standard_Real b = sol(1);
|
||||
|
||||
vec(0) = Sv*Su;
|
||||
vec(1) = Sv*Sv;
|
||||
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real c = sol(0);
|
||||
Standard_Real d = sol(1);
|
||||
|
||||
gp_XYZ Suu = D2T.Duu*(a*a) + D2T.Duv*(2*a*b) + D2T.Dvv*(b*b);
|
||||
gp_XYZ Suv = D2T.Duu*(a*c) + D2T.Duv*(a*d+b*c) + D2T.Dvv*(b*d);
|
||||
gp_XYZ Svv = D2T.Duu*(c*c) + D2T.Duv*(2*c*d) + D2T.Dvv*(d*d);
|
||||
|
||||
gp_XYZ duu = normaleS * (normale*(Suu-D2S.Duu))*invcos;
|
||||
gp_XYZ duv = normaleS * (normale*(Suv-D2S.Duv))*invcos;
|
||||
gp_XYZ dvv = normaleS * (normale*(Svv-D2S.Dvv))*invcos;
|
||||
|
||||
myPPC[2] = Plate_PinpointConstraint(pnt2d, duu,2,0);
|
||||
myPPC[3] = Plate_PinpointConstraint(pnt2d, duv,1,1);
|
||||
myPPC[4] = Plate_PinpointConstraint(pnt2d, dvv,0,2);
|
||||
nb_PPConstraints = 5;
|
||||
|
||||
// G3 Constraints
|
||||
vec(0) = (D2S.Duu + duu - Suu)*Su;
|
||||
vec(1) = (D2S.Duu + duu - Suu)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uu = sol(0);
|
||||
Standard_Real B1uu = sol(1);
|
||||
|
||||
vec(0) = (D2S.Duv + duv - Suv)*Su;
|
||||
vec(1) = (D2S.Duv + duv - Suv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0uv = sol(0);
|
||||
Standard_Real B1uv = sol(1);
|
||||
|
||||
vec(0) = (D2S.Dvv + dvv - Svv)*Su;
|
||||
vec(1) = (D2S.Dvv + dvv - Svv)*Sv;
|
||||
gauss.Solve(vec,sol);
|
||||
Standard_Real B0vv = sol(0);
|
||||
Standard_Real B1vv = sol(1);
|
||||
|
||||
gp_XYZ Suuu = D3T.Duuu*(a*a*a) + D3T.Duuv*(3*a*a*b) + D3T.Duvv*(3*a*b*b) + D3T.Dvvv*(b*b*b);
|
||||
gp_XYZ Suuv = D3T.Duuu*(a*a*c) + D3T.Duuv*(a*a*d+2*a*b*c) + D3T.Duvv*(b*b*c+2*a*b*d) + D3T.Dvvv*(b*b*d);
|
||||
gp_XYZ Suvv = D3T.Duuu*(a*c*c) + D3T.Duuv*(b*c*c+2*a*c*d) + D3T.Duvv*(a*d*d+2*b*c*d) + D3T.Dvvv*(b*d*d);
|
||||
gp_XYZ Svvv = D3T.Duuu*(c*c*c) + D3T.Duuv*(3*c*c*d) + D3T.Duvv*(3*c*d*d) + D3T.Dvvv*(d*d*d);
|
||||
|
||||
Standard_Real &A0u = a;
|
||||
Standard_Real &A1u = b;
|
||||
Standard_Real &A0v = c;
|
||||
Standard_Real &A1v = d;
|
||||
Suuu += D2T.Duu*(3*A0u*B0uu) + D2T.Duv*(3*(A0u*B1uu+A1u*B0uu)) + D2T.Dvv*(3*A1u*B1uu);
|
||||
Suuv += D2T.Duu*(2*A0u*B0uv+A0v*B0uu) + D2T.Duv*(2*(A0u*B1uv+A1u*B0uv)+A0v*B1uu+A1v*B0uu) + D2T.Dvv*(2*A1u*B1uv+A1v*B1uu);
|
||||
Suvv += D2T.Duu*(A0u*B0vv+2*A0v*B0uv) + D2T.Duv*(2*(A0v*B1uv+A1v*B0uv)+A0u*B1vv+A1u*B0vv) + D2T.Dvv*(2*A1v*B1uv+A1u*B1vv);
|
||||
Svvv += D2T.Duu*(3*A0v*B0vv) + D2T.Duv*(3*(A0v*B1vv+A1v*B0vv)) + D2T.Dvv*(3*A1v*B1vv);
|
||||
|
||||
gp_XYZ duuu = normaleS * (normale*(Suuu-D3S.Duuu))*invcos;
|
||||
gp_XYZ duuv = normaleS * (normale*(Suuv-D3S.Duuv))*invcos;
|
||||
gp_XYZ duvv = normaleS * (normale*(Suvv-D3S.Duvv))*invcos;
|
||||
gp_XYZ dvvv = normaleS * (normale*(Svvv-D3S.Dvvv))*invcos;
|
||||
|
||||
myPPC[5] = Plate_PinpointConstraint(pnt2d, duuu,3,0);
|
||||
myPPC[6] = Plate_PinpointConstraint(pnt2d, duuv,2,1);
|
||||
myPPC[7] = Plate_PinpointConstraint(pnt2d, duvv,1,2);
|
||||
myPPC[8] = Plate_PinpointConstraint(pnt2d, dvvv,0,3);
|
||||
nb_PPConstraints = 9;
|
||||
}
|
19
src/Plate/Plate_GtoCConstraint.lxx
Executable file
19
src/Plate/Plate_GtoCConstraint.lxx
Executable file
@@ -0,0 +1,19 @@
|
||||
// File: Plate_GtoCConstraint.lxx
|
||||
// Created: Mon May 25 09:07:02 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const Standard_Integer& Plate_GtoCConstraint::nb_PPC() const
|
||||
{
|
||||
return nb_PPConstraints;
|
||||
}
|
||||
|
||||
|
||||
inline const Plate_PinpointConstraint& Plate_GtoCConstraint::GetPPC(const Standard_Integer Index) const
|
||||
{
|
||||
return myPPC[Index];
|
||||
}
|
||||
|
||||
inline const Plate_D1& Plate_GtoCConstraint::D1SurfInit() const
|
||||
{
|
||||
return myD1SurfInit;
|
||||
}
|
35
src/Plate/Plate_LineConstraint.cdl
Executable file
35
src/Plate/Plate_LineConstraint.cdl
Executable file
@@ -0,0 +1,35 @@
|
||||
-- File: Plate_LineConstraint.cdl
|
||||
-- Created: Thu May 7 11:33:37 1998
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
|
||||
|
||||
class LineConstraint from Plate
|
||||
---Purpose: constraint a point to belong to a straight line
|
||||
--
|
||||
--
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
Lin from gp,
|
||||
LinearScalarConstraint from Plate
|
||||
|
||||
is
|
||||
Create(point2d : XY ; lin : Lin from gp;
|
||||
iu : Integer = 0; iv : Integer = 0) returns LineConstraint;
|
||||
-- constraint the iu th derivative in u and iv th derivative in v at
|
||||
-- the point2d parametre to belong to the lin line.
|
||||
|
||||
-- Accessors :
|
||||
LSC(me) returns LinearScalarConstraint ;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
|
||||
fields
|
||||
myLSC : LinearScalarConstraint;
|
||||
|
||||
end;
|
||||
|
31
src/Plate/Plate_LineConstraint.cxx
Executable file
31
src/Plate/Plate_LineConstraint.cxx
Executable file
@@ -0,0 +1,31 @@
|
||||
// File: Plate_LineConstraint.cxx
|
||||
// Created: Mon May 18 16:42:59 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_LineConstraint.ixx>
|
||||
|
||||
Plate_LineConstraint::Plate_LineConstraint(const gp_XY& point2d,
|
||||
const gp_Lin& lin,
|
||||
const Standard_Integer iu,
|
||||
const Standard_Integer iv)
|
||||
:myLSC(2,1)
|
||||
{
|
||||
gp_XYZ point = lin.Location().XYZ();
|
||||
myLSC.SetPPC(1,Plate_PinpointConstraint(point2d,point,iu,iv));
|
||||
|
||||
gp_XYZ dir = lin.Direction().XYZ();
|
||||
// one builds two directions orthogonal to dir
|
||||
gp_XYZ dX(1,0,0);
|
||||
gp_XYZ dY(0,1,0);
|
||||
|
||||
gp_XYZ d1 = dX ^ dir;
|
||||
gp_XYZ d2 = dY ^ dir;
|
||||
if(d2.SquareModulus() > d1.SquareModulus()) d1 = d2;
|
||||
d1.Normalize();
|
||||
d2 = dir ^ d1;
|
||||
d2.Normalize();
|
||||
myLSC.SetCoeff(1,1,d1);
|
||||
myLSC.SetCoeff(2,1,d2);
|
||||
}
|
9
src/Plate/Plate_LineConstraint.lxx
Executable file
9
src/Plate/Plate_LineConstraint.lxx
Executable file
@@ -0,0 +1,9 @@
|
||||
// File: Plate_LineConstraint.lxx
|
||||
// Created: Mon May 25 09:12:26 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
inline const Plate_LinearScalarConstraint& Plate_LineConstraint::LSC() const
|
||||
{
|
||||
return myLSC;
|
||||
}
|
76
src/Plate/Plate_LinearScalarConstraint.cdl
Executable file
76
src/Plate/Plate_LinearScalarConstraint.cdl
Executable file
@@ -0,0 +1,76 @@
|
||||
-- File: Plate_LinearScalarConstraint.cdl
|
||||
-- Created: Mon Mar 23 17:40:14 1998
|
||||
-- Author: # Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
class LinearScalarConstraint from Plate
|
||||
---Purpose : define on or several constraints as linear combination of
|
||||
-- the X,Y and Z components of a set of PinPointConstraint
|
||||
--
|
||||
uses
|
||||
XY from gp,
|
||||
XYZ from gp,
|
||||
PinpointConstraint from Plate,
|
||||
HArray1OfPinpointConstraint from Plate,
|
||||
HArray2OfXYZ from TColgp,
|
||||
Array1OfPinpointConstraint from Plate,
|
||||
Array2OfXYZ from TColgp,
|
||||
Array1OfXYZ from TColgp
|
||||
|
||||
raises
|
||||
DimensionMismatch from Standard,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create
|
||||
returns LinearScalarConstraint;
|
||||
|
||||
Create (PPC1 : PinpointConstraint; coeff : XYZ )
|
||||
returns LinearScalarConstraint;
|
||||
|
||||
Create (PPC : Array1OfPinpointConstraint; coeff : Array1OfXYZ )
|
||||
returns LinearScalarConstraint
|
||||
raises DimensionMismatch from Standard;
|
||||
-- PPC and coeff have to be of the same length
|
||||
|
||||
Create (PPC : Array1OfPinpointConstraint; coeff : Array2OfXYZ )
|
||||
returns LinearScalarConstraint
|
||||
raises DimensionMismatch from Standard;
|
||||
-- the length of PPC have to be the Row lentgth of coeff
|
||||
|
||||
Create (ColLen,RowLen : Integer )
|
||||
-- initialize with 0 valued PPC and Coeffs
|
||||
returns LinearScalarConstraint;
|
||||
|
||||
-- Accessors :
|
||||
GetPPC(me) returns Array1OfPinpointConstraint;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Coeff(me) returns Array2OfXYZ;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
SetPPC (me : in out;
|
||||
Index: Integer from Standard;
|
||||
Value: PinpointConstraint)
|
||||
---Purpose: Sets the PinPointConstraint of index Index to
|
||||
-- Value raise if Index is greater than the length of
|
||||
-- PPC or the Row length of coeff or lower than 1
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
SetCoeff (me : in out;
|
||||
Row, Col: Integer from Standard;
|
||||
Value: XYZ)
|
||||
---Purpose: Sets the coeff of index (Row,Col) to Value
|
||||
-- raise if Row (respectively Col) is greater than the
|
||||
-- Row (respectively Column) length of coeff
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
fields
|
||||
|
||||
myPPC : HArray1OfPinpointConstraint;
|
||||
myCoef : HArray2OfXYZ;
|
||||
|
||||
end;
|
64
src/Plate/Plate_LinearScalarConstraint.cxx
Executable file
64
src/Plate/Plate_LinearScalarConstraint.cxx
Executable file
@@ -0,0 +1,64 @@
|
||||
// File: Plate_LinearScalarConstraint.cxx
|
||||
// Created: Thu Mar 26 14:39:21 1998
|
||||
// Author: # Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_LinearScalarConstraint.ixx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
|
||||
|
||||
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint() {}
|
||||
|
||||
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
|
||||
(const Plate_PinpointConstraint& PPC1,const gp_XYZ& coeff)
|
||||
|
||||
{
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,1);
|
||||
myCoef = new TColgp_HArray2OfXYZ(1,1,1,1);
|
||||
|
||||
myPPC->ChangeValue(1) = PPC1;
|
||||
myCoef->ChangeValue(1,1) = coeff;
|
||||
}
|
||||
|
||||
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Plate_Array1OfPinpointConstraint& PPC,const TColgp_Array1OfXYZ& coeff)
|
||||
{
|
||||
if(coeff.Length()!= PPC.Length()) Standard_DimensionMismatch::Raise();
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,PPC.Length());
|
||||
myCoef = new TColgp_HArray2OfXYZ(1,1,1,coeff.Length());
|
||||
|
||||
myPPC->ChangeArray1() = PPC;
|
||||
for(Standard_Integer i = 1; i<= coeff.Length(); i++) {
|
||||
myCoef->ChangeValue(1,i) = coeff(i+coeff.Lower()-1);
|
||||
}
|
||||
}
|
||||
|
||||
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
|
||||
(const Plate_Array1OfPinpointConstraint& PPC,const TColgp_Array2OfXYZ& coeff)
|
||||
{
|
||||
if(coeff.RowLength()!= PPC.Length()) Standard_DimensionMismatch::Raise();
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,PPC.Length());
|
||||
myCoef = new TColgp_HArray2OfXYZ(1,coeff.ColLength(),1,coeff.RowLength());
|
||||
|
||||
myPPC->ChangeArray1() = PPC;
|
||||
myCoef->ChangeArray2() = coeff;
|
||||
}
|
||||
|
||||
|
||||
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen)
|
||||
{
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen);
|
||||
myCoef = new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen);
|
||||
myCoef->Init(gp_XYZ(0.,0.,0.));
|
||||
}
|
||||
|
||||
void Plate_LinearScalarConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value)
|
||||
{
|
||||
myPPC->ChangeValue(Index) = Value;
|
||||
}
|
||||
|
||||
void Plate_LinearScalarConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const gp_XYZ& Value)
|
||||
{
|
||||
myCoef->ChangeValue(Row,Col) = Value;
|
||||
}
|
||||
|
19
src/Plate/Plate_LinearScalarConstraint.lxx
Executable file
19
src/Plate/Plate_LinearScalarConstraint.lxx
Executable file
@@ -0,0 +1,19 @@
|
||||
// File: Plate_LinearScalarConstraint.lxx
|
||||
// Created: Mon May 25 09:15:41 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
#include <TColgp_HArray2OfXYZ.hxx>
|
||||
#include <Plate_HArray1OfPinpointConstraint.hxx>
|
||||
|
||||
|
||||
inline const Plate_Array1OfPinpointConstraint& Plate_LinearScalarConstraint::GetPPC() const
|
||||
{
|
||||
return myPPC->Array1();
|
||||
}
|
||||
|
||||
|
||||
inline const TColgp_Array2OfXYZ& Plate_LinearScalarConstraint::Coeff() const
|
||||
{
|
||||
return myCoef->Array2();
|
||||
}
|
74
src/Plate/Plate_LinearXYZConstraint.cdl
Executable file
74
src/Plate/Plate_LinearXYZConstraint.cdl
Executable file
@@ -0,0 +1,74 @@
|
||||
-- File: Plate_LinearXYZConstraint.cdl
|
||||
-- Created: Tue Mar 24 09:41:40 1998
|
||||
-- Author: # Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
|
||||
class LinearXYZConstraint from Plate
|
||||
---Purpose : define on or several constraints as linear combination of
|
||||
-- PinPointConstraint unlike the LinearScalarConstraint, usage
|
||||
-- of this kind of constraint preserve the X,Y and Z uncoupling.
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
XYZ from gp,
|
||||
PinpointConstraint from Plate,
|
||||
Array1OfPinpointConstraint from Plate,
|
||||
HArray1OfPinpointConstraint from Plate,
|
||||
Array1OfReal from TColStd,
|
||||
Array2OfReal from TColStd,
|
||||
HArray2OfReal from TColStd
|
||||
|
||||
raises
|
||||
DimensionMismatch from Standard,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns LinearXYZConstraint;
|
||||
|
||||
Create (PPC : Array1OfPinpointConstraint; coeff : Array1OfReal )
|
||||
returns LinearXYZConstraint
|
||||
raises DimensionMismatch from Standard;
|
||||
-- the length of PPC have to be the Row lentgth of coeff
|
||||
--
|
||||
Create (PPC : Array1OfPinpointConstraint; coeff : Array2OfReal )
|
||||
returns LinearXYZConstraint
|
||||
raises DimensionMismatch from Standard;
|
||||
-- the length of PPC have to be the Row lentgth of coeff
|
||||
|
||||
Create (ColLen,RowLen : Integer )
|
||||
-- initialize with 0 valued PPC and Coeffs
|
||||
returns LinearXYZConstraint;
|
||||
|
||||
-- Accessors :
|
||||
GetPPC(me) returns Array1OfPinpointConstraint;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Coeff(me) returns Array2OfReal;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
SetPPC (me : in out;
|
||||
Index: Integer from Standard;
|
||||
Value: PinpointConstraint)
|
||||
---Purpose: Sets the PinPointConstraint of index Index to
|
||||
-- Value raise if Index is greater than the length of
|
||||
-- PPC or the Row length of coeff or lower than 1
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
SetCoeff (me : in out;
|
||||
Row, Col: Integer from Standard;
|
||||
Value: Real)
|
||||
---Purpose: Sets the coeff of index (Row,Col) to Value
|
||||
-- raise if Row (respectively Col) is greater than the
|
||||
-- Row (respectively Column) length of coeff
|
||||
raises OutOfRange from Standard;
|
||||
|
||||
fields
|
||||
|
||||
myPPC : HArray1OfPinpointConstraint;
|
||||
myCoef : HArray2OfReal;
|
||||
|
||||
end;
|
50
src/Plate/Plate_LinearXYZConstraint.cxx
Executable file
50
src/Plate/Plate_LinearXYZConstraint.cxx
Executable file
@@ -0,0 +1,50 @@
|
||||
// File: Plate_LinearXYZConstraint.cxx
|
||||
// Created: Thu Mar 26 15:21:12 1998
|
||||
// Author: # Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_LinearXYZConstraint.ixx>
|
||||
|
||||
|
||||
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint() {}
|
||||
|
||||
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& PPC,const TColStd_Array1OfReal& coeff)
|
||||
{
|
||||
if(coeff.Length()!= PPC.Length()) Standard_DimensionMismatch::Raise();
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,PPC.Length());
|
||||
myCoef = new TColStd_HArray2OfReal(1,1,1,coeff.Length());
|
||||
|
||||
myPPC->ChangeArray1() = PPC;
|
||||
for(Standard_Integer i = 1; i<= coeff.Length(); i++)
|
||||
myCoef->ChangeValue(1,i) = coeff(i+coeff.Lower()-1);
|
||||
}
|
||||
|
||||
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& PPC,const TColStd_Array2OfReal& coeff)
|
||||
{
|
||||
if(coeff.RowLength()!= PPC.Length()) Standard_DimensionMismatch::Raise();
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,PPC.Length());
|
||||
myCoef = new TColStd_HArray2OfReal(1,coeff.ColLength(),1,coeff.RowLength());
|
||||
|
||||
myPPC->ChangeArray1() = PPC;
|
||||
myCoef->ChangeArray2() = coeff;
|
||||
}
|
||||
|
||||
|
||||
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen)
|
||||
{
|
||||
myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen);
|
||||
myCoef = new TColStd_HArray2OfReal(1,ColLen,1,RowLen);
|
||||
myCoef->Init(0.0);
|
||||
}
|
||||
|
||||
void Plate_LinearXYZConstraint::SetPPC(const Standard_Integer Index,const Plate_PinpointConstraint& Value)
|
||||
{
|
||||
myPPC->ChangeValue(Index) = Value;
|
||||
}
|
||||
|
||||
void Plate_LinearXYZConstraint::SetCoeff(const Standard_Integer Row,const Standard_Integer Col,const Standard_Real Value)
|
||||
{
|
||||
myCoef->ChangeValue(Row,Col) = Value;
|
||||
}
|
||||
|
20
src/Plate/Plate_LinearXYZConstraint.lxx
Executable file
20
src/Plate/Plate_LinearXYZConstraint.lxx
Executable file
@@ -0,0 +1,20 @@
|
||||
// File: Plate_LinearXYZConstraint.lxx
|
||||
// Created: Mon May 25 09:14:00 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
#include <Plate_HArray1OfPinpointConstraint.hxx>
|
||||
|
||||
|
||||
inline const Plate_Array1OfPinpointConstraint& Plate_LinearXYZConstraint::GetPPC() const
|
||||
{
|
||||
return myPPC->Array1();
|
||||
}
|
||||
|
||||
|
||||
inline const TColStd_Array2OfReal& Plate_LinearXYZConstraint::Coeff() const
|
||||
{
|
||||
return myCoef->Array2();
|
||||
}
|
43
src/Plate/Plate_PinpointConstraint.cdl
Executable file
43
src/Plate/Plate_PinpointConstraint.cdl
Executable file
@@ -0,0 +1,43 @@
|
||||
-- File: Plate_PinpointConstraint.cdl
|
||||
-- Created: Thu Oct 19 17:24:04 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
class PinpointConstraint from Plate
|
||||
---Purpose : define a constraint on the Plate
|
||||
--
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
XYZ from gp
|
||||
|
||||
is
|
||||
Create returns PinpointConstraint;
|
||||
Create(point2d : XY ; ImposedValue : XYZ ;
|
||||
iu : Integer = 0; iv : Integer = 0) returns PinpointConstraint;
|
||||
|
||||
-- Accessors :
|
||||
Pnt2d(me) returns XY from gp;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Idu(me) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Idv(me) returns Integer;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Value(me) returns XYZ from gp;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
value : XYZ ;
|
||||
pnt2d : XY ;
|
||||
idu,idv : Integer;
|
||||
|
||||
end;
|
25
src/Plate/Plate_PinpointConstraint.cxx
Executable file
25
src/Plate/Plate_PinpointConstraint.cxx
Executable file
@@ -0,0 +1,25 @@
|
||||
// File: Plate_PinpointConstraint.cxx
|
||||
// Created: Fri Oct 20 19:39:17 1995
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
|
||||
#include <Plate_PinpointConstraint.ixx>
|
||||
|
||||
Plate_PinpointConstraint::Plate_PinpointConstraint()
|
||||
{
|
||||
pnt2d = gp_XY(0,0);
|
||||
value = gp_XYZ(0,0,0);
|
||||
idu = 0;
|
||||
idv = 0;
|
||||
}
|
||||
|
||||
|
||||
Plate_PinpointConstraint::Plate_PinpointConstraint(const gp_XY& point2d, const gp_XYZ& ImposedValue,
|
||||
const Standard_Integer iu, const Standard_Integer iv)
|
||||
{
|
||||
pnt2d = point2d;
|
||||
value = ImposedValue;
|
||||
idu = iu;
|
||||
idv = iv;
|
||||
}
|
26
src/Plate/Plate_PinpointConstraint.lxx
Executable file
26
src/Plate/Plate_PinpointConstraint.lxx
Executable file
@@ -0,0 +1,26 @@
|
||||
// File: Plate_PinpointConstraint.lxx
|
||||
// Created: Mon May 25 09:04:50 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const gp_XY& Plate_PinpointConstraint::Pnt2d() const
|
||||
{
|
||||
return pnt2d;
|
||||
}
|
||||
|
||||
|
||||
inline const Standard_Integer& Plate_PinpointConstraint::Idu() const
|
||||
{
|
||||
return idu;
|
||||
}
|
||||
|
||||
|
||||
inline const Standard_Integer& Plate_PinpointConstraint::Idv() const
|
||||
{
|
||||
return idv;
|
||||
}
|
||||
|
||||
|
||||
inline const gp_XYZ& Plate_PinpointConstraint::Value() const
|
||||
{
|
||||
return value;
|
||||
}
|
32
src/Plate/Plate_PlaneConstraint.cdl
Executable file
32
src/Plate/Plate_PlaneConstraint.cdl
Executable file
@@ -0,0 +1,32 @@
|
||||
-- File: Plate_PlaneConstraint.cdl
|
||||
-- Created: Wed May 6 19:12:10 1998
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
|
||||
|
||||
class PlaneConstraint from Plate
|
||||
---Purpose: constraint a point to belong to a Plane
|
||||
--
|
||||
|
||||
uses
|
||||
XY from gp,
|
||||
Pln from gp,
|
||||
LinearScalarConstraint from Plate
|
||||
|
||||
is
|
||||
Create(point2d : XY ; pln : Pln from gp;
|
||||
iu : Integer = 0; iv : Integer = 0) returns PlaneConstraint;
|
||||
-- constraint the iu th derivative in u and iv th derivative in v at
|
||||
-- the point2d parametre to belong to the pln plane.
|
||||
|
||||
-- Accessors :
|
||||
LSC(me) returns LinearScalarConstraint ;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
myLSC : LinearScalarConstraint;
|
||||
end;
|
||||
|
22
src/Plate/Plate_PlaneConstraint.cxx
Executable file
22
src/Plate/Plate_PlaneConstraint.cxx
Executable file
@@ -0,0 +1,22 @@
|
||||
// File: Plate_PlaneConstraint.cxx
|
||||
// Created: Thu May 7 15:12:31 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_PlaneConstraint.ixx>
|
||||
#include <Plate_PinpointConstraint.hxx>
|
||||
|
||||
|
||||
Plate_PlaneConstraint::Plate_PlaneConstraint(const gp_XY& point2d,
|
||||
const gp_Pln& pln,
|
||||
const Standard_Integer iu,
|
||||
const Standard_Integer iv)
|
||||
:myLSC(1,1)
|
||||
{
|
||||
gp_XYZ point = pln.Location().XYZ();
|
||||
myLSC.SetPPC(1,Plate_PinpointConstraint(point2d,point,iu,iv));
|
||||
gp_XYZ dir = pln.Axis().Direction().XYZ();
|
||||
dir.Normalize();
|
||||
myLSC.SetCoeff(1,1,dir);
|
||||
}
|
9
src/Plate/Plate_PlaneConstraint.lxx
Executable file
9
src/Plate/Plate_PlaneConstraint.lxx
Executable file
@@ -0,0 +1,9 @@
|
||||
// File: Plate_PlaneConstraint.lxx
|
||||
// Created: Mon May 25 09:11:17 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
inline const Plate_LinearScalarConstraint& Plate_PlaneConstraint::LSC() const
|
||||
{
|
||||
return myLSC;
|
||||
}
|
143
src/Plate/Plate_Plate.cdl
Executable file
143
src/Plate/Plate_Plate.cdl
Executable file
@@ -0,0 +1,143 @@
|
||||
-- File: Plate_Plate.cdl
|
||||
-- Created: Wed Oct 18 12:44:50 1995
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <ds@sgi63>
|
||||
---Copyright: Matra Datavision 1995
|
||||
-- 26-Mar-96 : xab non inlinage des methodes
|
||||
-- 19-Fev-97 : jct ajout des methodes UVBox et UVConstraints pour l'etude G1134
|
||||
-- 24-Mar-98 : alr prise en compte nouveaux types de contraintes (Linear..Constraint)
|
||||
--
|
||||
class Plate from Plate
|
||||
---Purpose: This class implement a variationnal spline algorithm able
|
||||
-- to define a two variable function satisfying some constraints
|
||||
-- and minimizing an energy like criterion.
|
||||
|
||||
uses
|
||||
SequenceOfPinpointConstraint from Plate,
|
||||
SequenceOfLinearXYZConstraint from Plate,
|
||||
SequenceOfLinearScalarConstraint from Plate,
|
||||
PinpointConstraint from Plate,
|
||||
LinearXYZConstraint from Plate,
|
||||
LinearScalarConstraint from Plate,
|
||||
GtoCConstraint from Plate,
|
||||
FreeGtoCConstraint from Plate,
|
||||
GlobalTranslationConstraint from Plate,
|
||||
LineConstraint from Plate,
|
||||
PlaneConstraint from Plate,
|
||||
SampledCurveConstraint from Plate,
|
||||
XY from gp,
|
||||
XYZ from gp,
|
||||
SequenceOfXY from TColgp,
|
||||
Matrix from math,
|
||||
HArray2OfXYZ from TColgp
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create returns Plate;
|
||||
Create (Ref : Plate from Plate) returns Plate;
|
||||
|
||||
Copy(me: in out; Ref: Plate)
|
||||
---C++: alias operator=
|
||||
---C++: return &
|
||||
returns Plate;
|
||||
-- basics Constraints
|
||||
--
|
||||
--
|
||||
Load (me : in out; PConst : PinpointConstraint);
|
||||
Load (me : in out; LXYZConst : LinearXYZConstraint);
|
||||
Load (me : in out; LScalarConst : LinearScalarConstraint);
|
||||
-- Geometric Constraints
|
||||
--
|
||||
Load (me : in out; GTConst : GlobalTranslationConstraint);
|
||||
Load (me : in out; LConst : LineConstraint);
|
||||
Load (me : in out; PConst : PlaneConstraint);
|
||||
Load (me : in out; SCConst : SampledCurveConstraint);
|
||||
-- Specific Geometric Constraints
|
||||
--
|
||||
Load (me : in out; GtoCConst : GtoCConstraint);
|
||||
Load (me : in out; FGtoCConst : FreeGtoCConstraint);
|
||||
|
||||
SolveTI(me : in out; ord : Integer = 4; anisotropie : Real = 1.0);
|
||||
|
||||
IsDone(me)
|
||||
---Purpose: returns True if all has been correctly done.
|
||||
returns Boolean;
|
||||
|
||||
destroy(me : in out);
|
||||
---C++: alias ~
|
||||
|
||||
|
||||
Init(me: in out );
|
||||
---Purpose: reset the Plate in the initial state
|
||||
-- ( same as after Create())
|
||||
|
||||
Evaluate(me ; point2d : XY from gp )
|
||||
returns XYZ from gp ;
|
||||
|
||||
EvaluateDerivative(me; point2d: XY from gp;
|
||||
iu,iv : Integer)
|
||||
returns XYZ from gp ;
|
||||
|
||||
CoefPol(me; Coefs: out HArray2OfXYZ from TColgp);
|
||||
|
||||
SetPolynomialPartOnly(me : in out; PPOnly : Boolean = Standard_True);
|
||||
|
||||
Continuity(me) returns Integer;
|
||||
|
||||
-- private methods :
|
||||
--
|
||||
SolEm (me ; point2d : XY from gp; iu,iv : Integer)
|
||||
returns Real is private;
|
||||
|
||||
Polm (me; point2d : XY from gp; iu,iv,idu,idv : Integer)
|
||||
---C++: inline
|
||||
|
||||
returns Real is private;
|
||||
|
||||
Deru(me; index : Integer)
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
returns Integer is private;
|
||||
|
||||
Derv(me; index : Integer)
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
returns Integer is private;
|
||||
|
||||
Solution(me; index : Integer)
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
returns XYZ is private;
|
||||
|
||||
Points(me; index : Integer)
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
returns XY is private;
|
||||
|
||||
UVBox(me ; UMin,UMax,VMin,VMax : out Real );
|
||||
UVConstraints(me; Seq : out SequenceOfXY from TColgp );
|
||||
SolveTI1(me : in out; IterationNumber : Integer) is private;
|
||||
SolveTI2(me : in out; IterationNumber : Integer) is private;
|
||||
SolveTI3(me : in out; IterationNumber : Integer) is private;
|
||||
fillXYZmatrix(me; mat : in out Matrix from math;i0,j0,ncc1,ncc2 : Integer) is private;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
order : Integer;
|
||||
n_el, n_dim : Integer;
|
||||
solution, points, deru, derv : Address ;
|
||||
OK : Boolean;
|
||||
myConstraints : SequenceOfPinpointConstraint;
|
||||
myLXYZConstraints : SequenceOfLinearXYZConstraint;
|
||||
myLScalarConstraints : SequenceOfLinearScalarConstraint;
|
||||
ddu : Real[10];
|
||||
ddv : Real[10];
|
||||
maxConstraintOrder : Integer;
|
||||
PolynomialPartOnly : Boolean;
|
||||
end;
|
1599
src/Plate/Plate_Plate.cxx
Executable file
1599
src/Plate/Plate_Plate.cxx
Executable file
File diff suppressed because it is too large
Load Diff
59
src/Plate/Plate_Plate.lxx
Executable file
59
src/Plate/Plate_Plate.lxx
Executable file
@@ -0,0 +1,59 @@
|
||||
// File: Plate_Plate.lxx
|
||||
// Created: Thu Oct 21 9:00:00 1995
|
||||
// Author: Andre LIEUTIER
|
||||
// <ds@sgi63>
|
||||
|
||||
#include <gp_XY.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
|
||||
inline Standard_Real Plate_Plate::Polm(const gp_XY& point2d, const Standard_Integer iu, const Standard_Integer iv,
|
||||
const Standard_Integer idu, const Standard_Integer idv) const
|
||||
{
|
||||
if(idu>iu) return 0;
|
||||
if(idv>iv) return 0;
|
||||
Standard_Real u = point2d.X();
|
||||
Standard_Real v = point2d.Y();
|
||||
|
||||
Standard_Real value = 1;
|
||||
|
||||
Standard_Integer degu = iu - idu;
|
||||
Standard_Integer i ;
|
||||
for( i=0;i<degu;i++) value *= u;
|
||||
for(i=iu;i>degu;i--) value *= i;
|
||||
|
||||
|
||||
Standard_Integer degv = iv - idv;
|
||||
for(i=0;i<degv;i++) value *= v;
|
||||
for(i=iv;i>degv;i--) value *= i;
|
||||
|
||||
|
||||
// le produit par ddu[iu]*ddv[iv] n'est pas indispensable !! (il change
|
||||
// les valeurs claculles pour la partie coef polynomiaux de Sol
|
||||
// de telle facon que les methodes Evaluate et EvaluateDerivative donnent
|
||||
//en theorie les memes valeurs. Toutefois, il nous semble que ce produit
|
||||
// ameliore le conditionnmenet de la matrice
|
||||
return value*ddu[iu]*ddv[iv];
|
||||
//return value;
|
||||
}
|
||||
|
||||
inline Standard_Integer& Plate_Plate::Deru(const Standard_Integer index) const
|
||||
{
|
||||
return ((Standard_Integer *)deru)[index];
|
||||
}
|
||||
|
||||
inline Standard_Integer& Plate_Plate::Derv(const Standard_Integer index) const
|
||||
{
|
||||
return ((Standard_Integer *)derv)[index];
|
||||
}
|
||||
|
||||
inline gp_XYZ& Plate_Plate::Solution(const Standard_Integer index) const
|
||||
{
|
||||
return ((gp_XYZ *)solution)[index];
|
||||
}
|
||||
|
||||
inline gp_XY& Plate_Plate::Points(const Standard_Integer index) const
|
||||
{
|
||||
return ((gp_XY *)points)[index];
|
||||
}
|
||||
|
||||
|
38
src/Plate/Plate_SampledCurveConstraint.cdl
Executable file
38
src/Plate/Plate_SampledCurveConstraint.cdl
Executable file
@@ -0,0 +1,38 @@
|
||||
-- File: Plate_SampledCurveConstraint.cdl
|
||||
-- Created: Wed May 6 18:16:08 1998
|
||||
-- Author: Andre LIEUTIER
|
||||
-- <alr@sgi63>
|
||||
---Copyright: Matra Datavision 1998
|
||||
|
||||
|
||||
class SampledCurveConstraint from Plate
|
||||
---Purpose: define m PinPointConstraint driven by m unknown
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
uses
|
||||
SequenceOfPinpointConstraint from Plate,
|
||||
LinearXYZConstraint from Plate
|
||||
raises
|
||||
DimensionMismatch from Standard
|
||||
|
||||
is
|
||||
Create(SOPPC : SequenceOfPinpointConstraint;
|
||||
n : Integer)
|
||||
returns SampledCurveConstraint
|
||||
raises DimensionMismatch from Standard;
|
||||
-- n have to be less than the length of SOPPC
|
||||
--
|
||||
|
||||
-- Accessors :
|
||||
LXYZC(me) returns LinearXYZConstraint;
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
myLXYZC : LinearXYZConstraint;
|
||||
|
||||
end;
|
||||
|
||||
|
36
src/Plate/Plate_SampledCurveConstraint.cxx
Executable file
36
src/Plate/Plate_SampledCurveConstraint.cxx
Executable file
@@ -0,0 +1,36 @@
|
||||
// File: Plate_SampledCurveConstraint.cxx
|
||||
// Created: Mon May 18 16:55:59 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
|
||||
|
||||
#include <Plate_SampledCurveConstraint.ixx>
|
||||
#include <Plate_PinpointConstraint.hxx>
|
||||
#include <Plate_SequenceOfPinpointConstraint.hxx>
|
||||
|
||||
static inline Standard_Real B0( Standard_Real t)
|
||||
{
|
||||
Standard_Real s = t;
|
||||
if(s<0.) s = -s;
|
||||
s = 1. - s;
|
||||
if(s<0.) s = 0;
|
||||
return s;
|
||||
}
|
||||
|
||||
Plate_SampledCurveConstraint::Plate_SampledCurveConstraint(const Plate_SequenceOfPinpointConstraint &SOPPC,
|
||||
const Standard_Integer n)
|
||||
:myLXYZC(n,SOPPC.Length())
|
||||
{
|
||||
Standard_Integer m = SOPPC.Length();
|
||||
|
||||
if (n > m) Standard_DimensionMismatch::Raise();
|
||||
for(Standard_Integer index =1; index <= m;index++)
|
||||
myLXYZC.SetPPC(index,SOPPC(index));
|
||||
|
||||
Standard_Real ratio = Standard_Real(n+1) /Standard_Real(m+1);
|
||||
for (Standard_Integer i=1;i<=n;i++)
|
||||
for (Standard_Integer j=1;j<=m;j++)
|
||||
{
|
||||
myLXYZC.SetCoeff(i,j,B0(ratio*j - i));
|
||||
}
|
||||
}
|
8
src/Plate/Plate_SampledCurveConstraint.lxx
Executable file
8
src/Plate/Plate_SampledCurveConstraint.lxx
Executable file
@@ -0,0 +1,8 @@
|
||||
// File: Plate_SampledCurveConstraint.lxx
|
||||
// Created: Mon May 25 09:18:23 1998
|
||||
// Author: Andre LIEUTIER
|
||||
// <alr@sgi63>
|
||||
inline const Plate_LinearXYZConstraint& Plate_SampledCurveConstraint::LXYZC() const
|
||||
{
|
||||
return myLXYZC;
|
||||
}
|
Reference in New Issue
Block a user