1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

191
src/BRepBlend/BRepBlend.cdl Executable file
View File

@@ -0,0 +1,191 @@
-- File: BRepBlend.cdl
-- Created: Mon Dec 6 09:41:39 1993
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
-- jlr le 28-07-97 F(t) in Edge/Face
---Copyright: Matra Datavision 1993
package BRepBlend
uses Blend, BlendFunc, AppBlend, Approx, Adaptor3d,Adaptor2d,
Law, gp, TopAbs, IntSurf, Convert,
TCollection,TColStd,TColgp,GeomAbs,Geom,Geom2d,
AdvApprox, StdFail, math
is
generic class HCurveToolGen;
generic class HCurve2dToolGen;
class HCurveTool instantiates HCurveToolGen from BRepBlend (
HCurve from Adaptor3d);
class HCurve2dTool instantiates HCurve2dToolGen from BRepBlend (
HCurve2d from Adaptor2d);
class BlendTool;
alias ConstRad is ConstRad from BlendFunc;
alias ConstRadInv is ConstRadInv from BlendFunc;
alias Ruled is Ruled from BlendFunc;
alias RuledInv is RuledInv from BlendFunc;
alias EvolRad is EvolRad from BlendFunc;
alias EvolRadInv is EvolRadInv from BlendFunc;
alias CSConstRad is CSConstRad from BlendFunc;
alias CSCircular is CSCircular from BlendFunc;
alias Chamfer is Chamfer from BlendFunc;
alias ChamfInv is ChamfInv from BlendFunc;
alias ChAsym is ChAsym from BlendFunc;
alias ChAsymInv is ChAsymInv from BlendFunc;
class PointOnRst instantiates PointOnRst from Blend
(HCurve2d from Adaptor2d);
class SequenceOfPointOnRst instantiates Sequence from TCollection
(PointOnRst from BRepBlend);
class Extremity instantiates Extremity from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend);
class Line instantiates Line from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend,
Extremity from BRepBlend);
class Walking instantiates Walking from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
Integer from Standard,
HCurve2dTool from BRepBlend,
HSurfaceTool from Adaptor3d,
HCurveTool from BRepBlend,
TopolTool from Adaptor3d,
BlendTool from BRepBlend,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend,
Extremity from BRepBlend,
Line from BRepBlend);
class CSWalking instantiates CSWalking from Blend
(HVertex from Adaptor3d,
HCurve2d from Adaptor2d,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
Integer from Standard,
HCurve2dTool from BRepBlend,
HSurfaceTool from Adaptor3d,
HCurveTool from BRepBlend,
TopolTool from Adaptor3d,
BlendTool from BRepBlend,
PointOnRst from BRepBlend,
SequenceOfPointOnRst from BRepBlend,
Extremity from BRepBlend,
Line from BRepBlend);
class AppSurf instantiates AppSurf from AppBlend
(AppFunction from Blend,
Line from BRepBlend);
class SequenceOfLine instantiates Sequence from TCollection
(Line from BRepBlend);
class AppSurface;
---Purpose: Used to Approximate the surfaces.
deferred class AppFuncRoot;
---Purpose: Root Class Function to approximate by AppSurface
class AppFunc;
---Purpose: Function to approximate by AppSurface for
-- Surface/Surface contact.
class AppFuncRst;
---Purpose: Function to approximate by AppSurface for
-- Curve/Surface contact.
class AppFuncRstRst;
---Purpose: Function to approximate by AppSurface for
-- Curve/Curve contact.
class SurfRstEvolRad;
---Purpose: Function to approximate by AppSurface for
-- Edge/Face and evolutif radius
class SurfRstConstRad;
---Purpose: Copie de CSConstRad mais avec une pcurve sur surface
-- comme support.
class RstRstEvolRad;
---Purpose: Function to approximate by AppSurface for
-- Edge/Edge and evolutif radius
--
class RstRstConstRad;
---Purpose: Copie de CSConstRad mais avec une pcurve sur surface
-- comme support.
class SurfPointConstRadInv;
---Purpose: Fonction de recadrage entre un point et une surface.
class SurfCurvConstRadInv;
---Purpose: Fonction de recadrage entre une restriction surface de
-- la surface et une courbe.
class SurfPointEvolRadInv;
---Purpose: Fonction de recadrage entre un point et une surface.
class CurvPointRadInv;
---Purpose: Fonction de recadrage entre un point et une courbe.
-- valable dans les cas rsyon constant et rayon evolutif
class SurfCurvEvolRadInv;
---Purpose: Fonction de recadrage entre une restriction surface de
-- la surface et une courbe.
class SurfRstLineBuilder;
---Purpose: Construction d'une BRepBlend_Line entre une surface et
-- une pcurve sur surface a partir d'une solution de
-- depart approchee. Les entrees sorties de ce builder
-- sont de meme nature que celle d'un walking
-- traditionnel, mais les exigences sur la Line ne sont
-- pas les memes. Si l'on garanti toujours la
-- determination du range de validite, on ne respecte
-- plus les criteres de bonne repartition des sections en
-- vue d'un lissage. En resume la Line resultat est f(t)
-- oriented.
class RstRstLineBuilder;
---Purpose: Construction d'une BRepBlend_Line entre deux pcurves a
-- partir d'une solution de depart approchee. Les
-- entrees sorties de ce builder sont de meme nature que
-- celle d'un walking traditionnel, mais les exigences
-- sur la Line ne sont pas les memes. Si l'on garanti
-- toujours la determination du range de validite, on ne
-- respecte plus les criteres de bonne repartition des
-- sections en vue d'un lissage. En resume la Line
-- resultat est f(t) oriented.
end BRepBlend;

View File

@@ -0,0 +1,40 @@
-- File: BRepBlend_AppFunc.cdl
-- Created: Mon Nov 25 11:55:09 1996
-- Author: Philippe MANGIN
-- <pmn@sgi29>
---Copyright: Matra Datavision 1996
class AppFunc from BRepBlend inherits AppFuncRoot from BRepBlend
---Purpose: Function to approximate by AppSurface
---Level: Advanced
uses
Line from BRepBlend,
Point from Blend,
AppFunction from Blend,
Function from Blend,
Vector from math
raises OutOfRange
is
Create(Line : in out Line from BRepBlend;
Func : in out Function from Blend;
Tol3d: Real;
Tol2d: Real)
---Warning: The Object Func cannot be killed before me.
returns AppFunc;
Point(me;
Func : AppFunction from Blend;
Param : Real;
Sol : Vector from math;
Pnt : in out Point from Blend);
Vec(me;
Sol : in out Vector from math;
Pnt : Point from Blend);
end AppFunc;

View File

@@ -0,0 +1,32 @@
// File: BRepBlend_AppFunc.cxx
// Created: Tue Nov 26 09:53:06 1996
// Author: Philippe MANGIN
// <pmn@sgi29>
#include <BRepBlend_AppFunc.ixx>
BRepBlend_AppFunc::BRepBlend_AppFunc(Handle(BRepBlend_Line)& Line,
Blend_Function& Func,
const Standard_Real Tol3d,
const Standard_Real Tol2d)
:BRepBlend_AppFuncRoot(Line,Func,Tol3d,Tol2d)
{
}
void BRepBlend_AppFunc::Point(const Blend_AppFunction& Func,
const Standard_Real Param,
const math_Vector& Sol,
Blend_Point& Pnt)const
{
Pnt.SetValue(Func.Pnt1(), Func.Pnt2(),
Param,
Sol(1), Sol(2), Sol(3), Sol(4));
}
void BRepBlend_AppFunc::Vec(math_Vector& Sol,
const Blend_Point& Pnt)const
{
Pnt.ParametersOnS1(Sol(1),Sol(2));
Pnt.ParametersOnS2(Sol(3),Sol(4));
}

View File

@@ -0,0 +1,251 @@
-- File: BRepBlend_AppFuncRoot.cdl
-- Created: Tue May 12 14:50:30 1998
-- Author: Philippe NOUAILLE
-- <pne@cleox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1998
deferred class AppFuncRoot from BRepBlend inherits SweepFunction from Approx
---Purpose: Function to approximate by AppSurface
---Level: Advanced
uses
Line from BRepBlend,
Point from Blend,
AppFunction from Blend,
Shape from GeomAbs,
Vector from math,
Pnt from gp,
Array1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec from TColgp,
Array1OfVec2d from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
HArray1OfPnt from TColgp,
HArray1OfPnt2d from TColgp,
HArray1OfVec from TColgp,
HArray1OfVec2d from TColgp,
HArray1OfReal from TColStd
raises OutOfRange
is
Initialize(Line : in out Line from BRepBlend;
Func : in out AppFunction from Blend;
Tol3d : Real from Standard;
Tol2d : Real from Standard)
---Warning: The Object Func cannot be killed before me.
returns AppFuncRoot;
--
-- To compute Sections and derivatives Sections
--
--
D0(me : mutable;
Param: Real;
First, Last : Real;
Poles : out Array1OfPnt from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
Weigths : out Array1OfReal from TColStd)
---Purpose: compute the section for v = param
returns Boolean is redefined;
D1(me : mutable;
Param: Real;
First, Last : Real;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd)
---Purpose: compute the first derivative in v direction of the
-- section for v = param
returns Boolean
is redefined;
D2(me : mutable;
Param: Real;
First, Last : Real;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
D2Poles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
D2Poles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd;
D2Weigths : out Array1OfReal from TColStd)
---Purpose: compute the second derivative in v direction of the
-- section for v = param
returns Boolean
is redefined;
--
-- General Information On The Function
--
Nb2dCurves(me)
---Purpose: get the number of 2d curves to approximate.
returns Integer
is redefined;
SectionShape(me; NbPoles : out Integer from Standard;
NbKnots : out Integer from Standard;
Degree : out Integer from Standard)
---Purpose: get the format of an section
is redefined;
Knots(me; TKnots: out Array1OfReal from TColStd)
---Purpose: get the Knots of the section
is redefined;
Mults(me; TMults: out Array1OfInteger from TColStd)
---Purpose: get the Multplicities of the section
is redefined;
IsRational(me)
---Purpose: Returns if the section is rationnal or not
returns Boolean
is redefined;
--
-- Mangement of continuity
--
NbIntervals(me; S : Shape from GeomAbs)
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
returns Integer
is redefined;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
is redefined;
SetInterval(me: mutable; First, Last: Real from Standard)
---Purpose: Sets the bounds of the parametric interval on
-- the fonction
-- This determines the derivatives in these values if the
-- function is not Cn.
is redefined;
--
-- To help computation of Tolerance
--
-- Evaluation of error, in 2d space, or on rational function, is
-- dificult. The folowing methodes can help
--
--
Resolution(me;
Index : Integer from Standard;
Tol : Real from Standard;
TolU, TolV : out Real from Standard)
---Purpose: Returns the resolutions in the sub-space 2d <Index> --
-- This information is usfull to find an good tolerance in
-- 2d approximation
---Warning: Used only if Nb2dCurve > 0
is redefined;
GetTolerance(me;
BoundTol, SurfTol, AngleTol : Real;
Tol3d : out Array1OfReal)
---Purpose: Returns the tolerance to reach in approximation
-- to respecte
-- BoundTol error at the Boundary
-- AngleTol tangent error at the Boundary (in radian)
-- SurfTol error inside the surface.
is redefined;
SetTolerance(me : mutable; Tol3d, Tol2d : Real)
---Purpose: Is usfull, if (me) have to be run numerical
-- algorithme to perform D0, D1 or D2
is redefined;
BarycentreOfSurf(me)
---Purpose: Get the barycentre of Surface. An very poor
-- estimation is sufficent. This information is usefull
-- to perform well conditionned rational approximation.
---Warning: Used only if <me> IsRational
returns Pnt from gp
is redefined;
MaximalSection(me) returns Real
---Purpose: Returns the length of the maximum section. This
-- information is usefull to perform well conditionned rational
-- approximation.
---Warning: Used only if <me> IsRational
is redefined;
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
---Purpose: Compute the minimal value of weight for each poles
-- of all sections. This information is usefull to
-- perform well conditionned rational approximation.
---Warning: Used only if <me> IsRational
is redefined;
-- Private methods
SearchPoint(me:mutable;
Func : in out AppFunction from Blend;
Param : Real;
Pnt : in out Point from Blend)
returns Boolean
is private;
SearchLocation(me;
Param : Real;
FirstIndex, LastIndex : Integer;
ParamIndex : in out Integer)
returns Boolean
raises OutOfRange
is private;
Point(me;
Func : AppFunction from Blend;
Param : Real;
Sol : Vector from math;
Pnt : in out Point from Blend)
is deferred;
Vec(me;
Sol : in out Vector from math;
Pnt : Point from Blend)
is deferred;
fields
myLine : Line from BRepBlend;
myFunc : Address;
mydimension : Integer;
myTolerance : Vector;
myPnt : Point from Blend;
myBary : Pnt from gp;
X1, X2, XInit, Sol : Vector from math;
end AppFuncRoot;

View File

@@ -0,0 +1,385 @@
// File: BRepBlend_AppFuncRoot.cxx
// Created: Tue May 12 16:57:47 1998
// Author: Philippe NOUAILLE
// <pne@cleox.paris1.matra-dtv.fr>
#include <BRepBlend_AppFuncRoot.ixx>
#include <Blend_AppFunction.hxx>
#include <Blend_Point.hxx>
#include <BRepBlend_Line.hxx>
#include <math_FunctionSetRoot.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HArray1OfVec2d.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
BRepBlend_AppFuncRoot::BRepBlend_AppFuncRoot(Handle(BRepBlend_Line)& Line,
Blend_AppFunction& Func,
const Standard_Real Tol3d,
const Standard_Real Tol2d)
:myLine(Line),
myFunc(&Func),
myTolerance(1,Func.NbVariables()),
X1(1,Func.NbVariables()),
X2(1,Func.NbVariables()),
XInit(1,Func.NbVariables()),
Sol(1,Func.NbVariables())
{
Standard_Integer NbPoles, NbKnots, Degree, NbPoles2d;
Standard_Integer ii;
// Tolerances
Func.GetTolerance(myTolerance, Tol3d);
Standard_Integer dim = Func.NbVariables();
for (ii=1; ii<= dim; ii++) {
if (myTolerance(ii)>Tol2d) { myTolerance(ii) = Tol2d;}
}
// Tableaux
Func.GetShape( NbPoles, NbKnots, Degree, NbPoles2d);
// Calcul du BaryCentre (cas rationnel).
if (Func.IsRational()) {
Standard_Real Xmax =-1.e100, Xmin = 1.e100,
Ymax =-1.e100, Ymin = 1.e100,
Zmax =-1.e100, Zmin = 1.e100;
Blend_Point P;
for (ii=1; ii<=myLine->NbPoints(); ii++) {
P = myLine->Point(ii);
Xmax = Max ( Max(P.PointOnS1().X(), P.PointOnS2().X()), Xmax);
Xmin = Min ( Min(P.PointOnS1().X(), P.PointOnS2().X()), Xmin);
Ymax = Max ( Max(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymax);
Ymin = Min ( Min(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymin);
Zmax = Max ( Max(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmax);
Zmin = Min ( Min(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmin);
myBary.SetCoord((Xmax+Xmin)/2, (Ymax+Ymin)/2, (Zmax+Zmin)/2);
}
}
else {myBary.SetCoord(0,0,0);}
}
//================================================================================
// Function: D0
// Purpose : Calcul de la section pour v = Param, si le calcul echoue on rend
// Standard_False.
//================================================================================
Standard_Boolean BRepBlend_AppFuncRoot::D0(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,TColStd_Array1OfReal& Weigths)
{
Standard_Boolean Ok=Standard_True;
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Ok = SearchPoint( *Func, Param, myPnt);
if (Ok) (*Func).Section(myPnt,
Poles,
Poles2d,
Weigths);
return Ok;
}
//================================================================================
// Function: D1
// Purpose : Calcul de la derive partiel de la section par rapport a v
// pour v = Param, si le calcul echoue on rend Standard_False.
//================================================================================
Standard_Boolean BRepBlend_AppFuncRoot::D1(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths)
{
Standard_Boolean Ok=Standard_True;
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Ok = SearchPoint( *Func, Param, myPnt);
if (Ok) {
Ok = (*Func).Section(myPnt,
Poles, DPoles,
Poles2d, DPoles2d,
Weigths, DWeigths);
}
return Ok;
}
//===========================================================================
// Function: D2
// Purpose : Calcul de la derive et seconde partiel de la
// section par rapport a v.
// Pour v = Param, si le calcul echoue on rend Standard_False.
//===========================================================================
Standard_Boolean BRepBlend_AppFuncRoot::D2(const Standard_Real Param,
const Standard_Real First,
const Standard_Real Last,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths)
{
Standard_Boolean Ok=Standard_True;
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Ok = SearchPoint( *Func, Param, myPnt);
if (Ok) {
Ok = (*Func).Section(myPnt,
Poles, DPoles, D2Poles,
Poles2d, DPoles2d, D2Poles2d,
Weigths, DWeigths, D2Weigths);
}
return Ok;
}
Standard_Integer BRepBlend_AppFuncRoot::Nb2dCurves() const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Standard_Integer i,j,k,nbpol2d;
(*Func).GetShape(i,j,k,nbpol2d);
return nbpol2d;
}
void BRepBlend_AppFuncRoot::SectionShape(Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Standard_Integer ii;
(*Func).GetShape( NbPoles, NbKnots, Degree, ii);
}
void BRepBlend_AppFuncRoot::Knots(TColStd_Array1OfReal& TKnots) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->Knots(TKnots);
}
void BRepBlend_AppFuncRoot::Mults(TColStd_Array1OfInteger& TMults) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->Mults(TMults);
}
Standard_Boolean BRepBlend_AppFuncRoot::IsRational() const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
return (*Func).IsRational();
}
Standard_Integer BRepBlend_AppFuncRoot::NbIntervals(const GeomAbs_Shape S) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
return Func->NbIntervals(S);
}
void BRepBlend_AppFuncRoot::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->Intervals(T, S);
}
void BRepBlend_AppFuncRoot::SetInterval(const Standard_Real First,const Standard_Real Last)
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->Set(First, Last);
}
void BRepBlend_AppFuncRoot::Resolution(const Standard_Integer Index,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->Resolution(Index,Tol,TolU,TolV);
}
void BRepBlend_AppFuncRoot::GetTolerance(const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
TColStd_Array1OfReal& Tol3d) const
{
Standard_Integer ii;
math_Vector V3d(1, Tol3d.Length()), V1d(1, Tol3d.Length());
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->GetTolerance(BoundTol, SurfTol, AngleTol, V3d, V1d);
for (ii=1; ii<=Tol3d.Length(); ii++) Tol3d(ii) = V3d(ii);
}
void BRepBlend_AppFuncRoot::SetTolerance(const Standard_Real Tol3d,
const Standard_Real Tol2d)
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Standard_Integer ii, dim = Func->NbVariables();
Func->GetTolerance(myTolerance, Tol3d);
for (ii=1; ii<=dim; ii++) {
if (myTolerance(ii)>Tol2d) { myTolerance(ii) = Tol2d;}
}
}
gp_Pnt BRepBlend_AppFuncRoot::BarycentreOfSurf() const
{
return myBary;
}
Standard_Real BRepBlend_AppFuncRoot::MaximalSection() const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
return Func->GetSectionSize();
}
void BRepBlend_AppFuncRoot::GetMinimalWeight(TColStd_Array1OfReal& Weigths) const
{
Blend_AppFunction* Func = (Blend_AppFunction*)myFunc;
Func->GetMinimalWeight(Weigths);
}
//================================================================================
//
// Function : SearchPoint
//
// Purpose : Recherche du point solution au parametre Param (sur 2 Surfaces)
//
// Algorithme :
// 1) On recheche une solution approximative a partir des Points dejas calcules
// 2) On Converge par une methode de type Newton
//
// Causes possibles d'echecs :
// - Singularite sur les surfaces.
// - Manquent d'information dans la "line"issue du cheminement.
//
//================================================================================
Standard_Boolean BRepBlend_AppFuncRoot::SearchPoint(Blend_AppFunction& Func,
const Standard_Real Param,
Blend_Point& Pnt)
{
Standard_Boolean Trouve;
Standard_Integer dim = Func.NbVariables();
// (1) Recherche d'un point d'init
Standard_Integer I1=1, I2=myLine->NbPoints(), Index;
Standard_Real t1, t2;
// (1.a) On verifie que c'est a l'interieur
if (Param < myLine->Point(I1).Parameter()) {return Standard_False;}
if (Param > myLine->Point(I2).Parameter()) {return Standard_False;}
// (1.b) On recheche l'intervalle
Trouve = SearchLocation(Param, I1, I2, Index);
// (1.c) Si le point est dejas calcule on le recupere
if (Trouve) {
Pnt = myLine->Point(Index);
Vec(XInit,Pnt);
}
else {
// (1.d) Intialisation par interpolation lineaire
Pnt = myLine->Point(Index);
Vec(X1,Pnt);
t1 = Pnt.Parameter();
Pnt = myLine->Point(Index+1);
Vec(X2,Pnt);
t2 = Pnt.Parameter();
Standard_Real Parammt1 = (Param-t1) / (t2-t1);
Standard_Real t2mParam = (t2-Param) / (t2-t1);
for(Standard_Integer i = 1; i <= dim; i++){
XInit(i) = X2(i) * Parammt1 + X1(i) * t2mParam;
}
}
// (2) Calcul effectif de la solution ------------------------
Func.Set(Param);
Func.GetBounds(X1, X2);
math_FunctionSetRoot rsnld(Func, myTolerance, 30);
rsnld.Perform(Func, XInit, X1, X2);
if (!rsnld.IsDone()) {
# ifdef DEB
cout << "AppFunc : RNLD Not done en t = " << Param << endl;
# endif
return Standard_False;
}
rsnld.Root(Sol);
// (3) Stockage du point
Point(Func,Param,Sol,Pnt);
// (4) Insertion du point si le cacul semble long.
if ((!Trouve)&&(rsnld.NbIterations()>3)) {
#ifdef DEB
cout << "Evaluation en t = " << Param << "donne" << endl;
rsnld.Dump(cout);
#endif
myLine->InsertBefore(Index+1, Pnt);
}
return Standard_True;
}
//=============================================================================
//
// Function : SearchLocation
//
// Purpose : Recherche dichotomiqique du rang de l'intervalle parametrique contenant
// Param dans la liste de points calcule (myline)
// si le point de parametre Param est deja stocker dans la liste on rend
// True et ParamIndex correspond au rang du Point.
// La complexite de cet algorithme est de log(n)/log(2)
//================================================================================
Standard_Boolean BRepBlend_AppFuncRoot::SearchLocation(const Standard_Real Param,
const Standard_Integer FirstIndex,
const Standard_Integer LastIndex,
Standard_Integer& ParamIndex) const
{
Standard_Integer Ideb = FirstIndex, Ifin = LastIndex, Idemi;
Standard_Real Valeur;
Valeur = myLine->Point(Ideb).Parameter();
if (Param == Valeur) {
ParamIndex = Ideb;
return Standard_True;
}
Valeur = myLine->Point(Ifin).Parameter();
if (Param == Valeur) {
ParamIndex = Ifin;
return Standard_True;
}
while ( Ideb+1 != Ifin) {
Idemi = (Ideb+Ifin)/2;
Valeur = myLine->Point(Idemi).Parameter();
if (Valeur < Param) {Ideb = Idemi;}
else {
if ( Valeur > Param) { Ifin = Idemi;}
else { ParamIndex = Idemi;
return Standard_True;}
}
}
ParamIndex = Ideb;
return Standard_False;
}

View File

@@ -0,0 +1,39 @@
-- File: BRepBlend_AppFuncRst.cdl
-- Created: Fri Jul 25 10:49:53 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
---Copyright: Matra Datavision 1997
class AppFuncRst from BRepBlend inherits AppFuncRoot from BRepBlend
---Purpose: Function to approximate by AppSurface for Edge/Face
---Level: Advanced
uses
Line from BRepBlend,
Point from Blend,
SurfRstFunction from Blend,
AppFunction from Blend,
Vector from math
raises OutOfRange from Standard
is
Create(Line : in out Line from BRepBlend;
Func : in out SurfRstFunction from Blend;
Tol3d: Real;
Tol2d: Real)
returns AppFuncRst from BRepBlend;
Point(me;
Func : AppFunction from Blend;
Param : Real;
Sol : Vector from math;
Pnt : in out Point from Blend);
Vec(me;
Sol : in out Vector from math;
Pnt : Point from Blend);
end AppFuncRst;

View File

@@ -0,0 +1,33 @@
// File: BRepBlend_AppFuncRst.cxx
// Created: Fri Jul 25 14:18:14 1997
// Author: Jerome LEMONIER
// <jlr@sgi64>
#include <BRepBlend_AppFuncRst.ixx>
BRepBlend_AppFuncRst::BRepBlend_AppFuncRst (Handle(BRepBlend_Line)& Line,
Blend_SurfRstFunction& Func,
const Standard_Real Tol3d,
const Standard_Real Tol2d)
:BRepBlend_AppFuncRoot(Line,Func,Tol3d,Tol2d)
{
}
void BRepBlend_AppFuncRst::Point(const Blend_AppFunction& Func,
const Standard_Real Param,
const math_Vector& Sol,
Blend_Point& Pnt)const
{
Pnt.SetValue(Func.Pnt1(), Func.Pnt2(),
Param,
Sol(1), Sol(2), Sol(3));
}
void BRepBlend_AppFuncRst::Vec(math_Vector& Sol,
const Blend_Point& Pnt)const
{
Pnt.ParametersOnS(Sol(1),Sol(2));
Sol(3) = Pnt.ParameterOnC();
}

View File

@@ -0,0 +1,39 @@
-- File: BRepBlend_AppFuncRstRst.cdl
-- Created: Tue May 12 15:33:20 1998
-- Author: Philippe NOUAILLE
-- <pne@cleox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1998
class AppFuncRstRst from BRepBlend inherits AppFuncRoot from BRepBlend
---Purpose: Function to approximate by AppSurface for Edge/Face
---Level: Advanced
uses
Line from BRepBlend,
Point from Blend,
AppFunction from Blend,
RstRstFunction from Blend,
Vector from math
raises OutOfRange from Standard
is
Create(Line : in out Line from BRepBlend;
Func : in out RstRstFunction from Blend;
Tol3d: Real;
Tol2d: Real)
returns AppFuncRstRst from BRepBlend;
Point(me;
Func : AppFunction from Blend;
Param : Real;
Sol : Vector from math;
Pnt : in out Point from Blend);
Vec(me;
Sol : in out Vector from math;
Pnt : Point from Blend);
end AppFuncRstRst;

View File

@@ -0,0 +1,33 @@
// File: BRepBlend_AppFuncRstRst.cxx
// Created: Wed May 13 09:50:59 1998
// Author: Philippe NOUAILLE
// <pne@cleox.paris1.matra-dtv.fr>
#include <BRepBlend_AppFuncRstRst.ixx>
BRepBlend_AppFuncRstRst::BRepBlend_AppFuncRstRst (Handle(BRepBlend_Line)& Line,
Blend_RstRstFunction& Func,
const Standard_Real Tol3d,
const Standard_Real Tol2d)
:BRepBlend_AppFuncRoot(Line,Func,Tol3d,Tol2d)
{
}
void BRepBlend_AppFuncRstRst::Point(const Blend_AppFunction& Func,
const Standard_Real Param,
const math_Vector& Sol,
Blend_Point& Pnt)const
{
Pnt.SetValue(Func.Pnt1(), Func.Pnt2(),
Param,
Sol(1), Sol(2));
}
void BRepBlend_AppFuncRstRst::Vec(math_Vector& Sol,
const Blend_Point& Pnt)const
{
Sol(1) = Pnt.ParameterOnC1();
Sol(2) = Pnt.ParameterOnC2();
}

View File

@@ -0,0 +1,241 @@
-- File: BRepBlend_AppSurface.cdl
-- Created: Mon Nov 25 11:51:49 1996
-- Author: Philippe MANGIN
-- <pmn@sgi29>
---Copyright: Matra Datavision 1996
class AppSurface from BRepBlend inherits Approx from AppBlend
---Purpose:Used to Approximate the blending surfaces.
uses Array2OfReal from TColStd,
HArray2OfReal from TColStd,
Array1OfReal from TColStd,
HArray1OfReal from TColStd,
Array1OfInteger from TColStd,
HArray1OfInteger from TColStd,
Array1OfPnt2d from TColgp,
Array2OfPnt from TColgp,
HArray2OfPnt from TColgp,
Shape from GeomAbs,
SweepFunction from Approx,
SweepApproximation from Approx
raises NotDone from StdFail,
DomainError,
OutOfRange
is
Create(Funct : in out SweepFunction from Approx;
First, Last : Real;
Tol3d, Tol2d, TolAngular : Real;
Continuity : Shape = GeomAbs_C0;
Degmax : Integer = 11;
Segmax : Integer = 50)
---Purpose: Approximation of the new Surface (and
-- eventually the 2d Curves on the support
-- surfaces).
-- Normaly the 2d curve are
-- approximated with an tolerance given by the
-- resolution on support surfaces, but if this
-- tolerance is too large Tol2d is used.
returns AppSurface from BRepBlend;
IsDone(me)
returns Boolean from Standard
---C++: inline
is static;
SurfShape(me; UDegree,VDegree : out Integer from Standard;
NbUPoles,NbVPoles: out Integer from Standard;
NbUKnots,NbVKnots: out Integer from Standard)
raises NotDone from StdFail
is static;
Surface(me; TPoles : out Array2OfPnt from TColgp;
TWeights : out Array2OfReal from TColStd;
TUKnots,TVKnots : out Array1OfReal from TColStd;
TUMults,TVMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail
is static;
UDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
VDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
SurfPoles(me)
returns Array2OfPnt from TColgp
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfWeights(me)
returns Array2OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfUKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfVKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfUMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfVMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
MaxErrorOnSurf (me)
---Purpose: returns the maximum error in the suface approximation.
returns Real;
NbCurves2d(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
Curves2dShape(me; Degree,NbPoles,NbKnots: out Integer from Standard)
raises NotDone from StdFail,
DomainError from Standard
is static;
Curve2d(me; Index: Integer from Standard;
TPoles : out Array1OfPnt2d from TColgp;
TKnots : out Array1OfReal from TColStd;
TMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is static;
Curves2dDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail,
DomainError from Standard
is static;
Curve2dPoles(me; Index: Integer from Standard)
returns Array1OfPnt2d from TColgp
---C++: inline
---C++: return const&
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is static;
Curves2dKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is static;
Curves2dMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is static;
TolReached(me; Tol3d, Tol2d : out Real from Standard)
raises NotDone from StdFail
is static;
Max2dError (me; Index : Integer)
---Purpose: returns the maximum error in the <Index> 2d curve approximation.
returns Real
raises NotDone from StdFail
is static;
TolCurveOnSurf(me; Index : Integer from Standard)
returns Real from Standard
raises NotDone from StdFail
is static;
Dump(me; o: in out OStream);
---Purpose: diplay information on approximation.
fields
approx : SweepApproximation from Approx;
end AppSurface;

View File

@@ -0,0 +1,131 @@
// File: BrepBlend_AppSurface.cxx
// Created: Tue Nov 26 09:43:16 1996
// Author: Philippe MANGIN
// <pmn@sgi29>
#include <BRepBlend_AppSurface.ixx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_Array1OfVec2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <StdFail_NotDone.hxx>
BRepBlend_AppSurface::BRepBlend_AppSurface(
Handle(Approx_SweepFunction)& Func,
const Standard_Real First,
const Standard_Real Last,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real TolAngular,
const GeomAbs_Shape Continuity,
const Standard_Integer Degmax,
const Standard_Integer Segmax) :
approx(Func)
{
Standard_Integer Nb2d = Func->Nb2dCurves();
Standard_Integer NbPolSect, NbKnotSect, udeg;
GeomAbs_Shape continuity = Continuity;
// (1) Verification de la possibilite de derivation
if (continuity != GeomAbs_C0) {
if (Nb2d == 0) Nb2d =1;
Func->SectionShape(NbPolSect, NbKnotSect, udeg);
TColStd_Array1OfReal W (1, NbPolSect);
TColgp_Array1OfPnt P (1, NbPolSect);
TColgp_Array1OfPnt2d P2d(1, Nb2d);
TColgp_Array1OfVec V (1, NbPolSect);
TColgp_Array1OfVec2d V2d(1, Nb2d);
Standard_Boolean Ok;
if (continuity == GeomAbs_C2) {
Ok = Func->D2( First, First, Last, P, V, V, P2d, V2d, V2d, W, W, W);
if (!Ok) { continuity = GeomAbs_C1; }
}
if (continuity == GeomAbs_C1) {
Ok = (Func->D1(First, First, Last, P, V, P2d, V2d, W, W));
if (!Ok) { continuity = GeomAbs_C0; }
}
}
// (2) Approximation
approx.Perform(First, Last,
Tol3d, Tol3d, Tol2d, TolAngular,
continuity, Degmax, Segmax);
}
void BRepBlend_AppSurface::SurfShape (Standard_Integer& UDegree,
Standard_Integer& VDegree,
Standard_Integer& NbUPoles,
Standard_Integer& NbVPoles,
Standard_Integer& NbUKnots,
Standard_Integer& NbVKnots) const
{
approx.SurfShape(UDegree, VDegree,
NbUPoles, NbVPoles,
NbUKnots,NbVKnots);
}
void BRepBlend_AppSurface::Surface(TColgp_Array2OfPnt& TPoles,
TColStd_Array2OfReal& TWeights,
TColStd_Array1OfReal& TUKnots,
TColStd_Array1OfReal& TVKnots,
TColStd_Array1OfInteger& TUMults,
TColStd_Array1OfInteger& TVMults) const
{
approx.Surface(TPoles, TWeights, TUKnots,TVKnots, TUMults,TVMults);
}
Standard_Real BRepBlend_AppSurface::MaxErrorOnSurf() const
{
return approx.MaxErrorOnSurf();
}
void BRepBlend_AppSurface::Curves2dShape(Standard_Integer& Degree,
Standard_Integer& NbPoles,
Standard_Integer& NbKnots) const
{
approx.Curves2dShape( Degree, NbPoles, NbKnots);
}
void BRepBlend_AppSurface::Curve2d(const Standard_Integer Index,
TColgp_Array1OfPnt2d& TPoles,
TColStd_Array1OfReal& TKnots,
TColStd_Array1OfInteger& TMults) const
{
approx.Curve2d(Index, TPoles, TKnots, TMults);
}
Standard_Real BRepBlend_AppSurface::Max2dError(const Standard_Integer Index) const
{
return approx.Max2dError(Index);
}
Standard_Real BRepBlend_AppSurface::TolCurveOnSurf(const Standard_Integer Index) const
{
return approx.TolCurveOnSurf(Index);
}
inline void BRepBlend_AppSurface::TolReached (Standard_Real& Tol3d,
Standard_Real& Tol2d) const
{
Tol3d = approx.MaxErrorOnSurf();
Tol2d = 0;
for (Standard_Integer ii=1; ii<=approx.NbCurves2d(); ii++) {
Tol2d = Max(Tol2d, approx.Max2dError(ii));
}
}
void BRepBlend_AppSurface::Dump(Standard_OStream& o) const
{
approx.Dump(o);
}

View File

@@ -0,0 +1,96 @@
// File: BRepBlend_AppSurface.lxx
// Created: Tue Nov 26 10:21:03 1996
// Author: Philippe MANGIN
// <pmn@sgi29>
#include <StdFail_NotDone.hxx>
#include <TColgp_HArray2OfPnt.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
inline Standard_Boolean BRepBlend_AppSurface::IsDone() const
{
return approx.IsDone();
}
inline Standard_Integer BRepBlend_AppSurface::UDegree() const
{
return approx.UDegree();
}
inline Standard_Integer BRepBlend_AppSurface::VDegree() const
{
return approx.VDegree();
}
inline const TColgp_Array2OfPnt&
BRepBlend_AppSurface::SurfPoles() const
{
return approx.SurfPoles();
}
inline const TColStd_Array2OfReal&
BRepBlend_AppSurface::SurfWeights() const
{
return approx.SurfWeights();
}
inline const TColStd_Array1OfReal&
BRepBlend_AppSurface::SurfUKnots() const
{
return approx.SurfUKnots();
}
inline const TColStd_Array1OfReal&
BRepBlend_AppSurface::SurfVKnots() const
{
return approx.SurfVKnots();
}
inline const TColStd_Array1OfInteger&
BRepBlend_AppSurface::SurfUMults() const
{
return approx.SurfUMults();
}
inline const TColStd_Array1OfInteger&
BRepBlend_AppSurface::SurfVMults() const
{
return approx.SurfVMults();
}
inline Standard_Integer BRepBlend_AppSurface::NbCurves2d() const
{
return approx.NbCurves2d();
}
inline Standard_Integer BRepBlend_AppSurface::Curves2dDegree() const
{
return approx.Curves2dDegree();
}
inline const TColgp_Array1OfPnt2d&
BRepBlend_AppSurface::Curve2dPoles(const Standard_Integer Index) const
{
return approx.Curve2dPoles(Index);
}
inline const TColStd_Array1OfReal&
BRepBlend_AppSurface::Curves2dKnots() const
{
return approx.Curves2dKnots();
}
inline const TColStd_Array1OfInteger&
BRepBlend_AppSurface::Curves2dMults () const
{
return approx.Curves2dMults();
}

View File

@@ -0,0 +1,104 @@
-- File : BRepBlend_BlendTool.cdl
-- Created : Mon Dec 6 09:49:19 1993
-- Author : Jacques GOUSSARD
---Copyright : Matra Datavision 1993
class BlendTool from BRepBlend
---Purpose:
uses
Pnt2d from gp,
State from TopAbs,
HCurve2d from Adaptor2d,
HSurface from Adaptor3d,
HVertex from Adaptor3d
is
Project(myclass; P: Pnt2d from gp;
S: HSurface from Adaptor3d ;
C: HCurve2d from Adaptor2d ;
Paramproj: out Real from Standard;
Dist: out Real from Standard)
---Purpose: Projects the point P on the arc C.
-- If the methods returns Standard_True, the projection is
-- successful, and Paramproj is the parameter on the arc
-- of the projected point, Dist is the distance between
-- P and the curve..
-- If the method returns Standard_False, Param proj and Dist
-- are not significant.
--
returns Boolean from Standard;
Inters (myclass; P1,P2: Pnt2d from gp;
S: HSurface from Adaptor3d ;
C: HCurve2d from Adaptor2d ;
Param: out Real from Standard;
Dist: out Real from Standard)
returns Boolean from Standard;
Parameter(myclass; V: HVertex from Adaptor3d; A: HCurve2d from Adaptor2d )
---Purpose: Returns the parameter of the vertex V on the edge A.
---C++: inline
returns Real from Standard;
Tolerance(myclass; V: HVertex from Adaptor3d; A: HCurve2d from Adaptor2d )
---Purpose: Returns the parametric tolerance on the arc A
-- used to consider that the vertex and another point meet,
-- i-e if Abs(Parameter(Vertex)-Parameter(OtherPnt))<=
-- Tolerance, the points are "merged".
---C++: inline
returns Real from Standard;
-- Methodes pour Rayon constant, en plus des 2 precedentes
SingularOnUMin(myclass; S:HSurface from Adaptor3d )
returns Boolean from Standard;
---C++: inline
SingularOnUMax(myclass; S:HSurface from Adaptor3d )
returns Boolean from Standard;
---C++: inline
SingularOnVMin(myclass; S:HSurface from Adaptor3d )
returns Boolean from Standard;
---C++: inline
SingularOnVMax(myclass; S:HSurface from Adaptor3d )
returns Boolean from Standard;
---C++: inline
NbSamplesU(myclass; S: HSurface from Adaptor3d ;
u1,u2: Real from Standard)
returns Integer from Standard;
NbSamplesV(myclass; S: HSurface from Adaptor3d ;
v1,v2: Real from Standard)
returns Integer from Standard;
Bounds(myclass; C: HCurve2d from Adaptor2d ;
Ufirst,Ulast: out Real from Standard);
---Purpose: Returns the parametric limits on the arc C.
-- These limits must be finite : they are either
-- the real limits of the arc, for a finite arc,
-- or a bounding box for an infinite arc.
CurveOnSurf(myclass; C: HCurve2d from Adaptor2d ; S: HSurface from Adaptor3d )
---C++: inline
returns HCurve2d from Adaptor2d ;
end BlendTool;

View File

@@ -0,0 +1,122 @@
// File : BRepBlend_BlendTool.cxx
// Created : Mon Dec 6 09:49:19 1993
// Author : Jacques GOUSSARD
// Copyright : Matra Datavision 1993
#include <BRepBlend_BlendTool.ixx>
#include <BRepClass_FaceClassifier.hxx>
#include <Extrema_EPCOfExtPC2d.hxx>
#include <Extrema_POnCurv2d.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <BRep_Tool.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Vec2d.hxx>
#include <Geom2dInt_GInter.hxx>
#include <IntRes2d_IntersectionPoint.hxx>
#include <BRepBlend_HCurve2dTool.hxx>
//=======================================================================
//function : Project
//purpose : Projection orthogonal d'un point sur une courbe
// pmn 8/10/98 : On retourne toujours une distance. (BUC60360)
//=======================================================================
Standard_Boolean BRepBlend_BlendTool::Project(const gp_Pnt2d& P,
const Handle(Adaptor3d_HSurface)&,
const Handle(Adaptor2d_HCurve2d)& C,
Standard_Real& Paramproj,
Standard_Real& Dist)
{
Paramproj = BRepBlend_HCurve2dTool::FirstParameter(C);
gp_Pnt2d P2d;
BRepBlend_HCurve2dTool::D0(C, Paramproj, P2d);
Dist = P2d.Distance(P);
const Standard_Real t = BRepBlend_HCurve2dTool::LastParameter(C);
BRepBlend_HCurve2dTool::D0(C, t, P2d);
if (P2d.Distance(P) < Dist) {
Paramproj = t;
Dist = P2d.Distance(P);
}
const Standard_Real epsX = 1.e-8;
const Standard_Integer Nbu = 20;
const Standard_Real Tol = 1.e-5;
Extrema_EPCOfExtPC2d extrema(P, C->Curve2d(), Nbu, epsX, Tol);
if (!extrema.IsDone())
return Standard_True;
const Standard_Integer Nbext = extrema.NbExt();
Standard_Real aDist2 = Dist * Dist;
for (Standard_Integer i=1; i<=Nbext; i++) {
if (extrema.SquareDistance(i) < aDist2) {
aDist2 = extrema.SquareDistance(i);
Paramproj = extrema.Point(i).Parameter();
}
}
Dist = sqrt (aDist2);
return Standard_True;
}
//=======================================================================
//function : Inters
//purpose : Intersection d'un segment avec une courbe
//=======================================================================
Standard_Boolean BRepBlend_BlendTool::Inters(const gp_Pnt2d& P1,
const gp_Pnt2d& P2,
const Handle(Adaptor3d_HSurface)&,
const Handle(Adaptor2d_HCurve2d)& C,
Standard_Real& Param,
Standard_Real& Dist)
{
const Standard_Real Tol = 1.e-8;
const gp_Vec2d v(P1,P2);
const Standard_Real mag = v.Magnitude();
if(mag < Tol) return Standard_False;
gp_Dir2d d(v);
Handle(Geom2d_Line) bid = new Geom2d_Line(P1,d);
Geom2dAdaptor_Curve seg(bid,-0.01*mag,1.01*mag);
Geom2dInt_GInter inter(seg,C->Curve2d(),Tol,Tol);
if (!inter.IsDone())
return Standard_False;
const Standard_Integer Nbint = inter.NbPoints();
if (Nbint == 0)
return Standard_False;
IntRes2d_IntersectionPoint ip = inter.Point(1);
Param = ip.ParamOnSecond();
Dist = P1.Distance(ip.Value());
return Standard_True;
}
Standard_Integer BRepBlend_BlendTool::NbSamplesV
(const Handle(Adaptor3d_HSurface)& S,
const Standard_Real u1,
const Standard_Real u2)
{
return 10;
}
Standard_Integer BRepBlend_BlendTool::NbSamplesU
(const Handle(Adaptor3d_HSurface)& S,
const Standard_Real u1,
const Standard_Real u2)
{
return 10;
}
void BRepBlend_BlendTool::Bounds(const Handle(Adaptor2d_HCurve2d)& A,
Standard_Real& Ufirst,
Standard_Real& Ulast)
{
Ufirst = BRepBlend_HCurve2dTool::FirstParameter(A);
Ulast = BRepBlend_HCurve2dTool::LastParameter(A);
}

View File

@@ -0,0 +1,41 @@
// File : BRepBlend_BlendTool.lxx
// Created : Mon Dec 6 09:49:19 1993
// Author : Jacques GOUSSARD
// Copyright : Matra Datavision 1993
inline Standard_Boolean BRepBlend_BlendTool::SingularOnUMin (const Handle(Adaptor3d_HSurface)& )
{
return Standard_False;
}
inline Standard_Boolean BRepBlend_BlendTool::SingularOnUMax (const Handle(Adaptor3d_HSurface)& )
{
return Standard_False;
}
inline Standard_Boolean BRepBlend_BlendTool::SingularOnVMin (const Handle(Adaptor3d_HSurface)& )
{
return Standard_False;
}
inline Standard_Boolean BRepBlend_BlendTool::SingularOnVMax (const Handle(Adaptor3d_HSurface)& )
{
return Standard_False;
}
inline Standard_Real BRepBlend_BlendTool::Tolerance (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& A)
{
// return Adaptor2d_HCurve2dTool::Resolution(A,1.e-6); // a voir
return V->Resolution(A); // a voir
}
inline Standard_Real BRepBlend_BlendTool::Parameter (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& C)
{
// return BRep_Tool::Parameter(V,A->Curve().Edge());
return V->Parameter(C);
}
inline Handle(Adaptor2d_HCurve2d) BRepBlend_BlendTool::CurveOnSurf (const Handle(Adaptor2d_HCurve2d)& C, const Handle(Adaptor3d_HSurface)&)
{
return C;
}

View File

@@ -0,0 +1,85 @@
-- File: BRepBlend_CurvPointRadInv.cdl
-- Created: Wed Feb 12 14:27:39 1997
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class CurvPointRadInv from BRepBlend
inherits CurvPointFuncInv from Blend
---Purpose: This function is used to find a solution on a done
-- point of the curve 1 when using RstRstConsRad or
-- CSConstRad...
-- The vector <X> used in Value, Values and Derivatives
-- methods has to be the vector of the parametric
-- coordinates w, U where w is the parameter on the
-- guide line, U are the parametric coordinates of a
-- point on the partner curve 2.
uses
Pnt from gp,
Vector from math,
Matrix from math,
HCurve from Adaptor3d
is
Create(C1 : HCurve from Adaptor3d; C2 : HCurve from Adaptor3d)
returns CurvPointRadInv from BRepBlend;
Set(me: in out; Choix: Integer from Standard)
is static;
NbEquations(me)
---Purpose: returns 2.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me: in out; P : Pnt from gp);
---Purpose: Set the Point on which a solution has to be found.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
---Purpose: Returns in the vector Tolerance the parametric tolerance
-- for each of the 3 variables;
-- Tol is the tolerance used in 3d space.
GetBounds(me; InfBound,SupBound: out Vector from math);
---Purpose: Returns in the vector InfBound the lowest values allowed
-- for each of the 3 variables.
-- Returns in the vector SupBound the greatest values allowed
-- for each of the 3 variables.
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
---Purpose: Returns Standard_True if Sol is a zero of the function.
-- Tol is the tolerance used in 3d space.
returns Boolean from Standard;
fields
curv1 : HCurve from Adaptor3d;
curv2 : HCurve from Adaptor3d;
point : Pnt from gp;
choix : Integer from Standard;
end CurvPointRadInv;

View File

@@ -0,0 +1,163 @@
// File: BRepBlend_CurvPointRadInv.cxx
// Created: Wed Feb 12 14:55:06 1997
// Author: Laurent BOURESCHE
// <lbo@pomalox.paris1.matra-dtv.fr>
#include <BRepBlend_CurvPointRadInv.ixx>
//=======================================================================
//function : BRepBlend_CurvPointRadInv
//purpose :
//=======================================================================
BRepBlend_CurvPointRadInv::BRepBlend_CurvPointRadInv
(const Handle(Adaptor3d_HCurve)& C1,
const Handle(Adaptor3d_HCurve)& C2) : curv1(C1), curv2(C2)
{
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_CurvPointRadInv::Set(const Standard_Integer Choix)
{
choix = Choix;
}
//=======================================================================
//function : NbEquations
//purpose :
//=======================================================================
Standard_Integer BRepBlend_CurvPointRadInv::NbEquations() const
{
return 2;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_CurvPointRadInv::Value(const math_Vector& X,
math_Vector& F)
{
Standard_Real theD;
gp_Pnt ptcur1, ptcur2;
gp_Vec d1cur1, d1cur2;
gp_XYZ nplan;//, ref;
curv1->D1(X(1),ptcur1, d1cur1);
nplan = d1cur1.Normalized().XYZ();
theD = -(nplan.Dot(ptcur1.XYZ()));
curv2->D1(X(2), ptcur2, d1cur2);
F(1) = nplan.Dot(point.XYZ()) + theD;
F(2) = nplan.Dot(ptcur2.XYZ()) + theD;
return Standard_True;
}
//=======================================================================
//function : Derivatives
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_CurvPointRadInv::Derivatives(const math_Vector& X,
math_Matrix& D)
{
gp_Pnt ptcur1, ptcur2;
gp_Vec d1cur1,d2cur1, d1cur2, nplan, dnplan;
Standard_Real theD, dtheD, normd1cur1, unsurnormd1cur1;
curv1->D2(X(1), ptcur1, d1cur1, d2cur1);
normd1cur1 = d1cur1.Magnitude();
unsurnormd1cur1 = 1. / normd1cur1;
nplan = unsurnormd1cur1 * d1cur1;
theD = -(nplan.XYZ().Dot(ptcur1.XYZ()));
dnplan.SetLinearForm(-nplan.Dot(d2cur1), nplan, d2cur1);
dnplan.Multiply(unsurnormd1cur1);
dtheD = - nplan.XYZ().Dot(d1cur1.XYZ()) - dnplan.XYZ().Dot(ptcur1.XYZ());
D(1,1) = dnplan.XYZ().Dot(point.XYZ()) + dtheD;
D(1,2) = 0.;
curv2->D1(X(2), ptcur2, d1cur2);
D(2,1) = dnplan.XYZ().Dot(ptcur2.XYZ()) + dtheD;
D(2,2) = nplan.Dot(d1cur2);
return Standard_True;
}
//=======================================================================
//function : Values
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_CurvPointRadInv::Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D)
{
Standard_Boolean Retour;
Retour = Value(X, F);
Retour = Derivatives(X, D);
return Standard_True;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_CurvPointRadInv::Set(const gp_Pnt& P)
{
point = P;
}
//=======================================================================
//function : GetTolerance
//purpose :
//=======================================================================
void BRepBlend_CurvPointRadInv::GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const
{
Tolerance(1) = curv1->Resolution(Tol);
Tolerance(2) = curv2->Resolution(Tol);
}
//=======================================================================
//function : GetBounds
//purpose :
//=======================================================================
void BRepBlend_CurvPointRadInv::GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const
{
InfBound(1) = curv1->FirstParameter();
SupBound(1) = curv1->LastParameter();
InfBound(2) = curv2->FirstParameter();
SupBound(2) = curv2->LastParameter();
}
//=======================================================================
//function : IsSolution
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_CurvPointRadInv::IsSolution(const math_Vector& Sol,
const Standard_Real Tol)
{
math_Vector valsol(1, 2);
Value(Sol,valsol);
if (Abs(valsol(1)) <= Tol &&
Abs(valsol(2)) <= Tol ) {
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,227 @@
-- File: BRepBlend_HCurve2dToolGen.cdl
-- Created: Mon Jul 17 16:25:23 1995
-- Author: Laurent BUCHARD
-- <lbr@mastox>
---Copyright: Matra Datavision 1995
generic class HCurve2dToolGen from BRepBlend (
CurveGen as any)
uses
Array1OfReal from TColStd,
Shape from GeomAbs,
CurveType from GeomAbs,
Vec2d from gp,
Pnt2d from gp,
Circ2d from gp,
Elips2d from gp,
Hypr2d from gp,
Parab2d from gp,
Lin2d from gp,
BezierCurve from Geom2d,
BSplineCurve from Geom2d
raises
OutOfRange from Standard,
NoSuchObject from Standard,
DomainError from Standard
is
--
-- Global methods - Apply to the whole curve.
--
FirstParameter(myclass; C: CurveGen) returns Real
---C++: inline
;
LastParameter(myclass; C: CurveGen) returns Real
---C++: inline
;
--
-- Services to break the curves to the expected continuity
--
-- If for example you need the curve to be C2 and the method
-- Continuity returns you something lower than C2 (say C1 for
-- example).
--
-- First compute the number of intervals with the requested
-- continuity with the method NbIntervals(). Note that if the
-- continuity is higher than the one you need NbIntervals will
-- return 1.
--
-- Then you get the parameters bounding the intervals with the
-- method Intervals, using an array of length at least
-- NbIntervals()+1.
--
-- If you need to create a curve with a restricted span you can
-- use the method Trim().
Continuity(myclass; C: CurveGen) returns Shape from GeomAbs
---Purpose:
---C++: inline
;
NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(myclass) >= <S>
---C++: inline
;
Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
---C++: inline
;
IsClosed(myclass; C: CurveGen) returns Boolean
---C++: inline
;
IsPeriodic(myclass; C: CurveGen) returns Boolean
---C++: inline
;
Period(myclass; C: CurveGen) returns Real
raises
DomainError from Standard -- if the curve is not periodic
---C++: inline
;
Value(myclass; C: CurveGen; U : Real) returns Pnt2d from gp
--- Purpose : Computes the point of parameter U on the curve.
---C++: inline
;
D0 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp)
--- Purpose : Computes the point of parameter U on the curve.
---C++: inline
;
D1 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
--- Purpose : Computes the point of parameter U on the curve with its
-- first derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C1.
---C++: inline
;
D2 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
--- Purpose :
-- Returns the point P of parameter U, the first and second
-- derivatives V1 and V2.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C2.
---C++: inline
;
D3 (myclass; C: CurveGen; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
--- Purpose :
-- Returns the point P of parameter U, the first, the second
-- and the third derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C3.
---C++: inline
;
DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec2d from gp
--- Purpose :
-- The returned vector gives the value of the derivative for the
-- order of derivation N.
raises
DomainError from Standard,
--- Purpose : Raised if the continuity of the current interval
-- is not CN.
OutOfRange from Standard
--- Purpose : Raised if N < 1.
---C++: inline
;
Resolution(myclass; C: CurveGen; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>.
---C++: inline
;
GetType(myclass; C: CurveGen) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
---C++: inline
;
--
-- The following methods must be called when GetType returned
-- the corresponding type.
--
Line(myclass; C: CurveGen) returns Lin2d from gp
raises
NoSuchObject from Standard
---C++: inline
;
Circle(myclass; C: CurveGen) returns Circ2d from gp
raises
NoSuchObject from Standard
---C++: inline
;
Ellipse(myclass; C: CurveGen) returns Elips2d from gp
raises
NoSuchObject from Standard
---C++: inline
;
Hyperbola(myclass; C: CurveGen) returns Hypr2d from gp
raises
NoSuchObject from Standard
---C++: inline
;
Parabola(myclass; C: CurveGen) returns Parab2d from gp
raises
NoSuchObject from Standard
---C++: inline
;
Bezier(myclass; C: CurveGen) returns BezierCurve from Geom2d
raises
NoSuchObject from Standard
---C++: inline
;
BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom2d
raises
NoSuchObject from Standard
---C++: inline
;
NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard)
returns Integer from Standard;
end HCurve2dToolGen;

View File

@@ -0,0 +1,38 @@
// File: BRepBlend_HCurve2dToolGen.gxx
// Created: Mon Jul 17 17:39:39 1995
// Author: Modelistation
// <model@mastox>
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>
#include <Handle_Geom2d_BezierCurve.hxx>
#include <Handle_Geom2d_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
//============================================================
Standard_Integer BRepBlend_HCurve2dToolGen::NbSamples (const CurveGen& C,
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C->Bezier()->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Handle(Geom2d_BSplineCurve) BSC = C->BSpline();
nbs = BSC->NbKnots();
nbs*= BSC->Degree();
nbs*= BSC->LastParameter()- BSC->FirstParameter();
nbs/= U1-U0;
if(nbs < 2.0) nbs=2;
}
if(nbs>50)
nbs = 50;
return((Standard_Integer)nbs);
}

View File

@@ -0,0 +1,154 @@
// File: BRepBlend_HCurve2dToolGen.lxx
// Created: Thu Oct 22 12:14:59 1992
// Author: Laurent BUCHARD
// <lbr@sdsun2>
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Elips2d.hxx>
#include <gp_Parab2d.hxx>
#include <gp_Hypr2d.hxx>
#include <Handle_Geom2d_BezierCurve.hxx>
#include <Handle_Geom2d_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
//============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::FirstParameter (const CurveGen& C) {
return(C->FirstParameter());
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::LastParameter (const CurveGen& C) {
return(C->LastParameter());
}
//============================================================
inline GeomAbs_Shape BRepBlend_HCurve2dToolGen::Continuity (const CurveGen& C) {
return(C->Continuity());
}
//============================================================
inline Standard_Integer BRepBlend_HCurve2dToolGen::NbIntervals(const CurveGen& C,const GeomAbs_Shape Sh) {
return(C->NbIntervals(Sh));
}
//============================================================
inline void BRepBlend_HCurve2dToolGen::Intervals(const CurveGen& C,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh) {
C->Intervals(Tab,Sh);
}
//============================================================
inline Standard_Boolean BRepBlend_HCurve2dToolGen::IsClosed(const CurveGen& C) {
return(C->IsClosed());
}
//============================================================
inline Standard_Boolean BRepBlend_HCurve2dToolGen::IsPeriodic(const CurveGen& C) {
return(C->IsPeriodic());
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::Period(const CurveGen& C) {
return(C->Period());
}
//============================================================
inline gp_Pnt2d BRepBlend_HCurve2dToolGen::Value (const CurveGen& C,
const Standard_Real U) {
return(C->Value(U));
}
//============================================================
inline void BRepBlend_HCurve2dToolGen::D0(const CurveGen& C,
const Standard_Real U,
gp_Pnt2d& P) {
C->D0(U,P);
}
//============================================================
inline void BRepBlend_HCurve2dToolGen::D1 (const CurveGen& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T) {
C->D1(U,P,T);
}
//============================================================
inline void BRepBlend_HCurve2dToolGen::D2 (const CurveGen& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& T,
gp_Vec2d& N) {
C->D2(U,P,T,N);
}
//============================================================
inline void BRepBlend_HCurve2dToolGen::D3 (const CurveGen& C,
const Standard_Real U,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
gp_Vec2d& V3) {
C->D3(U,P,V1,V2,V3);
}
//============================================================
inline gp_Vec2d BRepBlend_HCurve2dToolGen::DN (const CurveGen& C,
const Standard_Real U,
const Standard_Integer N) {
return(C->DN(U,N));
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dToolGen::Resolution(const CurveGen& C,
const Standard_Real R3d) {
return(C->Resolution(R3d));
}
//============================================================
inline GeomAbs_CurveType BRepBlend_HCurve2dToolGen::GetType(const CurveGen& C) {
return(C->GetType());
}
//============================================================
inline gp_Lin2d BRepBlend_HCurve2dToolGen::Line (const CurveGen& C) {
return(C->Line());
}
//============================================================
inline gp_Circ2d BRepBlend_HCurve2dToolGen::Circle (const CurveGen& C) {
return(C->Circle());
}
//============================================================
inline gp_Elips2d BRepBlend_HCurve2dToolGen::Ellipse (const CurveGen& C) {
return(C->Ellipse());
}
//============================================================
inline gp_Parab2d BRepBlend_HCurve2dToolGen::Parabola (const CurveGen& C) {
return(C->Parabola());
}
//============================================================
inline gp_Hypr2d BRepBlend_HCurve2dToolGen::Hyperbola (const CurveGen& C) {
return(C->Hyperbola());
}
//============================================================
inline Handle(Geom2d_BezierCurve) BRepBlend_HCurve2dToolGen::Bezier (const CurveGen& C) {
return(C->Bezier());
}
//============================================================
inline Handle(Geom2d_BSplineCurve) BRepBlend_HCurve2dToolGen::BSpline (const CurveGen& C) {
return(C->BSpline());
}
//============================================================

View File

@@ -0,0 +1,227 @@
-- File: BRepBlend_HCurveToolGen.cdl
-- Created: Mon Jul 17 16:25:23 1995
-- Author: Laurent BUCHARD
-- <lbr@mastox>
---Copyright: Matra Datavision 1995
generic class HCurveToolGen from BRepBlend (
CurveGen as any)
uses
Array1OfReal from TColStd,
Shape from GeomAbs,
CurveType from GeomAbs,
Vec from gp,
Pnt from gp,
Circ from gp,
Elips from gp,
Hypr from gp,
Parab from gp,
Lin from gp,
BezierCurve from Geom,
BSplineCurve from Geom
raises
OutOfRange from Standard,
NoSuchObject from Standard,
DomainError from Standard
is
--
-- Global methods - Apply to the whole curve.
--
FirstParameter(myclass; C: CurveGen) returns Real
---C++: inline
;
LastParameter(myclass; C: CurveGen) returns Real
---C++: inline
;
--
-- Services to break the curves to the expected continuity
--
-- If for example you need the curve to be C2 and the method
-- Continuity returns you something lower than C2 (say C1 for
-- example).
--
-- First compute the number of intervals with the requested
-- continuity with the method NbIntervals(). Note that if the
-- continuity is higher than the one you need NbIntervals will
-- return 1.
--
-- Then you get the parameters bounding the intervals with the
-- method Intervals, using an array of length at least
-- NbIntervals()+1.
--
-- If you need to create a curve with a restricted span you can
-- use the method Trim().
Continuity(myclass; C: CurveGen) returns Shape from GeomAbs
---Purpose:
---C++: inline
;
NbIntervals(myclass; C: CurveGen; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(myclass) >= <S>
---C++: inline
;
Intervals(myclass; C: CurveGen; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard
---C++: inline
;
IsClosed(myclass; C: CurveGen) returns Boolean
---C++: inline
;
IsPeriodic(myclass; C: CurveGen) returns Boolean
---C++: inline
;
Period(myclass; C: CurveGen) returns Real
raises
DomainError from Standard -- if the curve is not periodic
---C++: inline
;
Value(myclass; C: CurveGen; U : Real) returns Pnt from gp
--- Purpose : Computes the point of parameter U on the curve.
---C++: inline
;
D0 (myclass; C: CurveGen; U : Real; P : out Pnt from gp)
--- Purpose : Computes the point of parameter U on the curve.
---C++: inline
;
D1 (myclass; C: CurveGen; U : Real; P : out Pnt from gp ; V : out Vec from gp)
--- Purpose : Computes the point of parameter U on the curve with its
-- first derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C1.
---C++: inline
;
D2 (myclass; C: CurveGen; U : Real; P : out Pnt from gp; V1, V2 : out Vec from gp)
--- Purpose :
-- Returns the point P of parameter U, the first and second
-- derivatives V1 and V2.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C2.
---C++: inline
;
D3 (myclass; C: CurveGen; U : Real; P : out Pnt from gp; V1, V2, V3 : out Vec from gp)
--- Purpose :
-- Returns the point P of parameter U, the first, the second
-- and the third derivative.
raises
DomainError from Standard
--- Purpose : Raised if the continuity of the current interval
-- is not C3.
---C++: inline
;
DN (myclass; C: CurveGen; U : Real; N : Integer) returns Vec from gp
--- Purpose :
-- The returned vector gives the value of the derivative for the
-- order of derivation N.
raises
DomainError from Standard,
--- Purpose : Raised if the continuity of the current interval
-- is not CN.
OutOfRange from Standard
--- Purpose : Raised if N < 1.
---C++: inline
;
Resolution(myclass; C: CurveGen; R3d : Real) returns Real
---Purpose : Returns the parametric resolution corresponding
-- to the real space resolution <R3d>.
---C++: inline
;
GetType(myclass; C: CurveGen) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
---C++: inline
;
--
-- The following methods must be called when GetType returned
-- the corresponding type.
--
Line(myclass; C: CurveGen) returns Lin from gp
raises
NoSuchObject from Standard
---C++: inline
;
Circle(myclass; C: CurveGen) returns Circ from gp
raises
NoSuchObject from Standard
---C++: inline
;
Ellipse(myclass; C: CurveGen) returns Elips from gp
raises
NoSuchObject from Standard
---C++: inline
;
Hyperbola(myclass; C: CurveGen) returns Hypr from gp
raises
NoSuchObject from Standard
---C++: inline
;
Parabola(myclass; C: CurveGen) returns Parab from gp
raises
NoSuchObject from Standard
---C++: inline
;
Bezier(myclass; C: CurveGen) returns BezierCurve from Geom
raises
NoSuchObject from Standard
---C++: inline
;
BSpline(myclass; C: CurveGen) returns BSplineCurve from Geom
raises
NoSuchObject from Standard
---C++: inline
;
NbSamples(myclass; C: CurveGen; U0,U1: Real from Standard)
returns Integer from Standard;
end HCurveToolGen;

View File

@@ -0,0 +1,38 @@
// File: BRepBlend_HCurveToolGen.gxx
// Created: Mon Jul 17 17:39:39 1995
// Author: Modelistation
// <model@mastox>
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>
#include <Handle_Geom_BezierCurve.hxx>
#include <Handle_Geom_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
//============================================================
Standard_Integer BRepBlend_HCurveToolGen::NbSamples (const CurveGen& C,
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C->Bezier()->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Handle(Geom_BSplineCurve) BSC = C->BSpline();
nbs = BSC->NbKnots();
nbs*= BSC->Degree();
nbs*= BSC->LastParameter()- BSC->FirstParameter();
nbs/= U1-U0;
if(nbs < 2.0) nbs=2;
}
if(nbs>50)
nbs = 50;
return((Standard_Integer)nbs);
}

View File

@@ -0,0 +1,154 @@
// File: BRepBlend_HCurveToolGen.lxx
// Created: Thu Oct 22 12:14:59 1992
// Author: Laurent BUCHARD
// <lbr@sdsun2>
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>
#include <gp_Vec.hxx>
#include <gp_Lin.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
#include <gp_Parab.hxx>
#include <gp_Hypr.hxx>
#include <Handle_Geom_BezierCurve.hxx>
#include <Handle_Geom_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
//============================================================
inline Standard_Real BRepBlend_HCurveToolGen::FirstParameter (const CurveGen& C) {
return(C->FirstParameter());
}
//============================================================
inline Standard_Real BRepBlend_HCurveToolGen::LastParameter (const CurveGen& C) {
return(C->LastParameter());
}
//============================================================
inline GeomAbs_Shape BRepBlend_HCurveToolGen::Continuity (const CurveGen& C) {
return(C->Continuity());
}
//============================================================
inline Standard_Integer BRepBlend_HCurveToolGen::NbIntervals(const CurveGen& C,const GeomAbs_Shape Sh) {
return(C->NbIntervals(Sh));
}
//============================================================
inline void BRepBlend_HCurveToolGen::Intervals(const CurveGen& C,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape Sh) {
C->Intervals(Tab,Sh);
}
//============================================================
inline Standard_Boolean BRepBlend_HCurveToolGen::IsClosed(const CurveGen& C) {
return(C->IsClosed());
}
//============================================================
inline Standard_Boolean BRepBlend_HCurveToolGen::IsPeriodic(const CurveGen& C) {
return(C->IsPeriodic());
}
//============================================================
inline Standard_Real BRepBlend_HCurveToolGen::Period(const CurveGen& C) {
return(C->Period());
}
//============================================================
inline gp_Pnt BRepBlend_HCurveToolGen::Value (const CurveGen& C,
const Standard_Real U) {
return(C->Value(U));
}
//============================================================
inline void BRepBlend_HCurveToolGen::D0(const CurveGen& C,
const Standard_Real U,
gp_Pnt& P) {
C->D0(U,P);
}
//============================================================
inline void BRepBlend_HCurveToolGen::D1 (const CurveGen& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T) {
C->D1(U,P,T);
}
//============================================================
inline void BRepBlend_HCurveToolGen::D2 (const CurveGen& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& T,
gp_Vec& N) {
C->D2(U,P,T,N);
}
//============================================================
inline void BRepBlend_HCurveToolGen::D3 (const CurveGen& C,
const Standard_Real U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3) {
C->D3(U,P,V1,V2,V3);
}
//============================================================
inline gp_Vec BRepBlend_HCurveToolGen::DN (const CurveGen& C,
const Standard_Real U,
const Standard_Integer N) {
return(C->DN(U,N));
}
//============================================================
inline Standard_Real BRepBlend_HCurveToolGen::Resolution(const CurveGen& C,
const Standard_Real R3d) {
return(C->Resolution(R3d));
}
//============================================================
inline GeomAbs_CurveType BRepBlend_HCurveToolGen::GetType(const CurveGen& C) {
return(C->GetType());
}
//============================================================
inline gp_Lin BRepBlend_HCurveToolGen::Line (const CurveGen& C) {
return(C->Line());
}
//============================================================
inline gp_Circ BRepBlend_HCurveToolGen::Circle (const CurveGen& C) {
return(C->Circle());
}
//============================================================
inline gp_Elips BRepBlend_HCurveToolGen::Ellipse (const CurveGen& C) {
return(C->Ellipse());
}
//============================================================
inline gp_Parab BRepBlend_HCurveToolGen::Parabola (const CurveGen& C) {
return(C->Parabola());
}
//============================================================
inline gp_Hypr BRepBlend_HCurveToolGen::Hyperbola (const CurveGen& C) {
return(C->Hyperbola());
}
//============================================================
inline Handle(Geom_BezierCurve) BRepBlend_HCurveToolGen::Bezier (const CurveGen& C) {
return(C->Bezier());
}
//============================================================
inline Handle(Geom_BSplineCurve) BRepBlend_HCurveToolGen::BSpline (const CurveGen& C) {
return(C->BSpline());
}
//============================================================

View File

@@ -0,0 +1,336 @@
-- File: BRepBlend_RstRstConstRad.cdl
-- Created: Thu Feb 6 16:22:22 1997
-- Author: Jacques GOUSSARD
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class RstRstConstRad from BRepBlend
inherits RstRstFunction from Blend
---Purpose:
uses Vector from math,
Matrix from math,
Ax1 from gp,
Vec from gp,
Vec2d from gp,
Pnt from gp,
Pnt2d from gp,
Circ from gp,
Array1OfPnt from TColgp,
Array1OfVec from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec2d from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
Shape from GeomAbs,
Point from Blend,
SectionShape from BlendFunc,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
CurveOnSurface from Adaptor3d,
ParameterisationType from Convert,
DecrochStatus from Blend
is
Create(Surf1 : HSurface from Adaptor3d;
Rst1 : HCurve2d from Adaptor2d;
Surf2 : HSurface from Adaptor3d;
Rst2 : HCurve2d from Adaptor2d;
CGuide : HCurve from Adaptor3d)
returns RstRstConstRad from BRepBlend;
NbVariables(me)
---Purpose: Returns 2.
returns Integer from Standard;
NbEquations(me)
---Purpose: Returns 2.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me : in out;
SurfRef1 : HSurface from Adaptor3d;
RstRef1 : HCurve2d from Adaptor2d;
SurfRef2 : HSurface from Adaptor3d;
RstRef2 : HCurve2d from Adaptor2d);
Set(me: in out; Param: Real from Standard);
Set(me: in out; First, Last: Real from Standard);
---Purpose: Sets the bounds of the parametric interval on
-- the guide line.
-- This determines the derivatives in these values if the
-- function is not Cn.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
GetBounds(me; InfBound,SupBound: out Vector from math);
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
returns Boolean from Standard;
GetMinimalDistance(me)
---Purpose: Returns the minimal Distance beetween two
-- extremitys of calculed sections.
returns Real from Standard
is redefined;
--- TheFollowing methods are called only when
-- IsSolution returns Standard_True.
PointOnRst1(me)
---C++: return const&
returns Pnt from gp;
PointOnRst2(me)
---C++: return const&
returns Pnt from gp;
Pnt2dOnRst1(me)
---Purpose: Returns U,V coordinates of the point on the surface.
---C++: return const&
returns Pnt2d from gp;
Pnt2dOnRst2(me)
---Purpose: Returns U,V coordinates of the point on the curve on
-- surface.
---C++: return const&
returns Pnt2d from gp;
ParameterOnRst1(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
ParameterOnRst2(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
IsTangencyPoint(me)
returns Boolean from Standard;
TangentOnRst1(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst1(me)
---C++: return const&
returns Vec2d from gp;
TangentOnRst2(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst2(me)
---C++: return const&
returns Vec2d from gp;
Decroch(me;
Sol : Vector from math;
NRst1, TgRst1 : out Vec from gp;
NRst2, TgRst2 : out Vec from gp)
---Warning: Peut etre appele sans appel prealable a issolution
-- mais les valeurs calculees risquent de ne pas avoir
-- grand sens.
---Purpose: Permet d ' implementer un critere de decrochage
-- specifique a la fonction.
returns DecrochStatus from Blend
is static;
-- methodes hors template (en plus du create)
Set(me : in out;
Radius : Real from Standard;
Choix : Integer from Standard)
is static;
Set(me: in out; TypeSection: SectionShape from BlendFunc)
---Purpose: Sets the type of section generation for the
-- approximations.
is static;
CenterCircleRst1Rst2(me;
PtRst1 : Pnt from gp;
PtRst2 : Pnt from gp;
np : Vec from gp;
Center : out Pnt from gp;
VdMed : out Vec from gp)
---Purpose: Give the center of circle define by PtRst1, PtRst2 and
-- radius ray.
returns Boolean from Standard
is static;
Section(me : in out;
Param : Real from Standard;
U,V : Real from Standard;
Pdeb,Pfin : out Real from Standard;
C : out Circ from gp)
is static;
-- Methods for the approximation
--
IsRational(me) returns Boolean
---Purpose: Returns if the section is rationnal
is static;
GetSectionSize(me) returns Real
---Purpose: Returns the length of the maximum section
is static;
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
---Purpose: Compute the minimal value of weight for each poles
-- of all sections.
is static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
is static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
is static;
GetShape(me : in out;
NbPoles : out Integer from Standard;
NbKnots : out Integer from Standard;
Degree : out Integer from Standard;
NbPoles2d : out Integer from Standard)
is static;
GetTolerance(me;
BoundTol, SurfTol, AngleTol : Real;
Tol3d : out Vector;
Tol1D : out Vector )
---Purpose: Returns the tolerance to reach in approximation
-- to respecte
-- BoundTol error at the Boundary
-- AngleTol tangent error at the Boundary
-- SurfTol error inside the surface.
is static;
Knots(me: in out; TKnots: out Array1OfReal from TColStd)
is static;
Mults(me: in out; TMults: out Array1OfInteger from TColStd)
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
returns Boolean from Standard
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
Weigths : out Array1OfReal from TColStd)
is static;
Section(me: in out; P: Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
D2Poles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
D2Poles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd;
D2Weigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
-- The method returns Standard_True if the derivatives
-- are computed, otherwise it returns Standard_False.
returns Boolean from Standard
is static;
Resolution(me;
IC2d : Integer from Standard;
Tol : Real from Standard;
TolU, TolV : out Real from Standard);
fields
surf1 : HSurface from Adaptor3d;
surf2 : HSurface from Adaptor3d;
rst1 : HCurve2d from Adaptor2d;
rst2 : HCurve2d from Adaptor2d;
cons1 : CurveOnSurface from Adaptor3d;
cons2 : CurveOnSurface from Adaptor3d;
guide : HCurve from Adaptor3d;
tguide : HCurve from Adaptor3d;
ptrst1 : Pnt from gp;
ptrst2 : Pnt from gp;
pt2drst1 : Pnt2d from gp;
pt2drst2 : Pnt2d from gp;
prmrst1 : Real from Standard;
prmrst2 : Real from Standard;
istangent: Boolean from Standard;
tgrst1 : Vec from gp;
tg2drst1 : Vec2d from gp;
tgrst2 : Vec from gp;
tg2drst2 : Vec2d from gp;
ray : Real from Standard;
choix : Integer from Standard;
ptgui : Pnt from gp;
d1gui : Vec from gp;
d2gui : Vec from gp;
nplan : Vec from gp;
normtg : Real from Standard;
theD : Real from Standard;
surfref1 : HSurface from Adaptor3d;
rstref1 : HCurve2d from Adaptor2d;
surfref2 : HSurface from Adaptor3d;
rstref2 : HCurve2d from Adaptor2d;
maxang : Real from Standard;
minang : Real from Standard;
distmin : Real from Standard;
mySShape : SectionShape from BlendFunc;
myTConv : ParameterisationType from Convert;
end RstRstConstRad;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,340 @@
-- File: BRepBlend_RstRstEvolRad.cdl
-- Created: Thu Feb 6 16:22:22 1997
-- Author: Jacques GOUSSARD
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class RstRstEvolRad from BRepBlend
inherits RstRstFunction from Blend
uses Vector from math,
Matrix from math,
Ax1 from gp,
Vec from gp,
Vec2d from gp,
Pnt from gp,
Pnt2d from gp,
Circ from gp,
Array1OfPnt from TColgp,
Array1OfVec from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec2d from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
Shape from GeomAbs,
Point from Blend,
SectionShape from BlendFunc,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
CurveOnSurface from Adaptor3d,
ParameterisationType from Convert,
DecrochStatus from Blend,
Function from Law
is
Create(Surf1 : HSurface from Adaptor3d;
Rst1 : HCurve2d from Adaptor2d;
Surf2 : HSurface from Adaptor3d;
Rst2 : HCurve2d from Adaptor2d;
CGuide : HCurve from Adaptor3d;
Evol : Function from Law)
returns RstRstEvolRad from BRepBlend;
NbVariables(me)
---Purpose: Returns 2.
returns Integer from Standard;
NbEquations(me)
---Purpose: Returns 2.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me : in out;
SurfRef1 : HSurface from Adaptor3d;
RstRef1 : HCurve2d from Adaptor2d;
SurfRef2 : HSurface from Adaptor3d;
RstRef2 : HCurve2d from Adaptor2d);
Set(me: in out; Param: Real from Standard);
Set(me: in out; First, Last: Real from Standard);
---Purpose: Sets the bounds of the parametric interval on
-- the guide line.
-- This determines the derivatives in these values if the
-- function is not Cn.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
GetBounds(me; InfBound,SupBound: out Vector from math);
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
returns Boolean from Standard;
GetMinimalDistance(me)
---Purpose: Returns the minimal Distance beetween two
-- extremitys of calculed sections.
returns Real from Standard
is redefined;
--- TheFollowing methods are called only when
-- IsSolution returns Standard_True.
PointOnRst1(me)
---C++: return const&
returns Pnt from gp;
PointOnRst2(me)
---C++: return const&
returns Pnt from gp;
Pnt2dOnRst1(me)
---Purpose: Returns U,V coordinates of the point on the surface.
---C++: return const&
returns Pnt2d from gp;
Pnt2dOnRst2(me)
---Purpose: Returns U,V coordinates of the point on the curve on
-- surface.
---C++: return const&
returns Pnt2d from gp;
ParameterOnRst1(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
ParameterOnRst2(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
IsTangencyPoint(me)
returns Boolean from Standard;
TangentOnRst1(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst1(me)
---C++: return const&
returns Vec2d from gp;
TangentOnRst2(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst2(me)
---C++: return const&
returns Vec2d from gp;
Decroch(me;
Sol : Vector from math;
NRst1, TgRst1 : out Vec from gp;
NRst2, TgRst2 : out Vec from gp)
---Purpose: Enables implementation of a criterion of decrochage
-- specific to the function.
---Warning: Can be called without previous call of issolution
-- but the calculated values risquent de ne pas avoir
-- grand sens.
returns DecrochStatus from Blend
is static;
-- methodes hors template (en plus du create)
Set(me : in out;
Choix : Integer from Standard)
is static;
Set(me: in out; TypeSection: SectionShape from BlendFunc)
---Purpose: Sets the type of section generation for the
-- approximations.
is static;
CenterCircleRst1Rst2(me;
PtRst1 : Pnt from gp;
PtRst2 : Pnt from gp;
np : Vec from gp;
Center : out Pnt from gp;
VdMed : out Vec from gp)
---Purpose: Gives the center of circle defined by PtRst1, PtRst2 and
-- radius ray.
returns Boolean from Standard
is static;
Section(me : in out;
Param : Real from Standard;
U,V : Real from Standard;
Pdeb,Pfin : out Real from Standard;
C : out Circ from gp)
is static;
-- Methods for the approximation
--
IsRational(me) returns Boolean
---Purpose: Returns if the section is rationnal
is static;
GetSectionSize(me) returns Real
---Purpose: Returns the length of the maximum section
is static;
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
---Purpose: Compute the minimal value of weight for each poles
-- of all sections.
is static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
is static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
is static;
GetShape(me : in out;
NbPoles : out Integer from Standard;
NbKnots : out Integer from Standard;
Degree : out Integer from Standard;
NbPoles2d : out Integer from Standard)
is static;
GetTolerance(me;
BoundTol, SurfTol, AngleTol : Real;
Tol3d : out Vector;
Tol1D : out Vector )
---Purpose: Returns the tolerance to reach in approximation
-- to respecte
-- BoundTol error at the Boundary
-- AngleTol tangent error at the Boundary
-- SurfTol error inside the surface.
is static;
Knots(me: in out; TKnots: out Array1OfReal from TColStd)
is static;
Mults(me: in out; TMults: out Array1OfInteger from TColStd)
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
returns Boolean from Standard
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
Weigths : out Array1OfReal from TColStd)
is static;
Section(me: in out; P: Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
D2Poles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
D2Poles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd;
D2Weigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
-- The method returns Standard_True if the derivatives
-- are computed, otherwise it returns Standard_False.
returns Boolean from Standard
is static;
Resolution(me;
IC2d : Integer from Standard;
Tol : Real from Standard;
TolU, TolV : out Real from Standard);
fields
surf1 : HSurface from Adaptor3d;
surf2 : HSurface from Adaptor3d;
rst1 : HCurve2d from Adaptor2d;
rst2 : HCurve2d from Adaptor2d;
cons1 : CurveOnSurface from Adaptor3d;
cons2 : CurveOnSurface from Adaptor3d;
guide : HCurve from Adaptor3d;
tguide : HCurve from Adaptor3d;
ptrst1 : Pnt from gp;
ptrst2 : Pnt from gp;
pt2drst1 : Pnt2d from gp;
pt2drst2 : Pnt2d from gp;
prmrst1 : Real from Standard;
prmrst2 : Real from Standard;
istangent: Boolean from Standard;
tgrst1 : Vec from gp;
tg2drst1 : Vec2d from gp;
tgrst2 : Vec from gp;
tg2drst2 : Vec2d from gp;
ray : Real from Standard;
dray : Real from Standard;
choix : Integer from Standard;
ptgui : Pnt from gp;
d1gui : Vec from gp;
d2gui : Vec from gp;
nplan : Vec from gp;
normtg : Real from Standard;
theD : Real from Standard;
surfref1 : HSurface from Adaptor3d;
rstref1 : HCurve2d from Adaptor2d;
surfref2 : HSurface from Adaptor3d;
rstref2 : HCurve2d from Adaptor2d;
maxang : Real from Standard;
minang : Real from Standard;
distmin : Real from Standard;
mySShape : SectionShape from BlendFunc;
myTConv : ParameterisationType from Convert;
tevol : Function from Law ;
fevol : Function from Law ;
end RstRstEvolRad;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,255 @@
-- File: BRepBlend_RstRstLineBuilder.cdl
-- Created: Thu Jan 23 16:25:47 1997
-- Author: Jacques GOUSSARD
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class RstRstLineBuilder from BRepBlend
---Purpose: This class processes the data resulting from
-- Blend_CSWalking but it takes in consideration the Surface
-- supporting the curve to detect the breakpoint.
--
-- As a result, the criteria of distribution of
-- points on the line become more flexible because it
-- should calculate values approached
-- by an approximation of continued functions based on the
-- Blend_RstRstFunction.
--
-- Thus this pseudo path necessitates 3 criteria of
-- regrouping :
--
-- 1) exit of the domain of the curve
--
-- 2) exit of the domain of the surface
--
-- 3) stall as there is a solution of problem
-- surf/surf within the domain of the surface
-- of support of the restriction.
uses Point from Blend,
Status from Blend,
DecrochStatus from Blend,
RstRstFunction from Blend,
FuncInv from Blend,
SurfCurvFuncInv from Blend,
CurvPointFuncInv from Blend,
Vector from math,
Matrix from math,
State from TopAbs,
Pnt from gp,
Pnt2d from gp,
Vec from gp,
Vec2d from gp,
HArray1OfReal from TColStd,
Transition from IntSurf,
HVertex from Adaptor3d,
HSurface from Adaptor3d,
HCurve2d from Adaptor2d,
TopolTool from Adaptor3d,
Line from BRepBlend,
Extremity from BRepBlend
is
Create(Surf1 : HSurface from Adaptor3d;
Rst1 : HCurve2d from Adaptor2d;
Domain1 : TopolTool from Adaptor3d;
Surf2 : HSurface from Adaptor3d;
Rst2 : HCurve2d from Adaptor2d;
Domain2 : TopolTool from Adaptor3d)
returns RstRstLineBuilder from BRepBlend;
Perform(me : in out;
Func : in out RstRstFunction from Blend;
Finv1 : in out SurfCurvFuncInv from Blend;
FinvP1 : in out CurvPointFuncInv from Blend;
Finv2 : in out SurfCurvFuncInv from Blend;
FinvP2 : in out CurvPointFuncInv from Blend;
Pdep : Real from Standard;
Pmax : Real from Standard;
MaxStep : Real from Standard;
TolGuide : Real from Standard;
Soldep : Vector from math;
Tolesp : Real from Standard;
Fleche : Real from Standard;
Appro : Boolean from Standard = Standard_False)
is static;
PerformFirstSection(me : in out;
Func : in out RstRstFunction from Blend;
Finv1 : in out SurfCurvFuncInv from Blend;
FinvP1 : in out CurvPointFuncInv from Blend;
Finv2 : in out SurfCurvFuncInv from Blend;
FinvP2 : in out CurvPointFuncInv from Blend;
Pdep : Real from Standard;
Pmax : Real from Standard;
Soldep : Vector from math;
Tolesp : Real from Standard;
TolGuide : Real from Standard;
RecRst1 : Boolean from Standard;
RecP1 : Boolean from Standard;
RecRst2 : Boolean from Standard;
RecP2 : Boolean from Standard;
Psol : out Real from Standard;
ParSol : out Vector from math)
returns Boolean from Standard
is static;
Complete(me : in out;
Func : in out RstRstFunction from Blend;
Finv1 : in out SurfCurvFuncInv from Blend;
FinvP1 : in out CurvPointFuncInv from Blend;
Finv2 : in out SurfCurvFuncInv from Blend;
FinvP2 : in out CurvPointFuncInv from Blend;
Pmin : Real from Standard)
returns Boolean from Standard
is static;
InternalPerform (me : in out;
Func : in out RstRstFunction from Blend;
Finv1 : in out SurfCurvFuncInv from Blend;
FinvP1 : in out CurvPointFuncInv from Blend;
Finv2 : in out SurfCurvFuncInv from Blend;
FinvP2 : in out CurvPointFuncInv from Blend;
Bound : Real from Standard)
is static private;
Recadre1(me : in out;
Func : in out RstRstFunction from Blend;
Finv : in out SurfCurvFuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
Recadre2(me : in out;
Func : in out RstRstFunction from Blend;
Finv : in out SurfCurvFuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
Recadre1(me : in out;
FinvP : in out CurvPointFuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
Recadre2(me : in out;
FinvP : in out CurvPointFuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
IsDone(me)
returns Boolean from Standard
---C++: inline
is static;
Line(me)
returns Line from BRepBlend
---C++: inline
---C++: return const&
is static;
Decroch1Start(me)
returns Boolean from Standard
---C++: inline
is static;
Decroch1End(me)
returns Boolean from Standard
---C++: inline
is static;
Decroch2Start(me)
returns Boolean from Standard
---C++: inline
is static;
Decroch2End(me)
returns Boolean from Standard
---C++: inline
is static;
Transition(me : in out;
OnFirst : Boolean from Standard;
Arc : HCurve2d from Adaptor2d;
Param : Real from Standard;
TLine,TArc : out Transition from IntSurf)
is static private;
MakeExtremity(me : in out;
Extrem : in out Extremity from BRepBlend;
OnFirst : Boolean from Standard;
Arc : HCurve2d from Adaptor2d;
Param : Real from Standard;
IsVtx : Boolean from Standard;
Vtx : HVertex from Adaptor3d)
is static private;
CheckDeflectionOnRst1(me : in out;
CurPoint : Point from Blend)
returns Status from Blend
is static private;
CheckDeflectionOnRst2(me : in out;
CurPoint : Point from Blend)
returns Status from Blend
is static private;
TestArret(me : in out;
Func : in out RstRstFunction from Blend;
TestDeflection : Boolean from Standard;
State : Status from Blend)
returns Status from Blend
is static private;
CheckInside(me : in out;
Func : in out RstRstFunction from Blend;
SituOnC1 : out State from TopAbs;
SituOnC2 : out State from TopAbs;
Decroch : out DecrochStatus from Blend)
returns Boolean from Standard
is static private;
fields
done : Boolean from Standard;
line : Line from BRepBlend;
sol : Vector from math;
surf1 : HSurface from Adaptor3d;
domain1 : TopolTool from Adaptor3d;
surf2 : HSurface from Adaptor3d;
domain2 : TopolTool from Adaptor3d;
rst1 : HCurve2d from Adaptor2d;
rst2 : HCurve2d from Adaptor2d;
tolesp : Real from Standard;
tolgui : Real from Standard;
pasmax : Real from Standard;
fleche : Real from Standard;
param : Real from Standard;
previousP : Point from Blend;
rebrou : Boolean from Standard;
iscomplete : Boolean from Standard;
comptra : Boolean from Standard;
sens : Real from Standard;
decrochdeb : DecrochStatus from Blend;
decrochfin : DecrochStatus from Blend;
end RstRstLineBuilder from BRepBlend;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,81 @@
// File: BRepBlend_RstRstLineBuilder.lxx
// Created: Fri Jan 24 10:47:10 1997
// Author: Laurent BOURESCHE
// <lbo@pomalox.paris1.matra-dtv.fr>
#include <StdFail_NotDone.hxx>
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_RstRstLineBuilder::IsDone() const
{
return done;
}
//=======================================================================
//function : Line
//purpose :
//=======================================================================
inline const Handle(BRepBlend_Line)& BRepBlend_RstRstLineBuilder::Line() const
{
if (!done) {StdFail_NotDone::Raise();}
return line;
}
//=======================================================================
//function : Decroch1Start
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_RstRstLineBuilder::Decroch1Start() const
{
if (decrochdeb == Blend_DecrochRst1
|| decrochdeb == Blend_DecrochBoth) return Standard_True;
return Standard_False;
}
//=======================================================================
//function : Decroch1End
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_RstRstLineBuilder::Decroch1End() const
{
if (decrochfin == Blend_DecrochRst1
|| decrochfin == Blend_DecrochBoth) return Standard_True;
return Standard_False;
}
//=======================================================================
//function : Decroch2Start
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_RstRstLineBuilder::Decroch2Start() const
{
if (decrochdeb == Blend_DecrochRst2
|| decrochdeb == Blend_DecrochBoth) return Standard_True;
return Standard_False;
}
//=======================================================================
//function : Decroch2End
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_RstRstLineBuilder::Decroch2End() const
{
if (decrochfin == Blend_DecrochRst2
|| decrochfin == Blend_DecrochBoth) return Standard_True;
return Standard_False;
}

View File

@@ -0,0 +1,95 @@
-- File: BRepBlend_SurfCurvConstRadInv.cdl
-- Created: Fri Feb 21 14:22:11 1997
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class SurfCurvConstRadInv from BRepBlend
inherits SurfCurvFuncInv from Blend
---Purpose: Class used to compute a solution of the
-- surfRstConstRad problem on a done restriction of the
-- surface.
-- The vector <X> used in Value, Values and Derivatives
-- methods has to be the vector of the parametric
-- coordinates wguide, wcurv, wrst where wguide is the
-- parameter on the guide line, wcurv is the parameter on
-- the curve, wrst is the parameter on the restriction on
-- the surface.
uses
HCurve2d from Adaptor2d,
HCurve from Adaptor3d,
HSurface from Adaptor3d,
Vector from math,
Matrix from math
is
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d;
Cg : HCurve from Adaptor3d)
returns SurfCurvConstRadInv from BRepBlend;
Set(me: in out; R: Real from Standard; Choix: Integer from Standard)
is static;
NbEquations(me)
---Purpose: returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me: in out; Rst : HCurve2d from Adaptor2d);
---Purpose: Set the restriction on which a solution has to be found.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
---Purpose: Returns in the vector Tolerance the parametric tolerance
-- for each of the 3 variables;
-- Tol is the tolerance used in 3d space.
GetBounds(me; InfBound,SupBound: out Vector from math);
---Purpose: Returns in the vector InfBound the lowest values allowed
-- for each of the 3 variables.
-- Returns in the vector SupBound the greatest values allowed
-- for each of the 3 variables.
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
---Purpose: Returns Standard_True if Sol is a zero of the function.
-- Tol is the tolerance used in 3d space.
returns Boolean from Standard;
fields
surf : HSurface from Adaptor3d;
curv : HCurve from Adaptor3d;
guide : HCurve from Adaptor3d;
rst : HCurve2d from Adaptor2d;
ray : Real from Standard;
choix : Integer from Standard;
end SurfCurvConstRadInv;

View File

@@ -0,0 +1,316 @@
// File: BRepBlend_SurfCurvConstRadInv.cxx
// Created: Fri Feb 21 14:21:35 1997
// Author: Laurent BOURESCHE
// <lbo@pomalox.paris1.matra-dtv.fr>
#include <BRepBlend_SurfCurvConstRadInv.ixx>
//=======================================================================
//function : BRepBlend_SurfCurvConstRadInv
//purpose :
//=======================================================================
BRepBlend_SurfCurvConstRadInv::BRepBlend_SurfCurvConstRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C,
const Handle(Adaptor3d_HCurve)& Cg) : surf(S),curv(C),guide(Cg)
{
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_SurfCurvConstRadInv::Set(const Standard_Real R,
const Standard_Integer Choix)
{
choix = Choix;
switch (choix) {
case 1:
case 2:
{
ray = -Abs(R);
}
break;
case 3:
case 4:
{
ray = Abs(R);
}
break;
default:
{
ray = -Abs(R);
}
}
}
//=======================================================================
//function : NbEquations
//purpose :
//=======================================================================
Standard_Integer BRepBlend_SurfCurvConstRadInv::NbEquations() const
{
return 3;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvConstRadInv::Value(const math_Vector& X,
math_Vector& F)
{
gp_Pnt ptgui;
gp_Vec d1gui;
guide->D1(X(1),ptgui,d1gui);
gp_Vec nplan = d1gui.Normalized();
Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
gp_Pnt ptcur = curv->Value(X(2));
F(1) = nplan.XYZ().Dot(ptcur.XYZ()) + theD;
gp_Pnt2d p2drst = rst->Value(X(3));
gp_Pnt pts;
gp_Vec du,dv;
surf->D1(p2drst.X(),p2drst.Y(),pts,du,dv);
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
gp_Vec ns = du.Crossed(dv);
Standard_Real norm = nplan.Crossed(ns).Magnitude();
Standard_Real unsurnorm = 1./norm;
ns.SetLinearForm(nplan.Dot(ns),nplan, -1.,ns);
ns.Multiply(unsurnorm);
gp_Vec ref(ptcur,pts);
ref.SetLinearForm(ray,ns,ref);
F(3) = ref.SquareMagnitude() - ray*ray;
return Standard_True;
}
//=======================================================================
//function : Derivatives
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvConstRadInv::Derivatives(const math_Vector& X,
math_Matrix& D)
{
gp_Pnt ptgui;
gp_Vec d1gui,d2gui;
guide->D2(X(1),ptgui,d1gui,d2gui);
Standard_Real normd1gui = d1gui.Magnitude();
Standard_Real unsurnormd1gui = 1./normd1gui;
gp_Vec nplan = d1gui.Multiplied(unsurnormd1gui);
#ifdef DEB
Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
#endif
gp_Vec dnplan;
dnplan.SetLinearForm(-nplan.Dot(d2gui),nplan,d2gui);
dnplan.Multiply(unsurnormd1gui);
Standard_Real dtheD = - nplan.XYZ().Dot(d1gui.XYZ()) - dnplan.XYZ().Dot(ptgui.XYZ());
gp_Pnt ptcur;
gp_Vec d1cur;
curv->D1(X(2),ptcur,d1cur);
D(1,1) = dnplan.XYZ().Dot(ptcur.XYZ()) + dtheD;
D(1,2) = nplan.XYZ().Dot(d1cur.XYZ());
D(1,3) = 0.;
gp_Pnt2d p2drst;
gp_Vec2d d1rst;
rst->D1(X(3),p2drst,d1rst);
gp_Pnt pts;
gp_Vec d1u,d1v,d2u,d2v,duv;
surf->D2(p2drst.X(),p2drst.Y(),pts,d1u,d1v,d2u,d2v,duv);
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = 0.;
gp_Vec dwrstpts;
dwrstpts.SetLinearForm(d1rst.X(),d1u,d1rst.Y(),d1v);
D(2,3) = nplan.XYZ().Dot(dwrstpts.XYZ());
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec dwrstnsurf;
dwrstnsurf.SetLinearForm(d1rst.X(),dunsurf,d1rst.Y(),dvnsurf);
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwguinplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dwrstnplancrosnsurf = nplan.Crossed(dwrstnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwguinorm = unsurnorm*nplancrosnsurf.Dot(dwguinplancrosnsurf);
Standard_Real dwrstnorm = unsurnorm*nplancrosnsurf.Dot(dwrstnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwguinplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dwrstnplandotnsurf = nplan.Dot(dwrstnsurf);
gp_Vec temp,dwguitemp,dwrsttemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwguitemp.SetLinearForm(nplandotnsurf,dnplan,dwguinplandotnsurf,nplan);
dwrsttemp.SetLinearForm(dwrstnplandotnsurf,nplan,-1.,dwrstnsurf);
gp_Vec corde(ptcur,pts);
gp_Vec ref,dwguiref,dwrstref;
ref.SetLinearForm(raysurnorm,temp,corde);
dwguiref.SetLinearForm(raysurnorm,dwguitemp,-raysurnorm2*dwguinorm,temp);
dwrstref.SetLinearForm(raysurnorm,dwrsttemp,-raysurnorm2*dwrstnorm,temp,dwrstpts);
ref.Add(ref);
D(3,1) = ref.Dot(dwguiref);
D(3,2) = -ref.Dot(d1cur);
D(3,3) = ref.Dot(dwrstref);
return Standard_True;
}
//=======================================================================
//function : Values
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvConstRadInv::Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D)
{
gp_Pnt ptgui;
gp_Vec d1gui(0.,0.,0.),d2gui(0.,0.,0.);
guide->D2(X(1),ptgui,d1gui,d2gui);
Standard_Real normd1gui = d1gui.Magnitude();
Standard_Real unsurnormd1gui = 1./normd1gui;
gp_Vec nplan = d1gui.Multiplied(unsurnormd1gui);
Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
gp_Vec dnplan;
dnplan.SetLinearForm(-nplan.Dot(d2gui),nplan,d2gui);
dnplan.Multiply(unsurnormd1gui);
Standard_Real dtheD = - nplan.XYZ().Dot(d1gui.XYZ()) - dnplan.XYZ().Dot(ptgui.XYZ());
gp_Pnt ptcur;
gp_Vec d1cur;
curv->D1(X(2),ptcur,d1cur);
F(1) = nplan.XYZ().Dot(ptcur.XYZ()) + theD;
D(1,1) = dnplan.XYZ().Dot(ptcur.XYZ()) + dtheD;
D(1,2) = nplan.XYZ().Dot(d1cur.XYZ());
D(1,3) = 0.;
gp_Pnt2d p2drst;
gp_Vec2d d1rst;
rst->D1(X(3),p2drst,d1rst);
gp_Pnt pts;
gp_Vec d1u,d1v,d2u,d2v,duv;
surf->D2(p2drst.X(),p2drst.Y(),pts,d1u,d1v,d2u,d2v,duv);
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = 0.;
gp_Vec dwrstpts;
dwrstpts.SetLinearForm(d1rst.X(),d1u,d1rst.Y(),d1v);
D(2,3) = nplan.XYZ().Dot(dwrstpts.XYZ());
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec dwrstnsurf;
dwrstnsurf.SetLinearForm(d1rst.X(),dunsurf,d1rst.Y(),dvnsurf);
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwguinplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dwrstnplancrosnsurf = nplan.Crossed(dwrstnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwguinorm = unsurnorm*nplancrosnsurf.Dot(dwguinplancrosnsurf);
Standard_Real dwrstnorm = unsurnorm*nplancrosnsurf.Dot(dwrstnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwguinplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dwrstnplandotnsurf = nplan.Dot(dwrstnsurf);
gp_Vec temp,dwguitemp,dwrsttemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwguitemp.SetLinearForm(nplandotnsurf,dnplan,dwguinplandotnsurf,nplan);
dwrsttemp.SetLinearForm(dwrstnplandotnsurf,nplan,-1.,dwrstnsurf);
gp_Vec corde(ptcur,pts);
gp_Vec ref,dwguiref,dwrstref;
ref.SetLinearForm(raysurnorm,temp,corde);
F(3) = ref.SquareMagnitude() - ray*ray;
dwguiref.SetLinearForm(raysurnorm,dwguitemp,-raysurnorm2*dwguinorm,temp);
dwrstref.SetLinearForm(raysurnorm,dwrsttemp,-raysurnorm2*dwrstnorm,temp,dwrstpts);
ref.Add(ref);
D(3,1) = ref.Dot(dwguiref);
D(3,2) = -ref.Dot(d1cur);
D(3,3) = ref.Dot(dwrstref);
return Standard_True;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_SurfCurvConstRadInv::Set(const Handle(Adaptor2d_HCurve2d)& Rst)
{
rst = Rst;
}
//=======================================================================
//function : GetTolerance
//purpose :
//=======================================================================
void BRepBlend_SurfCurvConstRadInv::GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const
{
Tolerance(1) = guide->Resolution(Tol);
Tolerance(2) = curv->Resolution(Tol);
Standard_Real ru,rv;
ru = surf->UResolution(Tol);
rv = surf->VResolution(Tol);
Tolerance(3) = rst->Resolution(Min(ru,rv));
}
//=======================================================================
//function : GetBounds
//purpose :
//=======================================================================
void BRepBlend_SurfCurvConstRadInv::GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const
{
InfBound(1) = guide->FirstParameter();
SupBound(1) = guide->LastParameter();
InfBound(2) = curv->FirstParameter();
SupBound(2) = curv->LastParameter();
InfBound(3) = rst->FirstParameter();
SupBound(3) = rst->LastParameter();
}
//=======================================================================
//function : IsSolution
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvConstRadInv::IsSolution(const math_Vector& Sol,
const Standard_Real Tol)
{
math_Vector valsol(1,3);
Value(Sol,valsol);
if (Abs(valsol(1)) <= Tol &&
Abs(valsol(2)) <= Tol &&
Abs(valsol(3)) <= 2*Tol*Abs(ray) ) {
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,99 @@
-- File: BRepBlend_SurfCurvEvolRadInv.cdl
-- Created: Tue Jul 29 12:04:39 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
---Copyright: Matra Datavision 1997
class SurfCurvEvolRadInv from BRepBlend
inherits SurfCurvFuncInv from Blend
---Purpose: Class used to compute a solution of the
-- surfRstConstRad problem on a done restriction of the
-- surface.
-- The vector <X> used in Value, Values and Derivatives
-- methods has to be the vector of the parametric
-- coordinates wguide, wcurv, wrst where wguide is the
-- parameter on the guide line, wcurv is the parameter on
-- the curve, wrst is the parameter on the restriction on
-- the surface.
uses
HCurve2d from Adaptor2d,
HCurve from Adaptor3d,
HSurface from Adaptor3d,
Vector from math,
Matrix from math,
Function from Law
is
Create(S : HSurface from Adaptor3d;
C : HCurve from Adaptor3d;
Cg : HCurve from Adaptor3d;
Evol : Function from Law)
returns SurfCurvEvolRadInv from BRepBlend;
Set(me: in out;Choix: Integer from Standard)
is static;
NbEquations(me)
---Purpose: returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me: in out; Rst : HCurve2d from Adaptor2d);
---Purpose: Set the restriction on which a solution has to be found.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
---Purpose: Returns in the vector Tolerance the parametric tolerance
-- for each of the 3 variables;
-- Tol is the tolerance used in 3d space.
GetBounds(me; InfBound,SupBound: out Vector from math);
---Purpose: Returns in the vector InfBound the lowest values allowed
-- for each of the 3 variables.
-- Returns in the vector SupBound the greatest values allowed
-- for each of the 3 variables.
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
---Purpose: Returns Standard_True if Sol is a zero of the function.
-- Tol is the tolerance used in 3d space.
returns Boolean from Standard;
fields
surf : HSurface from Adaptor3d;
curv : HCurve from Adaptor3d;
guide : HCurve from Adaptor3d;
rst : HCurve2d from Adaptor2d;
ray : Real from Standard;
choix : Integer from Standard;
tevol : Function from Law;
sg1 : Real from Standard;
end SurfCurvEvolRadInv;

View File

@@ -0,0 +1,314 @@
// File: BRepBlend_SurfCurvEvolRadInv.cxx
// Created: Tue Jul 29 12:13:34 1997
// Author: Jerome LEMONIER
// <jlr@sgi64>
#include <BRepBlend_SurfCurvEvolRadInv.ixx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BRepBlend_SurfCurvEvolRadInv::BRepBlend_SurfCurvEvolRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C,
const Handle(Adaptor3d_HCurve)& Cg,
const Handle(Law_Function)& Evol): surf(S),curv(C),guide(Cg)
{ tevol=Evol;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfCurvEvolRadInv::Set(const Standard_Integer Choix)
{ choix = Choix;
switch (choix) {
case 1 :
case 2 :
sg1 = -1;
break;
case 3 :
case 4 :
sg1 = 1;
break;
default :
sg1 = -1;
break;
}
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Integer BRepBlend_SurfCurvEvolRadInv::NbEquations() const
{
return 3;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvEvolRadInv::Value(const math_Vector& X,math_Vector& F)
{
gp_Pnt ptgui;
gp_Vec d1gui(0.,0.,0.);
guide->D1(X(1),ptgui,d1gui);
ray = sg1*tevol->Value(X(1));
gp_Vec nplan = d1gui.Normalized();
// Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
gp_XYZ nplanXYZ(nplan.XYZ());
gp_XYZ ptguiXYZ(ptgui.XYZ());
Standard_Real theD = nplanXYZ.Dot(ptguiXYZ) ;
theD = theD * (-1.) ;
gp_Pnt ptcur = curv->Value(X(2));
F(1) = nplan.XYZ().Dot(ptcur.XYZ()) + theD;
gp_Pnt2d p2drst = rst->Value(X(3));
gp_Pnt pts;
gp_Vec du,dv;
surf->D1(p2drst.X(),p2drst.Y(),pts,du,dv);
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
gp_Vec ns = du.Crossed(dv);
Standard_Real norm = nplan.Crossed(ns).Magnitude();
Standard_Real unsurnorm = 1./norm;
ns.SetLinearForm(nplan.Dot(ns),nplan, -1.,ns);
ns.Multiply(unsurnorm);
gp_Vec ref(ptcur,pts);
ref.SetLinearForm(ray,ns,ref);
F(3) = ref.SquareMagnitude() - ray*ray;
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvEvolRadInv::Derivatives(const math_Vector& X,math_Matrix& D)
{
gp_Pnt ptgui;
gp_Vec d1gui,d2gui;
guide->D2(X(1),ptgui,d1gui,d2gui);
Standard_Real normd1gui = d1gui.Magnitude(),dray;
Standard_Real unsurnormd1gui = 1./normd1gui;
tevol->D1(X(1),ray,dray);
ray=sg1*ray;
dray=sg1*dray;
gp_Vec nplan = d1gui.Multiplied(unsurnormd1gui);
#ifdef DEB
Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
#endif
gp_Vec dnplan;
dnplan.SetLinearForm(-nplan.Dot(d2gui),nplan,d2gui);
dnplan.Multiply(unsurnormd1gui);
Standard_Real dtheD = - nplan.XYZ().Dot(d1gui.XYZ()) - dnplan.XYZ().Dot(ptgui.XYZ());
gp_Pnt ptcur;
gp_Vec d1cur;
curv->D1(X(2),ptcur,d1cur);
D(1,1) = dnplan.XYZ().Dot(ptcur.XYZ()) + dtheD;
D(1,2) = nplan.XYZ().Dot(d1cur.XYZ());
D(1,3) = 0.;
gp_Pnt2d p2drst;
gp_Vec2d d1rst;
rst->D1(X(3),p2drst,d1rst);
gp_Pnt pts;
gp_Vec d1u,d1v,d2u,d2v,duv;
surf->D2(p2drst.X(),p2drst.Y(),pts,d1u,d1v,d2u,d2v,duv);
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = 0.;
gp_Vec dwrstpts;
dwrstpts.SetLinearForm(d1rst.X(),d1u,d1rst.Y(),d1v);
D(2,3) = nplan.XYZ().Dot(dwrstpts.XYZ());
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec dwrstnsurf;
dwrstnsurf.SetLinearForm(d1rst.X(),dunsurf,d1rst.Y(),dvnsurf);
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwguinplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dwrstnplancrosnsurf = nplan.Crossed(dwrstnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwguinorm = unsurnorm*nplancrosnsurf.Dot(dwguinplancrosnsurf);
Standard_Real dwrstnorm = unsurnorm*nplancrosnsurf.Dot(dwrstnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwguinplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dwrstnplandotnsurf = nplan.Dot(dwrstnsurf);
gp_Vec temp,dwguitemp,dwrsttemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwguitemp.SetLinearForm(nplandotnsurf,dnplan,dwguinplandotnsurf,nplan);
dwrsttemp.SetLinearForm(dwrstnplandotnsurf,nplan,-1.,dwrstnsurf);
gp_Vec corde(ptcur,pts);
gp_Vec ref,dwguiref,dwrstref;
ref.SetLinearForm(raysurnorm,temp,corde);
dwguiref.SetLinearForm(raysurnorm,dwguitemp,-raysurnorm2*dwguinorm,temp);
dwguiref.SetLinearForm(1.,dwguiref,dray*unsurnorm,temp);
dwrstref.SetLinearForm(raysurnorm,dwrsttemp,-raysurnorm2*dwrstnorm,temp,dwrstpts);
ref.Add(ref);
D(3,1) = ref.Dot(dwguiref) - 2.*dray*ray;
D(3,2) = -ref.Dot(d1cur);
D(3,3) = ref.Dot(dwrstref);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvEvolRadInv::Values(const math_Vector& X,math_Vector& F,math_Matrix& D)
{
gp_Pnt ptgui;
gp_Vec d1gui(0.,0.,0.),d2gui(0.,0.,0.);
guide->D2(X(1),ptgui,d1gui,d2gui);
Standard_Real dray;
tevol->D1(X(1),ray,dray);
ray=sg1*ray;
dray=sg1*dray;
Standard_Real normd1gui = d1gui.Magnitude();
Standard_Real unsurnormd1gui = 1./normd1gui;
gp_Vec nplan = d1gui.Multiplied(unsurnormd1gui);
// Standard_Real theD = -(nplan.XYZ().Dot(ptgui.XYZ()));
gp_XYZ nplanXYZ(nplan.XYZ());
gp_XYZ ptcurXYZ(ptgui.XYZ());
Standard_Real theD = nplanXYZ.Dot(ptcurXYZ) ;
theD = theD * (-1.) ;
gp_Vec dnplan;
dnplan.SetLinearForm(-nplan.Dot(d2gui),nplan,d2gui);
dnplan.Multiply(unsurnormd1gui);
Standard_Real dtheD = - nplan.XYZ().Dot(d1gui.XYZ()) - dnplan.XYZ().Dot(ptgui.XYZ());
gp_Pnt ptcur;
gp_Vec d1cur;
curv->D1(X(2),ptcur,d1cur);
F(1) = nplan.XYZ().Dot(ptcur.XYZ()) + theD;
D(1,1) = dnplan.XYZ().Dot(ptcur.XYZ()) + dtheD;
D(1,2) = nplan.XYZ().Dot(d1cur.XYZ());
D(1,3) = 0.;
gp_Pnt2d p2drst;
gp_Vec2d d1rst;
rst->D1(X(3),p2drst,d1rst);
gp_Pnt pts;
gp_Vec d1u,d1v,d2u,d2v,duv;
surf->D2(p2drst.X(),p2drst.Y(),pts,d1u,d1v,d2u,d2v,duv);
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = 0.;
gp_Vec dwrstpts;
dwrstpts.SetLinearForm(d1rst.X(),d1u,d1rst.Y(),d1v);
D(2,3) = nplan.XYZ().Dot(dwrstpts.XYZ());
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec dwrstnsurf;
dwrstnsurf.SetLinearForm(d1rst.X(),dunsurf,d1rst.Y(),dvnsurf);
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwguinplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dwrstnplancrosnsurf = nplan.Crossed(dwrstnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwguinorm = unsurnorm*nplancrosnsurf.Dot(dwguinplancrosnsurf);
Standard_Real dwrstnorm = unsurnorm*nplancrosnsurf.Dot(dwrstnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwguinplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dwrstnplandotnsurf = nplan.Dot(dwrstnsurf);
gp_Vec temp,dwguitemp,dwrsttemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwguitemp.SetLinearForm(nplandotnsurf,dnplan,dwguinplandotnsurf,nplan);
dwrsttemp.SetLinearForm(dwrstnplandotnsurf,nplan,-1.,dwrstnsurf);
gp_Vec corde(ptcur,pts);
gp_Vec ref,dwguiref,dwrstref;
ref.SetLinearForm(raysurnorm,temp,corde);
F(3) = ref.SquareMagnitude() - ray*ray;
dwguiref.SetLinearForm(raysurnorm,dwguitemp,-raysurnorm2*dwguinorm,temp);
dwguiref.SetLinearForm(1.,dwguiref,dray*unsurnorm,temp);
dwrstref.SetLinearForm(raysurnorm,dwrsttemp,-raysurnorm2*dwrstnorm,temp,dwrstpts);
ref.Add(ref);
D(3,1) = ref.Dot(dwguiref) - 2.*dray*ray;
D(3,2) = -ref.Dot(d1cur);
D(3,3) = ref.Dot(dwrstref);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfCurvEvolRadInv::Set(const Handle(Adaptor2d_HCurve2d)& Rst)
{
rst = Rst;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfCurvEvolRadInv::GetTolerance(math_Vector& Tolerance,const Standard_Real Tol) const
{
Tolerance(1) = guide->Resolution(Tol);
Tolerance(2) = curv->Resolution(Tol);
Standard_Real ru,rv;
ru = surf->UResolution(Tol);
rv = surf->VResolution(Tol);
Tolerance(3) = rst->Resolution(Min(ru,rv));
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfCurvEvolRadInv::GetBounds(math_Vector& InfBound,math_Vector& SupBound) const
{
InfBound(1) = guide->FirstParameter();
SupBound(1) = guide->LastParameter();
InfBound(2) = curv->FirstParameter();
SupBound(2) = curv->LastParameter();
InfBound(3) = rst->FirstParameter();
SupBound(3) = rst->LastParameter();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfCurvEvolRadInv::IsSolution(const math_Vector& Sol,const Standard_Real Tol)
{
math_Vector valsol(1,3);
Value(Sol,valsol);
if (Abs(valsol(1)) <= Tol &&
Abs(valsol(2)) <= Tol &&
Abs(valsol(3)) <= 2*Tol*Abs(ray)) {
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,87 @@
-- File: BRepBlend_SurfPointConsRadInv.cdl
-- Created: Wed Feb 12 14:27:39 1997
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class SurfPointConstRadInv from BRepBlend
inherits SurfPointFuncInv from Blend
---Purpose: This function is used to find a solution on a done
-- point of the curve when using SurfRstConsRad or
-- CSConstRad...
-- The vector <X> used in Value, Values and Derivatives
-- methods has to be the vector of the parametric
-- coordinates w, U, V where w is the parameter on the
-- guide line, U,V are the parametric coordinates of a
-- point on the partner surface.
uses
Pnt from gp,
Vector from math,
Matrix from math,
HSurface from Adaptor3d,
HCurve from Adaptor3d
is
Create(S : HSurface from Adaptor3d; C : HCurve from Adaptor3d)
returns SurfPointConstRadInv from BRepBlend;
Set(me: in out; R: Real from Standard; Choix: Integer from Standard)
is static;
NbEquations(me)
---Purpose: returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me: in out; P : Pnt from gp);
---Purpose: Set the Point on which a solution has to be found.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
---Purpose: Returns in the vector Tolerance the parametric tolerance
-- for each of the 3 variables;
-- Tol is the tolerance used in 3d space.
GetBounds(me; InfBound,SupBound: out Vector from math);
---Purpose: Returns in the vector InfBound the lowest values allowed
-- for each of the 3 variables.
-- Returns in the vector SupBound the greatest values allowed
-- for each of the 3 variables.
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
---Purpose: Returns Standard_True if Sol is a zero of the function.
-- Tol is the tolerance used in 3d space.
returns Boolean from Standard;
fields
surf : HSurface from Adaptor3d;
curv : HCurve from Adaptor3d;
point : Pnt from gp;
ray : Real from Standard;
choix : Integer from Standard;
end SurfPointConstRadInv;

View File

@@ -0,0 +1,306 @@
// File: BRepBlend_SurfPointConstRadInv.cxx
// Created: Wed Feb 12 14:55:06 1997
// Author: Laurent BOURESCHE
// <lbo@pomalox.paris1.matra-dtv.fr>
#include <BRepBlend_SurfPointConstRadInv.ixx>
//=======================================================================
//function : BRepBlend_SurfPointConstRadInv
//purpose :
//=======================================================================
BRepBlend_SurfPointConstRadInv::BRepBlend_SurfPointConstRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C) : surf(S), curv(C)
{
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_SurfPointConstRadInv::Set(const Standard_Real R,
const Standard_Integer Choix)
{
choix = Choix;
switch (choix) {
case 1:
case 2:
{
ray = -Abs(R);
}
break;
case 3:
case 4:
{
ray = Abs(R);
}
break;
default:
{
ray = -Abs(R);
}
}
}
//=======================================================================
//function : NbEquations
//purpose :
//=======================================================================
Standard_Integer BRepBlend_SurfPointConstRadInv::NbEquations() const
{
return 3;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointConstRadInv::Value(const math_Vector& X,
math_Vector& F)
{
Standard_Real theD,norm,unsurnorm;
gp_Pnt ptcur,pts;
gp_Vec d1cur(0.,0.,0.),d1u(0.,0.,0.),d1v(0.,0.,0.);
gp_XYZ nplan(0.,0.,0.),ns(0.,0.,0.),ref(0.,0.,0.);
curv->D1(X(1),ptcur,d1cur);
nplan = d1cur.Normalized().XYZ();
// theD = -(nplan.Dot(ptcur.XYZ()));
gp_XYZ ptcurXYZ(ptcur.XYZ());
theD = nplan.Dot(ptcurXYZ) ;
theD = theD * (-1.) ;
surf->D1(X(2),X(3),pts,d1u,d1v);
F(1) = nplan.Dot(point.XYZ()) + theD;
F(2) = nplan.Dot(pts.XYZ()) + theD;
ns = d1u.Crossed(d1v).XYZ();
norm = nplan.Crossed(ns).Modulus();
unsurnorm = 1./norm;
ns.SetLinearForm(nplan.Dot(ns),nplan, -1.,ns);
ns.Multiply(unsurnorm);
ref = pts.XYZ() - point.XYZ();
ref.SetLinearForm(ray,ns,ref);
F(3) = ref.SquareModulus() - ray*ray;
return Standard_True;
}
//=======================================================================
//function : Derivatives
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointConstRadInv::Derivatives(const math_Vector& X,
math_Matrix& D)
{
gp_Pnt ptcur,pts;
gp_Vec d1cur,d2cur,nplan,dnplan,d1u,d1v,d2u,d2v,duv;
Standard_Real theD, dtheD, normd1cur, unsurnormd1cur;
curv->D2(X(1),ptcur,d1cur,d2cur);
normd1cur = d1cur.Magnitude();
unsurnormd1cur = 1./normd1cur;
nplan = unsurnormd1cur * d1cur;
// theD = -(nplan.XYZ().Dot(ptcur.XYZ()));
gp_XYZ nplanXYZ(nplan.XYZ());
gp_XYZ ptcurXYZ(ptcur.XYZ());
theD = nplanXYZ.Dot(ptcurXYZ) ;
theD = theD * (-1.) ;
dnplan.SetLinearForm(-nplan.Dot(d2cur),nplan,d2cur);
dnplan.Multiply(unsurnormd1cur);
dtheD = - nplan.XYZ().Dot(d1cur.XYZ()) - dnplan.XYZ().Dot(ptcur.XYZ());
D(1,1) = dnplan.XYZ().Dot(point.XYZ()) + dtheD;
D(1,2) = D(1,3) = 0.;
surf->D2(X(2),X(3),pts,d1u,d1v,d2u,d2v,duv);
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = nplan.Dot(d1u);
D(2,3) = nplan.Dot(d1v);
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwnplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dunplancrosnsurf = nplan.Crossed(dunsurf);
gp_Vec dvnplancrosnsurf = nplan.Crossed(dvnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwnorm = unsurnorm*nplancrosnsurf.Dot(dwnplancrosnsurf);
Standard_Real dunorm = unsurnorm*nplancrosnsurf.Dot(dunplancrosnsurf);
Standard_Real dvnorm = unsurnorm*nplancrosnsurf.Dot(dvnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwnplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dunplandotnsurf = nplan.Dot(dunsurf);
Standard_Real dvnplandotnsurf = nplan.Dot(dvnsurf);
gp_Vec temp,dwtemp,dutemp,dvtemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwtemp.SetLinearForm(nplandotnsurf,dnplan,dwnplandotnsurf,nplan);
dutemp.SetLinearForm(dunplandotnsurf,nplan,-1.,dunsurf);
dvtemp.SetLinearForm(dvnplandotnsurf,nplan,-1.,dvnsurf);
gp_Vec ref,dwref,duref,dvref,corde(point,pts);
ref.SetLinearForm(raysurnorm,temp,corde);
dwref.SetLinearForm(raysurnorm,dwtemp,-raysurnorm2*dwnorm,temp);
duref.SetLinearForm(raysurnorm,dutemp,-raysurnorm2*dunorm,temp,d1u);
dvref.SetLinearForm(raysurnorm,dvtemp,-raysurnorm2*dvnorm,temp,d1v);
ref.Add(ref);
D(3,1) = ref.Dot(dwref);
D(3,2) = ref.Dot(duref);
D(3,3) = ref.Dot(dvref);
return Standard_True;
}
//=======================================================================
//function : Values
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointConstRadInv::Values(const math_Vector& X,
math_Vector& F,
math_Matrix& D)
{
gp_Pnt ptcur,pts;
gp_Vec d1cur,d2cur,nplan,dnplan,d1u,d1v,d2u,d2v,duv;
Standard_Real theD, dtheD, normd1cur, unsurnormd1cur;
curv->D2(X(1),ptcur,d1cur,d2cur);
surf->D2(X(2),X(3),pts,d1u,d1v,d2u,d2v,duv);
normd1cur = d1cur.Magnitude();
unsurnormd1cur = 1./normd1cur;
nplan = unsurnormd1cur * d1cur;
// theD = -(nplan.XYZ().Dot(ptcur.XYZ()));
gp_XYZ nplanXYZ(nplan.XYZ());
gp_XYZ ptcurXYZ(ptcur.XYZ());
theD = nplanXYZ.Dot(ptcurXYZ) ;
theD = theD * (-1.) ;
F(1) = nplan.XYZ().Dot(point.XYZ()) + theD;
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
dnplan.SetLinearForm(-nplan.Dot(d2cur),nplan,d2cur);
dnplan.Multiply(unsurnormd1cur);
dtheD = - nplan.XYZ().Dot(d1cur.XYZ()) - dnplan.XYZ().Dot(ptcur.XYZ());
D(1,1) = dnplan.XYZ().Dot(point.XYZ()) + dtheD;
D(1,2) = D(1,3) = 0.;
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = nplan.Dot(d1u);
D(2,3) = nplan.Dot(d1v);
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwnplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dunplancrosnsurf = nplan.Crossed(dunsurf);
gp_Vec dvnplancrosnsurf = nplan.Crossed(dvnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwnorm = unsurnorm*nplancrosnsurf.Dot(dwnplancrosnsurf);
Standard_Real dunorm = unsurnorm*nplancrosnsurf.Dot(dunplancrosnsurf);
Standard_Real dvnorm = unsurnorm*nplancrosnsurf.Dot(dvnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwnplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dunplandotnsurf = nplan.Dot(dunsurf);
Standard_Real dvnplandotnsurf = nplan.Dot(dvnsurf);
gp_Vec temp,dwtemp,dutemp,dvtemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwtemp.SetLinearForm(nplandotnsurf,dnplan,dwnplandotnsurf,nplan);
dutemp.SetLinearForm(dunplandotnsurf,nplan,-1.,dunsurf);
dvtemp.SetLinearForm(dvnplandotnsurf,nplan,-1.,dvnsurf);
gp_Vec ref,dwref,duref,dvref,corde(point,pts);
ref.SetLinearForm(raysurnorm,temp,corde);
F(3) = ref.SquareMagnitude() - ray*ray;
dwref.SetLinearForm(raysurnorm,dwtemp,-raysurnorm2*dwnorm,temp);
duref.SetLinearForm(raysurnorm,dutemp,-raysurnorm2*dunorm,temp,d1u);
dvref.SetLinearForm(raysurnorm,dvtemp,-raysurnorm2*dvnorm,temp,d1v);
ref.Add(ref);
D(3,1) = ref.Dot(dwref);
D(3,2) = ref.Dot(duref);
D(3,3) = ref.Dot(dvref);
return Standard_True;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void BRepBlend_SurfPointConstRadInv::Set(const gp_Pnt& P)
{
point = P;
}
//=======================================================================
//function : GetTolerance
//purpose :
//=======================================================================
void BRepBlend_SurfPointConstRadInv::GetTolerance(math_Vector& Tolerance,
const Standard_Real Tol) const
{
Tolerance(1) = curv->Resolution(Tol);
Tolerance(2) = surf->UResolution(Tol);
Tolerance(3) = surf->VResolution(Tol);
}
//=======================================================================
//function : GetBounds
//purpose :
//=======================================================================
void BRepBlend_SurfPointConstRadInv::GetBounds(math_Vector& InfBound,
math_Vector& SupBound) const
{
InfBound(1) = curv->FirstParameter();
SupBound(1) = curv->LastParameter();
InfBound(2) = surf->FirstUParameter();
SupBound(2) = surf->LastUParameter();
InfBound(3) = surf->FirstVParameter();
SupBound(3) = surf->LastVParameter();
}
//=======================================================================
//function : IsSolution
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointConstRadInv::IsSolution(const math_Vector& Sol,
const Standard_Real Tol)
{
math_Vector valsol(1,3);
Value(Sol,valsol);
if (Abs(valsol(1)) <= Tol &&
Abs(valsol(2)) <= Tol &&
Abs(valsol(3)) <= 2*Tol*Abs(ray) ) {
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,91 @@
-- File: BRepBlend_SurfPointEvolRadInv.cdl
-- Created: Tue Jul 29 12:02:11 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
---Copyright: Matra Datavision 1997
class SurfPointEvolRadInv from BRepBlend
inherits SurfPointFuncInv from Blend
---Purpose: This function is used to find a solution on a done
-- point of the curve when using SurfRstConsRad or
-- CSConstRad...
-- The vector <X> used in Value, Values and Derivatives
-- methods has to be the vector of the parametric
-- coordinates w, U, V where w is the parameter on the
-- guide line, U,V are the parametric coordinates of a
-- point on the partner surface.
uses
Pnt from gp,
Vector from math,
Matrix from math,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
Function from Law
is
Create(S : HSurface from Adaptor3d; C : HCurve from Adaptor3d;
Evol : Function from Law)
returns SurfPointEvolRadInv from BRepBlend;
Set(me: in out; Choix: Integer from Standard)
is static;
NbEquations(me)
---Purpose: returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me: in out; P : Pnt from gp);
---Purpose: Set the Point on which a solution has to be found.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
---Purpose: Returns in the vector Tolerance the parametric tolerance
-- for each of the 3 variables;
-- Tol is the tolerance used in 3d space.
GetBounds(me; InfBound,SupBound: out Vector from math);
---Purpose: Returns in the vector InfBound the lowest values allowed
-- for each of the 3 variables.
-- Returns in the vector SupBound the greatest values allowed
-- for each of the 3 variables.
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
---Purpose: Returns Standard_True if Sol is a zero of the function.
-- Tol is the tolerance used in 3d space.
returns Boolean from Standard;
fields
surf : HSurface from Adaptor3d;
curv : HCurve from Adaptor3d;
point : Pnt from gp;
ray : Real from Standard;
choix : Integer from Standard;
tevol : Function from Law;
sg1 : Real from Standard;
end SurfPointEvolRadInv;

View File

@@ -0,0 +1,279 @@
// File: BRepBlend_SurfPointEvolRadInv.cxx
// Created: Tue Jul 29 12:13:05 1997
// Author: Jerome LEMONIER
// <jlr@sgi64>
#include <BRepBlend_SurfPointEvolRadInv.ixx>
//=======================================================================
//function :
//purpose :
//=======================================================================
BRepBlend_SurfPointEvolRadInv::BRepBlend_SurfPointEvolRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C,
const Handle(Law_Function)& Evol
) : surf(S), curv(C)
{ tevol=Evol;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfPointEvolRadInv::Set(const Standard_Integer Choix)
{ choix = Choix;
switch (choix) {
case 1 :
case 2 :
sg1 = -1;
break;
case 3 :
case 4 :
sg1 = 1;
break;
default :
sg1 = -1;
break;
}
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Integer BRepBlend_SurfPointEvolRadInv::NbEquations() const
{
return 3;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointEvolRadInv::Value(const math_Vector& X,math_Vector& F)
{
Standard_Real theD,norm,unsurnorm;
gp_Pnt ptcur,pts;
gp_Vec d1cur,d1u,d1v;
gp_XYZ nplan(0.,0.,0.),ns(0.,0.,0.),ref(0.,0.,0.);
curv->D1(X(1),ptcur,d1cur);
ray = sg1*tevol->Value(X(1));
nplan = d1cur.Normalized().XYZ();
theD = -(nplan.Dot(ptcur.XYZ()));
surf->D1(X(2),X(3),pts,d1u,d1v);
F(1) = nplan.Dot(point.XYZ()) + theD;
F(2) = nplan.Dot(pts.XYZ()) + theD;
ns = d1u.Crossed(d1v).XYZ();
norm = nplan.Crossed(ns).Modulus();
unsurnorm = 1./norm;
ns.SetLinearForm(nplan.Dot(ns),nplan, -1.,ns);
ns.Multiply(unsurnorm);
ref = pts.XYZ() - point.XYZ();
ref.SetLinearForm(ray,ns,ref);
F(3) = ref.SquareModulus() - ray*ray;
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointEvolRadInv::Derivatives(const math_Vector& X,math_Matrix& D)
{
gp_Pnt ptcur,pts;
gp_Vec d1cur,d2cur,nplan,dnplan,d1u,d1v,d2u,d2v,duv;
Standard_Real theD, dtheD, normd1cur, unsurnormd1cur,dray;
curv->D2(X(1),ptcur,d1cur,d2cur);
tevol->D1(X(1),ray,dray);
ray=sg1*ray;
dray=sg1*dray;
normd1cur = d1cur.Magnitude();
unsurnormd1cur = 1./normd1cur;
nplan = unsurnormd1cur * d1cur;
theD = -(nplan.XYZ().Dot(ptcur.XYZ()));
dnplan.SetLinearForm(-nplan.Dot(d2cur),nplan,d2cur);
dnplan.Multiply(unsurnormd1cur);
dtheD = - nplan.XYZ().Dot(d1cur.XYZ()) - dnplan.XYZ().Dot(ptcur.XYZ());
D(1,1) = dnplan.XYZ().Dot(point.XYZ()) + dtheD;
D(1,2) = D(1,3) = 0.;
surf->D2(X(2),X(3),pts,d1u,d1v,d2u,d2v,duv);
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = nplan.Dot(d1u);
D(2,3) = nplan.Dot(d1v);
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwnplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dunplancrosnsurf = nplan.Crossed(dunsurf);
gp_Vec dvnplancrosnsurf = nplan.Crossed(dvnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwnorm = unsurnorm*nplancrosnsurf.Dot(dwnplancrosnsurf);
Standard_Real dunorm = unsurnorm*nplancrosnsurf.Dot(dunplancrosnsurf);
Standard_Real dvnorm = unsurnorm*nplancrosnsurf.Dot(dvnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwnplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dunplandotnsurf = nplan.Dot(dunsurf);
Standard_Real dvnplandotnsurf = nplan.Dot(dvnsurf);
gp_Vec temp,dwtemp,dutemp,dvtemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwtemp.SetLinearForm(nplandotnsurf,dnplan,dwnplandotnsurf,nplan);
dutemp.SetLinearForm(dunplandotnsurf,nplan,-1.,dunsurf);
dvtemp.SetLinearForm(dvnplandotnsurf,nplan,-1.,dvnsurf);
gp_Vec ref,dwref,duref,dvref,corde(point,pts);
ref.SetLinearForm(raysurnorm,temp,corde);
dwref.SetLinearForm(raysurnorm,dwtemp,-raysurnorm2*dwnorm,temp);
dwref.SetLinearForm(1.,dwref,dray*unsurnorm,temp);
duref.SetLinearForm(raysurnorm,dutemp,-raysurnorm2*dunorm,temp,d1u);
dvref.SetLinearForm(raysurnorm,dvtemp,-raysurnorm2*dvnorm,temp,d1v);
ref.Add(ref);
D(3,1) = ref.Dot(dwref) - 2.*dray*ray;
D(3,2) = ref.Dot(duref);
D(3,3) = ref.Dot(dvref);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointEvolRadInv::Values(const math_Vector& X,math_Vector& F,math_Matrix& D)
{
gp_Pnt ptcur,pts;
gp_Vec d1cur,d2cur,nplan,dnplan,d1u,d1v,d2u,d2v,duv;
Standard_Real theD, dtheD, normd1cur, unsurnormd1cur,dray;
curv->D2(X(1),ptcur,d1cur,d2cur);
tevol->D1(X(1),ray,dray);
ray=sg1*ray;
dray=sg1*dray;
surf->D2(X(2),X(3),pts,d1u,d1v,d2u,d2v,duv);
normd1cur = d1cur.Magnitude();
unsurnormd1cur = 1./normd1cur;
nplan = unsurnormd1cur * d1cur;
theD = -(nplan.XYZ().Dot(ptcur.XYZ()));
F(1) = nplan.XYZ().Dot(point.XYZ()) + theD;
F(2) = nplan.XYZ().Dot(pts.XYZ()) + theD;
dnplan.SetLinearForm(-nplan.Dot(d2cur),nplan,d2cur);
dnplan.Multiply(unsurnormd1cur);
dtheD = - nplan.XYZ().Dot(d1cur.XYZ()) - dnplan.XYZ().Dot(ptcur.XYZ());
D(1,1) = dnplan.XYZ().Dot(point.XYZ()) + dtheD;
D(1,2) = D(1,3) = 0.;
D(2,1) = dnplan.XYZ().Dot(pts.XYZ()) + dtheD;
D(2,2) = nplan.Dot(d1u);
D(2,3) = nplan.Dot(d1v);
gp_Vec nsurf = d1u.Crossed(d1v);
gp_Vec dunsurf = d2u.Crossed(d1v).Added(d1u.Crossed(duv));
gp_Vec dvnsurf = d1u.Crossed(d2v).Added(duv.Crossed(d1v));
gp_Vec nplancrosnsurf = nplan.Crossed(nsurf);
gp_Vec dwnplancrosnsurf = dnplan.Crossed(nsurf);
gp_Vec dunplancrosnsurf = nplan.Crossed(dunsurf);
gp_Vec dvnplancrosnsurf = nplan.Crossed(dvnsurf);
Standard_Real norm2 = nplancrosnsurf.SquareMagnitude();
Standard_Real norm = sqrt(norm2);
Standard_Real unsurnorm = 1./norm;
Standard_Real raysurnorm = ray*unsurnorm;
Standard_Real unsurnorm2 = unsurnorm * unsurnorm;
Standard_Real raysurnorm2 = ray*unsurnorm2;
Standard_Real dwnorm = unsurnorm*nplancrosnsurf.Dot(dwnplancrosnsurf);
Standard_Real dunorm = unsurnorm*nplancrosnsurf.Dot(dunplancrosnsurf);
Standard_Real dvnorm = unsurnorm*nplancrosnsurf.Dot(dvnplancrosnsurf);
Standard_Real nplandotnsurf = nplan.Dot(nsurf);
Standard_Real dwnplandotnsurf = dnplan.Dot(nsurf);
Standard_Real dunplandotnsurf = nplan.Dot(dunsurf);
Standard_Real dvnplandotnsurf = nplan.Dot(dvnsurf);
gp_Vec temp,dwtemp,dutemp,dvtemp;
temp.SetLinearForm(nplandotnsurf,nplan,-1.,nsurf);
dwtemp.SetLinearForm(nplandotnsurf,dnplan,dwnplandotnsurf,nplan);
dutemp.SetLinearForm(dunplandotnsurf,nplan,-1.,dunsurf);
dvtemp.SetLinearForm(dvnplandotnsurf,nplan,-1.,dvnsurf);
gp_Vec ref,dwref,duref,dvref,corde(point,pts);
ref.SetLinearForm(raysurnorm,temp,corde);
F(3) = ref.SquareMagnitude() - ray*ray;
dwref.SetLinearForm(raysurnorm,dwtemp,-raysurnorm2*dwnorm,temp);
dwref.SetLinearForm(1.,dwref,dray*unsurnorm,temp);
duref.SetLinearForm(raysurnorm,dutemp,-raysurnorm2*dunorm,temp,d1u);
dvref.SetLinearForm(raysurnorm,dvtemp,-raysurnorm2*dvnorm,temp,d1v);
ref.Add(ref);
D(3,1) = ref.Dot(dwref) - 2.*dray*ray;
D(3,2) = ref.Dot(duref);
D(3,3) = ref.Dot(dvref);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfPointEvolRadInv::Set(const gp_Pnt& P)
{
point = P;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfPointEvolRadInv::GetTolerance(math_Vector& Tolerance,const Standard_Real Tol) const
{
Tolerance(1) = curv->Resolution(Tol);
Tolerance(2) = surf->UResolution(Tol);
Tolerance(3) = surf->VResolution(Tol);
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BRepBlend_SurfPointEvolRadInv::GetBounds(math_Vector& InfBound,math_Vector& SupBound) const
{
InfBound(1) = curv->FirstParameter();
SupBound(1) = curv->LastParameter();
InfBound(2) = surf->FirstUParameter();
SupBound(2) = surf->LastUParameter();
InfBound(3) = surf->FirstVParameter();
SupBound(3) = surf->LastVParameter();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BRepBlend_SurfPointEvolRadInv::IsSolution(const math_Vector& Sol,const Standard_Real Tol)
{
math_Vector valsol(1,3);
Value(Sol,valsol);
if (Abs(valsol(1)) <= Tol &&
Abs(valsol(2)) <= Tol &&
Abs(valsol(3)) <= 2*Tol*Abs(ray) ) {
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,301 @@
-- File: BRepBlend_SurfRstConstRad.cdl
-- Created: Thu Feb 6 16:22:22 1997
-- Author: Jacques GOUSSARD
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class SurfRstConstRad from BRepBlend
inherits SurfRstFunction from Blend
uses Vector from math,
Matrix from math,
Ax1 from gp,
Vec from gp,
Vec2d from gp,
Pnt from gp,
Pnt2d from gp,
Circ from gp,
Array1OfPnt from TColgp,
Array1OfVec from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec2d from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
Shape from GeomAbs,
Point from Blend,
SectionShape from BlendFunc,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
CurveOnSurface from Adaptor3d,
ParameterisationType from Convert
is
Create(Surf : HSurface from Adaptor3d;
SurfRst : HSurface from Adaptor3d;
Rst : HCurve2d from Adaptor2d;
CGuide : HCurve from Adaptor3d)
returns SurfRstConstRad from BRepBlend;
NbVariables(me)
---Purpose: Returns 3.
returns Integer from Standard;
NbEquations(me)
---Purpose: Returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me : in out;
SurfRef : HSurface from Adaptor3d;
RstRef : HCurve2d from Adaptor2d);
Set(me: in out; Param: Real from Standard);
Set(me: in out; First, Last: Real from Standard);
---Purpose: Sets the bounds of the parametric interval on
-- the guide line.
-- This determines the derivatives in these values if the
-- function is not Cn.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
GetBounds(me; InfBound,SupBound: out Vector from math);
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
returns Boolean from Standard;
GetMinimalDistance(me)
---Purpose: Returns the minimal Distance beetween two
-- extremitys of calculed sections.
returns Real from Standard
is redefined;
--- TheFollowing methods are called only when
-- IsSolution returns Standard_True.
PointOnS(me)
---C++: return const&
returns Pnt from gp;
PointOnRst(me)
---C++: return const&
returns Pnt from gp;
Pnt2dOnS(me)
---Purpose: Returns U,V coordinates of the point on the surface.
---C++: return const&
returns Pnt2d from gp;
Pnt2dOnRst(me)
---Purpose: Returns U,V coordinates of the point on the curve on
-- surface.
---C++: return const&
returns Pnt2d from gp;
ParameterOnRst(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
IsTangencyPoint(me)
returns Boolean from Standard;
TangentOnS(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnS(me)
---C++: return const&
returns Vec2d from gp;
TangentOnRst(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst(me)
---C++: return const&
returns Vec2d from gp;
Decroch(me;
Sol : Vector from math;
NS,TgS : out Vec from gp)
---Purpose: Enables implementation of a criterion of decrochage
-- specific to the function.
-- Warning: Can be called without previous call of issolution
-- but the values calculated can be senseless.
returns Boolean from Standard
is static;
-- methodes hors template (en plus du create)
Set(me : in out;
Radius : Real from Standard;
Choix : Integer from Standard)
is static;
Set(me: in out; TypeSection: SectionShape from BlendFunc)
---Purpose: Sets the type of section generation for the
-- approximations.
is static;
Section(me : in out;
Param : Real from Standard;
U,V,W : Real from Standard;
Pdeb,Pfin : out Real from Standard;
C : out Circ from gp)
is static;
-- Methods for the approximation
--
IsRational(me) returns Boolean
---Purpose: Returns if the section is rationnal
is static;
GetSectionSize(me) returns Real
---Purpose: Returns the length of the maximum section
is static;
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
---Purpose: Compute the minimal value of weight for each poles
-- of all sections.
is static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
is static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
is static;
GetShape(me : in out;
NbPoles : out Integer from Standard;
NbKnots : out Integer from Standard;
Degree : out Integer from Standard;
NbPoles2d : out Integer from Standard)
is static;
GetTolerance(me;
BoundTol, SurfTol, AngleTol : Real;
Tol3d : out Vector;
Tol1D : out Vector )
---Purpose: Returns the tolerance to reach in approximation
-- to respecte
-- BoundTol error at the Boundary
-- AngleTol tangent error at the Boundary
-- SurfTol error inside the surface.
is static;
Knots(me: in out; TKnots: out Array1OfReal from TColStd)
is static;
Mults(me: in out; TMults: out Array1OfInteger from TColStd)
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
returns Boolean from Standard
is static;
Section(me: in out; P: Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
D2Poles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
D2Poles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd;
D2Weigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
-- The method returns Standard_True if the derivatives
-- are computed, otherwise it returns Standard_False.
returns Boolean from Standard
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
Weigths : out Array1OfReal from TColStd)
is static;
Resolution(me;
IC2d : Integer from Standard;
Tol : Real from Standard;
TolU, TolV : out Real from Standard);
fields
surf : HSurface from Adaptor3d;
surfrst : HSurface from Adaptor3d;
rst : HCurve2d from Adaptor2d;
cons : CurveOnSurface from Adaptor3d;
guide : HCurve from Adaptor3d;
tguide : HCurve from Adaptor3d;
pts : Pnt from gp;
ptrst : Pnt from gp;
pt2ds : Pnt2d from gp;
pt2drst : Pnt2d from gp;
prmrst : Real from Standard;
istangent: Boolean from Standard;
tgs : Vec from gp;
tg2ds : Vec2d from gp;
tgrst : Vec from gp;
tg2drst : Vec2d from gp;
ray : Real from Standard;
choix : Integer from Standard;
ptgui : Pnt from gp;
d1gui : Vec from gp;
d2gui : Vec from gp;
nplan : Vec from gp;
normtg : Real from Standard;
theD : Real from Standard;
surfref : HSurface from Adaptor3d;
rstref : HCurve2d from Adaptor2d;
maxang : Real from Standard;
minang : Real from Standard;
distmin : Real from Standard;
mySShape : SectionShape from BlendFunc;
myTConv : ParameterisationType from Convert;
end SurfRstConstRad;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,306 @@
-- File: BRepBlend_SurfRstEvolRad.cdl
-- Created: Mon Jul 28 17:45:53 1997
-- Author: Jerome LEMONIER
-- <jlr@sgi64>
---Copyright: Matra Datavision 1997
class SurfRstEvolRad from BRepBlend
inherits SurfRstFunction from Blend
---Purpose:
uses Vector from math,
Matrix from math,
Ax1 from gp,
Vec from gp,
Vec2d from gp,
Pnt from gp,
Pnt2d from gp,
Circ from gp,
Array1OfPnt from TColgp,
Array1OfVec from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec2d from TColgp,
Array1OfReal from TColStd,
Array1OfInteger from TColStd,
Shape from GeomAbs,
Point from Blend,
SectionShape from BlendFunc,
HSurface from Adaptor3d,
HCurve from Adaptor3d,
HCurve2d from Adaptor2d,
CurveOnSurface from Adaptor3d,
ParameterisationType from Convert,
Function from Law
is
Create(Surf : HSurface from Adaptor3d;
SurfRst : HSurface from Adaptor3d;
Rst : HCurve2d from Adaptor2d;
CGuide : HCurve from Adaptor3d;
Evol : Function from Law)
returns SurfRstEvolRad from BRepBlend;
NbVariables(me)
---Purpose: Returns 3.
returns Integer from Standard;
NbEquations(me)
---Purpose: Returns 3.
returns Integer from Standard;
Value(me: in out; X: Vector; F: out Vector)
---Purpose: computes the values <F> of the Functions for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Derivatives(me: in out; X: Vector; D: out Matrix)
---Purpose: returns the values <D> of the derivatives for the
-- variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Values(me: in out; X: Vector; F: out Vector; D: out Matrix)
---Purpose: returns the values <F> of the functions and the derivatives
-- <D> for the variable <X>.
-- Returns True if the computation was done successfully,
-- False otherwise.
returns Boolean from Standard;
Set(me : in out;
SurfRef : HSurface from Adaptor3d;
RstRef : HCurve2d from Adaptor2d);
Set(me: in out; Param: Real from Standard);
Set(me: in out; First, Last: Real from Standard);
---Purpose: Sets the bounds of the parametric interval on
-- the guide line.
-- This determines the derivatives in these values if the
-- function is not Cn.
GetTolerance(me; Tolerance: out Vector from math; Tol: Real from Standard);
GetBounds(me; InfBound,SupBound: out Vector from math);
IsSolution(me: in out; Sol: Vector from math; Tol: Real from Standard)
returns Boolean from Standard;
GetMinimalDistance(me)
---Purpose: Returns the minimal Distance beetween two
-- extremitys of calculed sections.
returns Real from Standard
is redefined;
--- TheFollowing methods are called only when
-- IsSolution returns Standard_True.
PointOnS(me)
---C++: return const&
returns Pnt from gp;
PointOnRst(me)
---C++: return const&
returns Pnt from gp;
Pnt2dOnS(me)
---Purpose: Returns U,V coordinates of the point on the surface.
---C++: return const&
returns Pnt2d from gp;
Pnt2dOnRst(me)
---Purpose: Returns U,V coordinates of the point on the curve on
-- surface.
---C++: return const&
returns Pnt2d from gp;
ParameterOnRst(me)
---Purpose: Returns parameter of the point on the curve.
returns Real from Standard;
IsTangencyPoint(me)
returns Boolean from Standard;
TangentOnS(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnS(me)
---C++: return const&
returns Vec2d from gp;
TangentOnRst(me)
---C++: return const&
returns Vec from gp;
Tangent2dOnRst(me)
---C++: return const&
returns Vec2d from gp;
Decroch(me;
Sol : Vector from math;
NS,TgS : out Vec from gp)
---Warning: Peut etre appele sans appel prealable a issolution
-- mais les valeurs calculees risquent de ne pas avoir
-- grand sens.
---Purpose: Permet d ' implementer un critere de decrochage
-- specifique a la fonction.
returns Boolean from Standard
is static;
-- methodes hors template (en plus du create)
Set(me : in out;
Choix : Integer from Standard)
is static;
Set(me: in out; TypeSection: SectionShape from BlendFunc)
---Purpose: Sets the type of section generation for the
-- approximations.
is static;
Section(me : in out;
Param : Real from Standard;
U,V,W : Real from Standard;
Pdeb,Pfin : out Real from Standard;
C : out Circ from gp)
is static;
-- Methods for the approximation
--
IsRational(me) returns Boolean
---Purpose: Returns if the section is rationnal
is static;
GetSectionSize(me) returns Real
---Purpose: Returns the length of the maximum section
is static;
GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
---Purpose: Compute the minimal value of weight for each poles
-- of all sections.
is static;
NbIntervals(me; S : Shape from GeomAbs) returns Integer
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
is static;
Intervals(me; T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
is static;
GetShape(me : in out;
NbPoles : out Integer from Standard;
NbKnots : out Integer from Standard;
Degree : out Integer from Standard;
NbPoles2d : out Integer from Standard)
is static;
GetTolerance(me;
BoundTol, SurfTol, AngleTol : Real;
Tol3d : out Vector;
Tol1D : out Vector )
---Purpose: Returns the tolerance to reach in approximation
-- to respecte
-- BoundTol error at the Boundary
-- AngleTol tangent error at the Boundary
-- SurfTol error inside the surface.
is static;
Knots(me: in out; TKnots: out Array1OfReal from TColStd)
is static;
Mults(me: in out; TMults: out Array1OfInteger from TColStd)
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
returns Boolean from Standard
is static;
Section(me: in out; P: Point from Blend;
Poles : out Array1OfPnt from TColgp;
DPoles : out Array1OfVec from TColgp;
D2Poles : out Array1OfVec from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
DPoles2d : out Array1OfVec2d from TColgp;
D2Poles2d : out Array1OfVec2d from TColgp;
Weigths : out Array1OfReal from TColStd;
DWeigths : out Array1OfReal from TColStd;
D2Weigths : out Array1OfReal from TColStd)
---Purpose: Used for the first and last section
-- The method returns Standard_True if the derivatives
-- are computed, otherwise it returns Standard_False.
returns Boolean from Standard
is static;
Section(me : in out ;
P : Point from Blend;
Poles : out Array1OfPnt from TColgp;
Poles2d : out Array1OfPnt2d from TColgp;
Weigths : out Array1OfReal from TColStd)
is static;
Resolution(me;
IC2d : Integer from Standard;
Tol : Real from Standard;
TolU, TolV : out Real from Standard);
fields
surf : HSurface from Adaptor3d;
surfrst : HSurface from Adaptor3d;
rst : HCurve2d from Adaptor2d;
cons : CurveOnSurface from Adaptor3d;
guide : HCurve from Adaptor3d;
tguide : HCurve from Adaptor3d;
pts : Pnt from gp;
ptrst : Pnt from gp;
pt2ds : Pnt2d from gp;
pt2drst : Pnt2d from gp;
prmrst : Real from Standard;
istangent: Boolean from Standard;
tgs : Vec from gp;
tg2ds : Vec2d from gp;
tgrst : Vec from gp;
tg2drst : Vec2d from gp;
ray : Real from Standard;
dray : Real from Standard;
choix : Integer from Standard;
ptgui : Pnt from gp;
d1gui : Vec from gp;
d2gui : Vec from gp;
nplan : Vec from gp;
normtg : Real from Standard;
theD : Real from Standard;
surfref : HSurface from Adaptor3d;
rstref : HCurve2d from Adaptor2d;
maxang : Real from Standard;
minang : Real from Standard;
distmin : Real from Standard;
mySShape : SectionShape from BlendFunc;
myTConv : ParameterisationType from Convert;
tevol : Function from Law ;
fevol : Function from Law ;
sg1 : Real from Standard;
end SurfRstEvolRad;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,230 @@
-- File: BRepBlend_SurfRstLineBuilder.cdl
-- Created: Thu Jan 23 16:25:47 1997
-- Author: Jacques GOUSSARD
-- Author: Laurent BOURESCHE
-- <lbo@pomalox.paris1.matra-dtv.fr>
---Copyright: Matra Datavision 1997
class SurfRstLineBuilder from BRepBlend
---Purpose: This class processes data resulting from
-- Blend_CSWalking taking in consideration the Surface
-- supporting the curve to detect the breakpoint.
--
-- The criteria of distribution of points on the line are detailed
-- because it is to be used in the calculatuon of values approached
-- by an approximation of functions continued basing on
-- Blend_SurfRstFunction.
--
-- Thus this pseudo path necessitates 3 criteria of regrouping :
--
-- 1) exit of the domain of the curve
--
-- 2) exit of the domain of the surface
--
-- 3) stall as there is a solution to the problem
-- surf/surf within the domain of the surface
-- of support of the restriction.
uses Point from Blend,
Status from Blend,
SurfRstFunction from Blend,
FuncInv from Blend,
SurfPointFuncInv from Blend,
SurfCurvFuncInv from Blend,
Vector from math,
Matrix from math,
State from TopAbs,
Pnt from gp,
Pnt2d from gp,
Vec from gp,
Vec2d from gp,
HArray1OfReal from TColStd,
Transition from IntSurf,
HVertex from Adaptor3d,
HSurface from Adaptor3d,
HCurve2d from Adaptor2d,
TopolTool from Adaptor3d,
Line from BRepBlend,
Extremity from BRepBlend
is
Create(Surf1 : HSurface from Adaptor3d;
Domain1 : TopolTool from Adaptor3d;
Surf2 : HSurface from Adaptor3d;
Rst : HCurve2d from Adaptor2d;
Domain2 : TopolTool from Adaptor3d)
returns SurfRstLineBuilder from BRepBlend;
Perform(me : in out;
Func : in out SurfRstFunction from Blend;
Finv : in out FuncInv from Blend;
FinvP : in out SurfPointFuncInv from Blend;
FinvC : in out SurfCurvFuncInv from Blend;
Pdep : Real from Standard;
Pmax : Real from Standard;
MaxStep : Real from Standard;
TolGuide : Real from Standard;
Soldep : Vector from math;
Tolesp : Real from Standard;
Fleche : Real from Standard;
Appro : Boolean from Standard = Standard_False)
is static;
PerformFirstSection(me : in out;
Func : in out SurfRstFunction from Blend;
Finv : in out FuncInv from Blend;
FinvP : in out SurfPointFuncInv from Blend;
FinvC : in out SurfCurvFuncInv from Blend;
Pdep : Real from Standard;
Pmax : Real from Standard;
Soldep : Vector from math;
Tolesp : Real from Standard;
TolGuide : Real from Standard;
RecRst : Boolean from Standard;
RecP : Boolean from Standard;
RecS : Boolean from Standard;
Psol : out Real from Standard;
ParSol : out Vector from math)
returns Boolean from Standard
is static;
Complete(me : in out;
Func : in out SurfRstFunction from Blend;
Finv : in out FuncInv from Blend;
FinvP : in out SurfPointFuncInv from Blend;
FinvC : in out SurfCurvFuncInv from Blend;
Pmin : Real from Standard)
returns Boolean from Standard
is static;
InternalPerform (me : in out;
Func : in out SurfRstFunction from Blend;
Finv : in out FuncInv from Blend;
FinvP : in out SurfPointFuncInv from Blend;
FinvC : in out SurfCurvFuncInv from Blend;
Bound : Real from Standard)
is static private;
ArcToRecadre(me : in out;
Sol : Vector from math;
PrevIndex : Integer;
pt2d, lastpt2d : out Pnt2d from gp;
ponarc : out Real)
returns Integer;
Recadre(me : in out;
FinvC : in out SurfCurvFuncInv from Blend;
Solinv : out Vector from math;
Arc : out HCurve2d from Adaptor2d;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
Recadre(me : in out;
Func : in out SurfRstFunction from Blend;
Finv : in out FuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
Recadre(me : in out;
FinvP : in out SurfPointFuncInv from Blend;
Solinv : out Vector from math;
IsVtx : out Boolean from Standard;
Vtx : out HVertex from Adaptor3d)
returns Boolean from Standard
is static private;
IsDone(me)
returns Boolean from Standard
---C++: inline
is static;
Line(me)
returns Line from BRepBlend
---C++: inline
---C++: return const&
is static;
DecrochStart(me)
returns Boolean from Standard
---C++: inline
is static;
DecrochEnd(me)
returns Boolean from Standard
---C++: inline
is static;
Transition(me : in out;
OnFirst : Boolean from Standard;
Arc : HCurve2d from Adaptor2d;
Param : Real from Standard;
TLine,TArc : out Transition from IntSurf)
is static private;
MakeExtremity(me : in out;
Extrem : in out Extremity from BRepBlend;
OnFirst : Boolean from Standard;
Arc : HCurve2d from Adaptor2d;
Param : Real from Standard;
IsVtx : Boolean from Standard;
Vtx : HVertex from Adaptor3d)
is static private;
CheckDeflectionOnSurf(me : in out;
CurPoint : Point from Blend)
returns Status from Blend
is static private;
CheckDeflectionOnRst(me : in out;
CurPoint : Point from Blend)
returns Status from Blend
is static private;
TestArret(me : in out;
Func : in out SurfRstFunction from Blend;
TestDeflection : Boolean from Standard;
State : Status from Blend)
returns Status from Blend
is static private;
CheckInside(me : in out;
Func : in out SurfRstFunction from Blend;
SituOnC : out State from TopAbs;
SituOnS : out State from TopAbs;
Decroch : out Boolean from Standard)
returns Boolean from Standard
is static private;
fields
done : Boolean from Standard;
line : Line from BRepBlend;
sol : Vector from math;
surf1 : HSurface from Adaptor3d;
domain1 : TopolTool from Adaptor3d;
surf2 : HSurface from Adaptor3d;
rst : HCurve2d from Adaptor2d;
domain2 : TopolTool from Adaptor3d;
tolesp : Real from Standard;
tolgui : Real from Standard;
pasmax : Real from Standard;
fleche : Real from Standard;
param : Real from Standard;
previousP : Point from Blend;
rebrou : Boolean from Standard;
iscomplete : Boolean from Standard;
comptra : Boolean from Standard;
sens : Real from Standard;
decrochdeb : Boolean from Standard;
decrochfin : Boolean from Standard;
end SurfRstLineBuilder from BRepBlend;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
// File: BRepBlend_SurfRstLineBuilder.lxx
// Created: Fri Jan 24 10:47:10 1997
// Author: Laurent BOURESCHE
// <lbo@pomalox.paris1.matra-dtv.fr>
#include <StdFail_NotDone.hxx>
//=======================================================================
//function : IsDone
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_SurfRstLineBuilder::IsDone() const
{
return done;
}
//=======================================================================
//function : Line
//purpose :
//=======================================================================
inline const Handle(BRepBlend_Line)& BRepBlend_SurfRstLineBuilder::Line() const
{
if (!done) {StdFail_NotDone::Raise();}
return line;
}
//=======================================================================
//function : DecrochStart
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_SurfRstLineBuilder::DecrochStart() const
{
return decrochdeb;
}
//=======================================================================
//function : DecrochEnd
//purpose :
//=======================================================================
inline Standard_Boolean BRepBlend_SurfRstLineBuilder::DecrochEnd() const
{
return decrochfin;
}