mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
112
src/ChFi3d/ChFi3d.cdl
Executable file
112
src/ChFi3d/ChFi3d.cdl
Executable file
@@ -0,0 +1,112 @@
|
||||
-- File: ChFi3d.cdl
|
||||
-- Created: Tue Nov 9 15:39:27 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
package ChFi3d
|
||||
|
||||
---Purpose: creation of spatial fillets on a solid.
|
||||
|
||||
uses ChFiDS,
|
||||
TopOpeBRepBuild,
|
||||
TopOpeBRepDS,
|
||||
BRepAdaptor,
|
||||
BRepTopAdaptor,
|
||||
BRepBlend,
|
||||
BlendFunc,
|
||||
Blend,
|
||||
AppBlend,
|
||||
Law,
|
||||
gp,
|
||||
Geom2d,
|
||||
Geom,
|
||||
GeomAbs,
|
||||
TopoDS,
|
||||
TopAbs,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TColgp,
|
||||
TopTools,
|
||||
MMgt,
|
||||
StdFail,
|
||||
math,
|
||||
AdvApprox,
|
||||
Adaptor3d,
|
||||
Adaptor2d,
|
||||
Standard
|
||||
|
||||
is
|
||||
deferred class Builder;
|
||||
---Purpose: Structure and methods common for the construction
|
||||
-- of fillets and chamfers 3d.
|
||||
|
||||
class ChBuilder;
|
||||
---Purpose: Tool constructing chamfers on a solid.
|
||||
|
||||
class FilBuilder;
|
||||
---Purpose: Outil de construction de conges sur un solide.
|
||||
|
||||
private class SearchSing;
|
||||
---Purpose: Searches singularities on fillet
|
||||
|
||||
enumeration FilletShape is
|
||||
Rational,
|
||||
QuasiAngular,
|
||||
Polynomial
|
||||
--- Purpose:
|
||||
-- Lists the types of fillet shapes. These include the following:
|
||||
-- - ChFi3d_Rational (default value), which is the
|
||||
-- standard NURBS representation of circles,
|
||||
-- - ChFi3d_QuasiAngular, which is a NURBS
|
||||
-- representation of circles where the parameters
|
||||
-- match those of the circle,
|
||||
-- - ChFi3d_Polynomial, which corresponds to a
|
||||
-- polynomial approximation of circles. This type
|
||||
-- facilitates the implementation of the construction algorithm.
|
||||
|
||||
end FilletShape;
|
||||
|
||||
|
||||
ConcaveSide (S1,S2 : Surface from BRepAdaptor; E : Edge from TopoDS;
|
||||
Or1,Or2 : out Orientation from TopAbs)
|
||||
---Purpose: Returns Reversed in Or1 and(or) Or2 if
|
||||
-- the concave edge defined by the interior of faces F1 and F2,
|
||||
-- in the neighbourhood of their boundary E is of the edge opposite to the
|
||||
-- normal of their surface support. The orientation of
|
||||
-- faces is not taken into consideration in the calculation. The
|
||||
-- function returns 0 if the calculation fails (tangence),
|
||||
-- if not, it returns the number of choice of the fillet
|
||||
-- or chamfer corresponding to the orientations calculated
|
||||
-- and to the tangent to the guide line read in E.
|
||||
--
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
NextSide (Or1,Or2 : in out Orientation from TopAbs;
|
||||
OrSave1,OrSave2 : Orientation from TopAbs;
|
||||
ChoixSauv : Integer from Standard)
|
||||
---Purpose: Same as ConcaveSide, but the orientations are
|
||||
-- logically deduced from the result of the call of
|
||||
-- ConcaveSide on the first pair of faces of the fillet or
|
||||
-- chamnfer.
|
||||
returns Integer from Standard;
|
||||
|
||||
NextSide (Or : in out Orientation from TopAbs;
|
||||
OrSave,OrFace : Orientation from TopAbs);
|
||||
---Purpose: Same as the other NextSide, but the calculation is done
|
||||
-- on an edge only.
|
||||
|
||||
|
||||
SameSide(Or,OrSave1,OrSave2,OrFace1,OrFace2 : Orientation from TopAbs)
|
||||
---Purpose: Enables to determine while processing an angle, if
|
||||
-- two fillets or chamfers constituting a face have
|
||||
-- identic or opposed concave edges.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
|
||||
end ChFi3d;
|
||||
|
271
src/ChFi3d/ChFi3d.cxx
Executable file
271
src/ChFi3d/ChFi3d.cxx
Executable file
@@ -0,0 +1,271 @@
|
||||
// File: ChFi3d.cxx
|
||||
// Created: Tue Dec 21 16:19:36 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@sdsun2>
|
||||
|
||||
|
||||
#include <ChFi3d.ixx>
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_Curve2d.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ConcaveSide
|
||||
//purpose : calcule le cote concave au voisinage de la frontiere
|
||||
// de 2 faces.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1,
|
||||
const BRepAdaptor_Surface& S2,
|
||||
const TopoDS_Edge& E,
|
||||
TopAbs_Orientation& Or1,
|
||||
TopAbs_Orientation& Or2)
|
||||
|
||||
{
|
||||
Standard_Integer ChoixConge;
|
||||
Or1 = Or2 = TopAbs_FORWARD;
|
||||
BRepAdaptor_Curve CE(E);
|
||||
Standard_Real first = CE.FirstParameter();
|
||||
Standard_Real last = CE.LastParameter();
|
||||
Standard_Real par = 0.691254*first + 0.308746*last;
|
||||
|
||||
gp_Pnt pt, pt1, pt2; gp_Vec tgE, tgE1, tgE2, ns1, ns2, dint1, dint2;
|
||||
TopoDS_Face F1 = S1.Face();
|
||||
TopoDS_Face F2 = S2.Face();
|
||||
F1.Orientation(TopAbs_FORWARD);
|
||||
F2.Orientation(TopAbs_FORWARD);
|
||||
|
||||
CE.D1(par,pt,tgE);
|
||||
tgE.Normalize();
|
||||
tgE2 = tgE1 = tgE;
|
||||
if(E.Orientation() == TopAbs_REVERSED) tgE.Reverse();
|
||||
|
||||
TopoDS_Edge E1 = E, E2 = E;
|
||||
E1.Orientation(TopAbs_FORWARD);
|
||||
E2.Orientation(TopAbs_FORWARD);
|
||||
|
||||
if(F1.IsSame(F2) && BRep_Tool::IsClosed(E,F1)) {
|
||||
E2.Orientation(TopAbs_REVERSED);
|
||||
tgE2.Reverse();
|
||||
}
|
||||
else {
|
||||
TopExp_Explorer Exp;
|
||||
Standard_Boolean found = 0;
|
||||
for (Exp.Init(F1,TopAbs_EDGE);
|
||||
Exp.More() && !found;
|
||||
Exp.Next()) {
|
||||
if (E.IsSame(TopoDS::Edge(Exp.Current()))){
|
||||
if(Exp.Current().Orientation() == TopAbs_REVERSED) tgE1.Reverse();
|
||||
found = Standard_True;
|
||||
}
|
||||
}
|
||||
if (!found) { return 0; }
|
||||
found = 0;
|
||||
for (Exp.Init(F2,TopAbs_EDGE);
|
||||
Exp.More() && !found;
|
||||
Exp.Next()) {
|
||||
if (E.IsSame(TopoDS::Edge(Exp.Current()))){
|
||||
if(Exp.Current().Orientation() == TopAbs_REVERSED) tgE2.Reverse();
|
||||
found = Standard_True;
|
||||
}
|
||||
}
|
||||
if (!found) { return 0; }
|
||||
}
|
||||
BRepAdaptor_Curve2d pc1(E1,F1);
|
||||
BRepAdaptor_Curve2d pc2(E2,F2);
|
||||
gp_Pnt2d p2d1,p2d2;
|
||||
gp_Vec DU1,DV1,DU2,DV2;
|
||||
p2d1 = pc1.Value(par);
|
||||
p2d2 = pc2.Value(par);
|
||||
S1.D1(p2d1.X(),p2d1.Y(),pt1,DU1,DV1);
|
||||
ns1 = DU1.Crossed(DV1);
|
||||
ns1.Normalize();
|
||||
S2.D1(p2d2.X(),p2d2.Y(),pt2,DU2,DV2);
|
||||
ns2 = DU2.Crossed(DV2);
|
||||
ns2.Normalize();
|
||||
|
||||
dint1 = ns1.Crossed(tgE1);
|
||||
dint2 = ns2.Crossed(tgE2);
|
||||
Standard_Real ang = ns1.CrossMagnitude(ns2);
|
||||
if(ang > 0.0001*PI){
|
||||
Standard_Real scal = ns2.Dot(dint1);
|
||||
if ( scal <= 0. ){
|
||||
ns2.Reverse();
|
||||
Or2 = TopAbs_REVERSED;
|
||||
}
|
||||
scal = ns1.Dot(dint2);
|
||||
if ( scal <= 0. ){
|
||||
ns1.Reverse();
|
||||
Or1 = TopAbs_REVERSED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//les faces sont localement tangentes on bidouille!!
|
||||
if(dint1.Dot(dint2) < 0.){
|
||||
//ici c'est une regularite oubliee
|
||||
gp_Vec DDU, DDV, DDUV;
|
||||
S1.D2(p2d1.X(),p2d1.Y(),pt1,DU1,DV1,DDU,DDV,DDUV);
|
||||
DU1 += ( DU1 * dint1 < 0) ? -DDU : DDU;
|
||||
DV1 += ( DV1 * dint1 < 0) ? -DDV : DDV;
|
||||
ns1 = DU1.Crossed(DV1);
|
||||
ns1.Normalize();
|
||||
S2.D2(p2d2.X(),p2d2.Y(),pt2,DU2,DV2,DDU,DDV,DDUV);
|
||||
DU2 += ( DU2 * dint2 < 0) ? -DDU : DDU;
|
||||
DV2 += ( DV2 * dint2 < 0) ? -DDV : DDV;
|
||||
ns2 = DU2.Crossed(DV2);
|
||||
ns2.Normalize();
|
||||
|
||||
dint1 = ns1.Crossed(tgE1);
|
||||
dint2 = ns2.Crossed(tgE2);
|
||||
ang = ns1.CrossMagnitude(ns2);
|
||||
if(ang > 0.0001*PI){
|
||||
Standard_Real scal = ns2.Dot(dint1);
|
||||
if ( scal <= 0. ){
|
||||
ns2.Reverse();
|
||||
Or2 = TopAbs_REVERSED;
|
||||
}
|
||||
scal = ns1.Dot(dint2);
|
||||
if ( scal <= 0. ){
|
||||
ns1.Reverse();
|
||||
Or1 = TopAbs_REVERSED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef DEB
|
||||
cout<<"ConcaveSide : pas de cote concave"<<endl;
|
||||
#endif
|
||||
//ce 10 montre que la face en bout est dans le prolongement de l'une des deux faces d'appui
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//ici ca rebrousse, on prend des points dans les faces
|
||||
//ni trop pres ni trop loin, comme on peut.
|
||||
Standard_Real u,v;
|
||||
#ifdef DEB
|
||||
// Standard_Real deport = 1000*BRep_Tool::Tolerance(E);
|
||||
#endif
|
||||
ChFi3d_Coefficient(dint1,DU1,DV1,u,v);
|
||||
p2d1.SetX(p2d1.X() + u); p2d1.SetY(p2d1.Y() + v);
|
||||
ChFi3d_Coefficient(dint1,DU2,DV2,u,v);
|
||||
p2d2.SetX(p2d2.X() + u); p2d2.SetY(p2d2.Y() + v);
|
||||
S1.D1(p2d1.X(),p2d1.Y(),pt1,DU1,DV1);
|
||||
ns1 = DU1.Crossed(DV1);
|
||||
S2.D1(p2d2.X(),p2d2.Y(),pt2,DU2,DV2);
|
||||
ns2 = DU2.Crossed(DV2);
|
||||
gp_Vec vref(pt1,pt2);
|
||||
if(ns1.Dot(vref) < 0.){
|
||||
Or1 = TopAbs_REVERSED;
|
||||
}
|
||||
if(ns2.Dot(vref) > 0.){
|
||||
Or2 = TopAbs_REVERSED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Or1 == TopAbs_FORWARD) {
|
||||
if (Or2 == TopAbs_FORWARD) ChoixConge = 1;
|
||||
else ChoixConge = 7;
|
||||
}
|
||||
else {
|
||||
if (Or2 == TopAbs_FORWARD) ChoixConge = 3;
|
||||
else ChoixConge = 5;
|
||||
}
|
||||
if ((ns1.Crossed(ns2)).Dot(tgE) >= 0.) ChoixConge++ ;
|
||||
return ChoixConge;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NextSide
|
||||
//purpose :
|
||||
//
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFi3d::NextSide(TopAbs_Orientation& Or1,
|
||||
TopAbs_Orientation& Or2,
|
||||
const TopAbs_Orientation OrSave1,
|
||||
const TopAbs_Orientation OrSave2,
|
||||
const Standard_Integer ChoixSave)
|
||||
{
|
||||
if (Or1 == TopAbs_FORWARD){Or1 = OrSave1;}
|
||||
else {
|
||||
Or1 = TopAbs::Reverse(OrSave1);
|
||||
}
|
||||
if (Or2 == TopAbs_FORWARD){Or2 = OrSave2;}
|
||||
else {
|
||||
Or2 = TopAbs::Reverse(OrSave2);
|
||||
}
|
||||
|
||||
Standard_Integer ChoixConge;
|
||||
if (Or1 == TopAbs_FORWARD) {
|
||||
if (Or2 == TopAbs_FORWARD) ChoixConge = 1;
|
||||
else {
|
||||
if(ChoixSave < 0) ChoixConge = 3;
|
||||
else ChoixConge = 7;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Or2 == TopAbs_FORWARD) {
|
||||
if(ChoixSave < 0) ChoixConge = 7;
|
||||
else ChoixConge = 3;
|
||||
}
|
||||
else ChoixConge = 5;
|
||||
}
|
||||
if (Abs(ChoixSave)%2 == 0) ChoixConge++;
|
||||
return ChoixConge;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NextSide
|
||||
//purpose :
|
||||
//
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d::NextSide(TopAbs_Orientation& Or,
|
||||
const TopAbs_Orientation OrSave,
|
||||
const TopAbs_Orientation OrFace)
|
||||
{
|
||||
if (Or == OrFace){Or = OrSave;}
|
||||
else {
|
||||
Or = TopAbs::Reverse(OrSave);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SameSide
|
||||
//purpose :
|
||||
//
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ChFi3d::SameSide(const TopAbs_Orientation Or,
|
||||
const TopAbs_Orientation OrSave1,
|
||||
const TopAbs_Orientation OrSave2,
|
||||
const TopAbs_Orientation OrFace1,
|
||||
const TopAbs_Orientation OrFace2)
|
||||
{
|
||||
TopAbs_Orientation o1,o2;
|
||||
if (Or == OrFace1){o1 = OrSave1;}
|
||||
else {
|
||||
o1 = TopAbs::Reverse(OrSave1);
|
||||
}
|
||||
if (Or == OrFace2){o2 = OrSave2;}
|
||||
else {
|
||||
o2 = TopAbs::Reverse(OrSave2);
|
||||
}
|
||||
return (o1 == o2);
|
||||
}
|
974
src/ChFi3d/ChFi3d_Builder.cdl
Executable file
974
src/ChFi3d/ChFi3d_Builder.cdl
Executable file
@@ -0,0 +1,974 @@
|
||||
-- File: ChFi3d_Builder.cdl
|
||||
-- Created: Tue Nov 9 17:40:22 1993
|
||||
-- Author: Laurent BOURESCHE
|
||||
-- <lbo@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
|
||||
deferred class Builder from ChFi3d
|
||||
|
||||
---Purpose: Root class for calculation of surfaces (fillets,
|
||||
-- chamfers) destined to smooth edges of
|
||||
-- a gap on a Shape and the reconstruction of the Shape.
|
||||
|
||||
uses
|
||||
Spine from ChFiDS,
|
||||
ListOfStripe from ChFiDS,
|
||||
SequenceOfSurfData from ChFiDS,
|
||||
SurfData from ChFiDS,
|
||||
Stripe from ChFiDS,
|
||||
StripeMap from ChFiDS,
|
||||
Map from ChFiDS,
|
||||
CommonPoint from ChFiDS,
|
||||
Regularities from ChFiDS,
|
||||
HElSpine from ChFiDS,
|
||||
ErrorStatus from ChFiDS,
|
||||
HDataStructure from TopOpeBRepDS,
|
||||
HBuilder from TopOpeBRepBuild,
|
||||
AppFunction from Blend,
|
||||
Function from Blend,
|
||||
CSFunction from Blend,
|
||||
FuncInv from Blend,
|
||||
SurfRstFunction from Blend,
|
||||
RstRstFunction from Blend,
|
||||
SurfPointFuncInv from Blend,
|
||||
SurfCurvFuncInv from Blend,
|
||||
CurvPointFuncInv from Blend,
|
||||
Approx from AppBlend,
|
||||
Line from BRepBlend,
|
||||
DataMapOfShapeListOfInteger from TopTools,
|
||||
ListOfShape from TopTools,
|
||||
Shape from TopoDS,
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
State from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
HCurve from Adaptor3d,
|
||||
HCurve2d from Adaptor2d,
|
||||
HSurface from Adaptor3d,
|
||||
HCurve2d from BRepAdaptor,
|
||||
Surface from BRepAdaptor,
|
||||
HSurface from BRepAdaptor,
|
||||
TopolTool from Adaptor3d,
|
||||
TopolTool from BRepTopAdaptor,
|
||||
Vector from math,
|
||||
Shape from GeomAbs,
|
||||
Surface from Geom,
|
||||
Curve from Geom2d,
|
||||
Pnt2d from gp
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
ConstructionError from Standard
|
||||
|
||||
is
|
||||
|
||||
-- Construction et donnees generales.
|
||||
-------------------------------------
|
||||
|
||||
Delete(me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~ChFi3d_Builder(){Delete() ; }"
|
||||
|
||||
Initialize(S : Shape from TopoDS; Ta : Real from Standard);
|
||||
|
||||
|
||||
SetParams(me : in out;
|
||||
Tang, Tesp, T2d, TApp3d, TolApp2d, Fleche: Real from Standard);
|
||||
|
||||
|
||||
SetContinuity(me : in out;
|
||||
InternalContinuity : Shape from GeomAbs;
|
||||
AngularTolerance : Real);
|
||||
|
||||
|
||||
-- Acquisition et interrogation concernant les trajets.
|
||||
-------------------------------------------------------
|
||||
|
||||
Remove(me : in out; E : Edge from TopoDS)
|
||||
---Purpose: extracts from the list the contour containing edge E.
|
||||
--
|
||||
is static;
|
||||
|
||||
Contains(me;E : Edge from TopoDS)
|
||||
---Purpose: gives the number of the contour containing E or 0
|
||||
-- if E does not belong to any contour.
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
Contains(me;E : Edge from TopoDS; IndexInSpine : out Integer from Standard)
|
||||
---Purpose: gives the number of the contour containing E or 0
|
||||
-- if E does not belong to any contour.
|
||||
-- Sets in IndexInSpine the index of E in the contour if it's found
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
NbElements(me) returns Integer is static;
|
||||
---Purpose: gives the number of disjoint contours on which
|
||||
-- the fillets are calculated
|
||||
|
||||
Value(me; I : Integer) returns Spine from ChFiDS
|
||||
---Purpose: gives the n'th set of edges (contour)
|
||||
raises OutOfRange from Standard
|
||||
---Purpose: if I >NbElements()
|
||||
is static;
|
||||
|
||||
|
||||
Length(me; IC : Integer from Standard) returns Real from Standard
|
||||
---Purpose: returns the length of the contour of index IC.
|
||||
is static;
|
||||
|
||||
|
||||
FirstVertex(me;IC : Integer from Standard)
|
||||
returns Vertex from TopoDS
|
||||
---Purpose: returns the First vertex V of
|
||||
-- the contour of index IC.
|
||||
is static;
|
||||
|
||||
|
||||
LastVertex(me;IC : Integer from Standard)
|
||||
returns Vertex from TopoDS
|
||||
---Purpose: returns the Last vertex V of
|
||||
-- the contour of index IC.
|
||||
is static;
|
||||
|
||||
|
||||
Abscissa(me;
|
||||
IC : Integer from Standard;
|
||||
V : Vertex from TopoDS)
|
||||
returns Real from Standard
|
||||
---Purpose: returns the abscissa of the vertex V on
|
||||
-- the contour of index IC.
|
||||
is static;
|
||||
|
||||
|
||||
RelativeAbscissa(me;
|
||||
IC : Integer from Standard;
|
||||
V : Vertex from TopoDS)
|
||||
returns Real from Standard
|
||||
---Purpose: returns the relative abscissa([0.,1.]) of the
|
||||
-- vertex V on the contour of index IC.
|
||||
is static;
|
||||
|
||||
|
||||
ClosedAndTangent(me; IC : Integer from Standard)
|
||||
returns Boolean from Standard
|
||||
---Purpose: returns true if the contour of index IC is closed
|
||||
-- an tangent.
|
||||
is static;
|
||||
|
||||
|
||||
Closed(me; IC : Integer from Standard)
|
||||
returns Boolean from Standard
|
||||
---Purpose: returns true if the contour of index IC is closed
|
||||
is static;
|
||||
|
||||
|
||||
-- Le calcul et la recuperation des resultats.
|
||||
----------------------------------------------
|
||||
|
||||
Compute(me : in out)
|
||||
---Purpose: calculation general
|
||||
-- -geometrie sur l ensemble des aretes,
|
||||
-- -reconstruction topologique
|
||||
is static;
|
||||
|
||||
IsDone(me) returns Boolean from Standard is static;
|
||||
---Purpose: returns True if the computation is success
|
||||
|
||||
Shape(me) returns Shape from TopoDS
|
||||
---Purpose: if (Isdone()) rend le resultat.
|
||||
raises NoSuchObject from Standard
|
||||
---Purpose: if (!Isdone())
|
||||
is static;
|
||||
|
||||
Generated(me : in out; EouV : Shape from TopoDS)
|
||||
---Purpose: Advanced function for the history
|
||||
returns ListOfShape from TopTools
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
NbFaultyContours(me)
|
||||
---Purpose: Returns the number of contours on which the calculation
|
||||
-- has failed.
|
||||
returns Integer from Standard is static;
|
||||
|
||||
FaultyContour(me; I : Integer from Standard)
|
||||
---Purpose: Returns the number of I'th contour on which the calculation
|
||||
-- has failed.
|
||||
returns Integer from Standard is static;
|
||||
|
||||
NbComputedSurfaces(me; IC : Integer from Standard)
|
||||
---Purpose: Returns the number of surfaces calculated on the contour IC.
|
||||
returns Integer from Standard is static;
|
||||
|
||||
ComputedSurface(me; IC, IS : Integer from Standard)
|
||||
---Purpose: Returns the IS'th surface calculated on the contour IC.
|
||||
returns Surface from Geom is static;
|
||||
|
||||
NbFaultyVertices(me)
|
||||
---Purpose: Returns the number of vertices on which the calculation
|
||||
-- has failed.
|
||||
returns Integer from Standard is static;
|
||||
|
||||
FaultyVertex(me; IV : Integer from Standard)
|
||||
---Purpose: Returns the IV'th vertex on which the calculation has failed.
|
||||
returns Vertex from TopoDS is static;
|
||||
|
||||
HasResult(me) returns Boolean from Standard is static;
|
||||
---Purpose: returns True if a partial result has been calculated
|
||||
|
||||
BadShape(me) returns Shape from TopoDS
|
||||
---Purpose: if (HasResult()) returns partial result
|
||||
raises NoSuchObject from Standard
|
||||
---Purpose: if (!HasResult())
|
||||
is static;
|
||||
|
||||
StripeStatus(me;IC:Integer from Standard) returns ErrorStatus from ChFiDS
|
||||
---Purpose: for the stripe IC ,indication on the cause
|
||||
-- of failure WalkingFailure,TwistedSurface,Error, Ok
|
||||
is static;
|
||||
|
||||
Reset(me : in out)
|
||||
---Purpose: Reset all results of compute and returns the algorythm
|
||||
-- in the state of the last acquisition to
|
||||
-- enable modification of contours or areas.
|
||||
is static;
|
||||
|
||||
Builder(me) returns HBuilder from TopOpeBRepBuild
|
||||
---Purpose: Returns the Builder of topologic operations.
|
||||
is static;
|
||||
|
||||
|
||||
---pour implementation
|
||||
----------------------
|
||||
|
||||
--- Simulation
|
||||
|
||||
SimulKPart(me; SD : mutable SurfData from ChFiDS)
|
||||
is deferred protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean
|
||||
is deferred protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is virtual protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is virtual protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is virtual protected;
|
||||
|
||||
SimulData(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Lin : out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Func : in out Function from Blend;
|
||||
FInv : in out FuncInv from Blend;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
NbSecMin : Integer from Standard;
|
||||
RecOnS1 : Boolean from Standard = Standard_False;
|
||||
RecOnS2 : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
SimulData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
PC2 : HCurve2d from Adaptor2d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Decroch : out Boolean from Standard;
|
||||
Func : in out SurfRstFunction from Blend;
|
||||
FInv : in out FuncInv from Blend;
|
||||
FInvP : in out SurfPointFuncInv from Blend;
|
||||
FInvC : in out SurfCurvFuncInv from Blend;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First : in out Real from Standard;
|
||||
Last : in out Real from Standard;
|
||||
Soldep : Vector from math;
|
||||
NbSecMin : Integer from Standard;
|
||||
Inside : Boolean from Standard;
|
||||
Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
|
||||
SimulData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
PC1 : HCurve2d from Adaptor2d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
PC2 : HCurve2d from Adaptor2d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
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;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First : in out Real from Standard;
|
||||
Last : in out Real from Standard;
|
||||
Soldep : Vector from math;
|
||||
NbSecMin : Integer from Standard;
|
||||
Inside : Boolean from Standard;
|
||||
Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecP1, RecRst1 : Boolean from Standard;
|
||||
RecP2, RecRst2 : Boolean from Standard)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
--- Calcul veritable
|
||||
|
||||
SetRegul(me : in out) is deferred protected;
|
||||
|
||||
FaceTangency(me ;E0,E1 : Edge from TopoDS; V : Vertex from TopoDS)
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
PerformElement(me : in out ;CElement : Spine)
|
||||
returns Boolean from Standard
|
||||
is static protected;
|
||||
|
||||
PerformExtremity(me : in out ;CElement : Spine)
|
||||
is static protected;
|
||||
|
||||
PerformSetOfSurf(me : in out;
|
||||
S : in out Stripe from ChFiDS;
|
||||
Simul : Boolean from Standard = Standard_False)
|
||||
is static protected;
|
||||
|
||||
PerformSetOfKPart(me : in out;
|
||||
S : in out Stripe from ChFiDS;
|
||||
Simul : Boolean from Standard = Standard_False)
|
||||
is static protected;
|
||||
|
||||
PerformSetOfKGen(me : in out;
|
||||
S : in out Stripe from ChFiDS;
|
||||
Simul : Boolean from Standard = Standard_False)
|
||||
is static protected;
|
||||
|
||||
PerformSetOfSurfOnElSpine
|
||||
(me : in out;
|
||||
ES : HElSpine from ChFiDS;
|
||||
St : in out Stripe from ChFiDS;
|
||||
It1,It2 : in out TopolTool from BRepTopAdaptor;
|
||||
Simul : Boolean from Standard = Standard_False)
|
||||
is static private;
|
||||
|
||||
Trunc(me : in out;
|
||||
SD : SurfData from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
iedge : Integer from Standard;
|
||||
isfirst : Boolean from Standard;
|
||||
cntlFiOnS : Integer from Standard) -- eap, occ354
|
||||
is static protected;
|
||||
|
||||
SplitKPart(me : in out;
|
||||
Data : SurfData from ChFiDS;
|
||||
SetData : out SequenceOfSurfData from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Iedge : Integer from Standard;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
|
||||
returns Boolean from Standard is static;
|
||||
---Purpose: Methode, implementee dans les heritants, calculant
|
||||
-- les elements de construction de la surface (conge
|
||||
-- ou chanfrein).
|
||||
|
||||
CallPerformSurf(me : in out;
|
||||
Stripe : in out Stripe from ChFiDS;
|
||||
Simul : Boolean from Standard;
|
||||
SeqSD : in out SequenceOfSurfData from ChFiDS;
|
||||
SD : in out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
HS1, HS3 : HSurface from BRepAdaptor;
|
||||
P1, P3 : Pnt2d from gp;
|
||||
I1 : in out TopolTool from Adaptor3d;
|
||||
HS2, HS4 : HSurface from BRepAdaptor;
|
||||
P2, P4 : Pnt2d from gp;
|
||||
I2 : in out TopolTool from Adaptor3d;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : in out Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard;
|
||||
Surf1,Surf2 : in out HSurface from BRepAdaptor)
|
||||
is protected;
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean
|
||||
is deferred protected;
|
||||
---Purpose: Methode, implementee dans les heritants, calculant
|
||||
-- les elements de construction de la surface (conge
|
||||
-- ou chanfrein).
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is virtual protected;
|
||||
---Purpose: Method, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/face.
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is virtual protected;
|
||||
---Purpose: Method, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/face.
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is virtual protected;
|
||||
---Purpose: Method, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/edge.
|
||||
|
||||
PerformFilletOnVertex(me : in out;
|
||||
Index: Integer from Standard)
|
||||
is static private;
|
||||
|
||||
PerformSingularCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is static private;
|
||||
|
||||
PerformOneCorner(me : in out ;
|
||||
Index : Integer from Standard;
|
||||
PrepareOnSame : Boolean from Standard = Standard_False)
|
||||
is static private;
|
||||
|
||||
IntersectMoreCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is static private;
|
||||
|
||||
PerformMoreSurfdata(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is static private;
|
||||
|
||||
PerformTwoCornerbyInter(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
PerformTwoCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is deferred protected;
|
||||
|
||||
|
||||
PerformThreeCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is deferred protected;
|
||||
|
||||
PerformMoreThreeCorner(me : in out ;
|
||||
Index : Integer from Standard;
|
||||
nbcourb : Integer from Standard)
|
||||
is static protected;
|
||||
|
||||
PerformIntersectionAtEnd (me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is static private;
|
||||
|
||||
ExtentAnalyse(me : in out)
|
||||
is static private;
|
||||
|
||||
ExtentOneCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
S : Stripe from ChFiDS)
|
||||
is deferred protected;
|
||||
|
||||
ExtentTwoCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is deferred protected;
|
||||
|
||||
ExtentThreeCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is deferred protected;
|
||||
|
||||
FindFace(me;
|
||||
V : Vertex from TopoDS;
|
||||
P1,P2 : CommonPoint from ChFiDS;
|
||||
Fv : out Face from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is static private;
|
||||
|
||||
FindFace(me;
|
||||
V : Vertex from TopoDS;
|
||||
P1,P2 : CommonPoint from ChFiDS;
|
||||
Fv : out Face from TopoDS;
|
||||
Favoid: Face from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is static private;
|
||||
|
||||
MoreSurfdata(me;
|
||||
Index : Integer from Standard )
|
||||
returns Boolean from Standard
|
||||
is static private;
|
||||
|
||||
StartSol(me;
|
||||
Spine : Spine from ChFiDS;
|
||||
HS : in out HSurface from BRepAdaptor;
|
||||
P : in out Pnt2d from gp;
|
||||
HC : in out HCurve2d from BRepAdaptor;
|
||||
W : in out Real from Standard;
|
||||
SD : SurfData from ChFiDS;
|
||||
isFirst : Boolean from Standard;
|
||||
OnS : Integer from Standard;
|
||||
HSref : in out HSurface from BRepAdaptor;
|
||||
HCref : in out HCurve2d from BRepAdaptor;
|
||||
RecP : out Boolean from Standard;
|
||||
RecS : out Boolean from Standard;
|
||||
RecRst : out Boolean from Standard;
|
||||
C1Obst : out Boolean from Standard;
|
||||
HSbis : in out HSurface from BRepAdaptor;
|
||||
Pbis : in out Pnt2d from gp;
|
||||
Decroch : Boolean from Standard;
|
||||
Vref : Vertex from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is static private;
|
||||
|
||||
StartSol(me;
|
||||
S : Stripe from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
HS1,HS2 : in out HSurface from BRepAdaptor;
|
||||
I1,I2 : in out TopolTool from BRepTopAdaptor;
|
||||
P1,P2 : in out Pnt2d from gp;
|
||||
First : in out Real from Standard)
|
||||
is static private;
|
||||
|
||||
PerformFirstSection(me ;
|
||||
S : Spine from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1,S2 : in out HSurface from BRepAdaptor;
|
||||
I1,I2 : TopolTool from Adaptor3d;
|
||||
Par : Real from Standard;
|
||||
SolDep : in out Vector from math;
|
||||
Pos1,Pos2 : out State from TopAbs)
|
||||
returns Boolean from Standard
|
||||
is deferred protected;
|
||||
|
||||
SearchFace(me;
|
||||
Sp : Spine from ChFiDS;
|
||||
Pc : CommonPoint from ChFiDS;
|
||||
FRef : Face from TopoDS;
|
||||
FVoi : out Face from TopoDS)
|
||||
returns Boolean from Standard
|
||||
is static protected;
|
||||
|
||||
ConexFaces(me;
|
||||
Sp : Spine from ChFiDS;
|
||||
IEdge : Integer from Standard;
|
||||
RefChoix : Integer from Standard;
|
||||
HS1,HS2 : out HSurface from BRepAdaptor)
|
||||
is static private;
|
||||
|
||||
StripeOrientations(me;
|
||||
Sp : Spine from ChFiDS;
|
||||
Or1,Or2 : out Orientation from TopAbs;
|
||||
ChoixConge : out Integer from Standard)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
ComputeData(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Lin : out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Func : in out Function from Blend;
|
||||
FInv : in out FuncInv from Blend;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard;
|
||||
Gd1,Gd2,Gf1,Gf2 : out Boolean from Standard;
|
||||
RecOnS1 : Boolean from Standard = Standard_False;
|
||||
RecOnS2 : Boolean from Standard = Standard_False)
|
||||
---Purpose: Calculates a Line of contact face/face.
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
ComputeData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
PC2 : HCurve2d from Adaptor2d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Decroch : out Boolean from Standard;
|
||||
Func : in out SurfRstFunction from Blend;
|
||||
FInv : in out FuncInv from Blend;
|
||||
FInvP : in out SurfPointFuncInv from Blend;
|
||||
FInvC : in out SurfCurvFuncInv from Blend;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First : in out Real from Standard;
|
||||
Last : in out Real from Standard;
|
||||
Soldep : Vector from math;
|
||||
Inside : Boolean from Standard;
|
||||
Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard)
|
||||
---Purpose: Calculates a Line of contact edge/face.
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
|
||||
ComputeData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
PC1 : HCurve2d from Adaptor2d;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
PC2 : HCurve2d from Adaptor2d;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
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;
|
||||
PFirst : Real from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First : in out Real from Standard;
|
||||
Last : in out Real from Standard;
|
||||
Soldep : Vector from math;
|
||||
Inside : Boolean from Standard;
|
||||
Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecP1, RecRst1 : Boolean from Standard;
|
||||
RecP2, RecRst2 : Boolean from Standard)
|
||||
---Purpose: Calculated a Line of contact edge/edge.
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
|
||||
CompleteData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
Func : in out Function from Blend;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
Gd1,Gd2,Gf1,Gf2 : Boolean from Standard;
|
||||
Reversed : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
CompleteData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
Func : in out SurfRstFunction from Blend;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
Or : Orientation from TopAbs;
|
||||
Reversed : Boolean from Standard)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
CompleteData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
Func : in out RstRstFunction from Blend;
|
||||
Lin : in out Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
Or : Orientation from TopAbs)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
|
||||
|
||||
StoreData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
Approx : Approx from AppBlend;
|
||||
Lin : Line from BRepBlend;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
Gd1,Gd2,Gf1,Gf2 : Boolean from Standard;
|
||||
Reversed : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
CompleteData(me : in out;
|
||||
Data : in out SurfData from ChFiDS;
|
||||
Surfcoin : Surface from Geom;
|
||||
S1 : HSurface from Adaptor3d;
|
||||
PC1 : Curve from Geom2d;
|
||||
S2 : HSurface from Adaptor3d;
|
||||
PC2 : Curve from Geom2d;
|
||||
Or : Orientation from TopAbs;
|
||||
On1 : Boolean from Standard;
|
||||
Gd1,Gd2,Gf1,Gf2 : Boolean from Standard)
|
||||
returns Boolean from Standard is static protected;
|
||||
|
||||
fields
|
||||
|
||||
-- La piece d entree
|
||||
myShape : Shape from TopoDS;
|
||||
|
||||
-- Donnees numeriques (tolerances) REMARQUE : il faut virer les tol2d!!!
|
||||
angular : Real from Standard; -- tangence entre aretes
|
||||
tolappangle : Real from Standard is protected; -- approx angulaire
|
||||
tolesp : Real from Standard is protected; -- confusion 3d : def 1.e-4
|
||||
tol2d : Real from Standard is protected; -- confusion 2d : def 1.e-5
|
||||
tolapp3d : Real from Standard is protected; -- approx 3d : def 1.e-4
|
||||
tolapp2d : Real from Standard is protected; -- approx 2d : def 1.e-5
|
||||
fleche : Real from Standard is protected; -- fleche du walking : def 1.e-6
|
||||
|
||||
-- Continuite pour la geometrie approximee
|
||||
myConti : Shape from GeomAbs is protected;
|
||||
|
||||
-- Maps de pointeurs arrieres pour travailler
|
||||
myEFMap : Map from ChFiDS is protected;
|
||||
myESoMap : Map from ChFiDS is protected;
|
||||
myEShMap : Map from ChFiDS is protected;
|
||||
myVFMap : Map from ChFiDS is protected;
|
||||
myVEMap : Map from ChFiDS is protected;
|
||||
|
||||
-- Les outils de stockage et de reconstruction
|
||||
myDS : HDataStructure from TopOpeBRepDS is protected;
|
||||
myCoup : HBuilder from TopOpeBRepBuild is protected;
|
||||
|
||||
-- Les outils de stockage interne
|
||||
myListStripe : ListOfStripe from ChFiDS is protected;
|
||||
myVDataMap : StripeMap from ChFiDS is protected;
|
||||
myRegul : Regularities from ChFiDS is protected;
|
||||
|
||||
-- Les stripes dont le calcul a plante
|
||||
badstripes : ListOfStripe from ChFiDS is protected;
|
||||
|
||||
-- Les vertex au voisinage desquels la finition a plante
|
||||
badvertices : ListOfShape from TopTools is protected;
|
||||
|
||||
-- donnees calculees pendant le compute pour l historique
|
||||
myGenerated : ListOfShape from TopTools;
|
||||
myEVIMap : DataMapOfShapeListOfInteger from TopTools is protected;
|
||||
|
||||
-- flag si tout s est bien passe
|
||||
done : Boolean from Standard is protected;
|
||||
|
||||
-- le resultat
|
||||
myShapeResult : Shape from TopoDS;
|
||||
|
||||
-- flag si il y a un resultat partiel(badshape)
|
||||
hasresult : Boolean from Standard is protected;
|
||||
|
||||
-- resultat partiel eventuel
|
||||
badShape : Shape from TopoDS;
|
||||
|
||||
|
||||
end Builder;
|
813
src/ChFi3d/ChFi3d_Builder.cxx
Executable file
813
src/ChFi3d/ChFi3d_Builder.cxx
Executable file
@@ -0,0 +1,813 @@
|
||||
// File: ChFi3d_Builder.cxx
|
||||
// Created: Thu Nov 18 15:59:35 1993
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#include <ChFi3d_Builder.ixx>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <TopOpeBRepDS_CurveExplorer.hxx>
|
||||
#include <TopOpeBRepDS_CurvePointInterference.hxx>
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <TopOpeBRepDS_BuildTool.hxx>
|
||||
#include <TopOpeBRepDS_Curve.hxx>
|
||||
#include <TopOpeBRepDS_PointIterator.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
|
||||
#include <ChFiDS_SequenceOfSurfData.hxx>
|
||||
#include <ChFiDS_HData.hxx>
|
||||
|
||||
#include <ChFi3d.hxx>
|
||||
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
#include <TopOpeBRepDS_ListOfInterference.hxx>
|
||||
|
||||
|
||||
#ifdef DRAW
|
||||
#include <TestTopOpeTools.hxx>
|
||||
#include <TestTopOpe.hxx>
|
||||
#endif
|
||||
#ifdef DEB
|
||||
#include <OSD_Chronometer.hxx>
|
||||
|
||||
// variables pour les performances
|
||||
|
||||
|
||||
OSD_Chronometer cl_total,cl_extent,cl_perfsetofsurf,cl_perffilletonvertex,
|
||||
cl_filds,cl_reconstruction,cl_setregul,cl_perform1corner,cl_perform2corner,
|
||||
cl_performatend,cl_perform3corner,cl_performmore3corner;
|
||||
|
||||
Standard_EXPORT Standard_Real t_total, t_extent,t_perfsetofsurf,
|
||||
t_perffilletonvertex, t_filds,t_reconstruction,t_setregul, t_perfsetofkgen,
|
||||
t_perfsetofkpart,t_makextremities,t_performatend,t_startsol,t_performsurf,
|
||||
t_perform1corner,t_perform2corner,t_perform3corner,t_performmore3corner,
|
||||
t_batten,t_inter,t_sameinter,t_same,t_plate,t_approxplate,t_t2cornerinit,
|
||||
t_perf2cornerbyinter,t_chfikpartcompdata,t_cheminement,t_remplissage,
|
||||
t_t3cornerinit ,t_spherique,t_torique, t_notfilling,t_filling,t_sameparam,
|
||||
t_computedata,t_completedata,t_t2cornerDS,t_t3cornerDS;
|
||||
|
||||
//Standard_IMPORT extern void ChFi3d_InitChron(OSD_Chronometer& ch);
|
||||
Standard_IMPORT void ChFi3d_InitChron(OSD_Chronometer& ch);
|
||||
//Standard_IMPORT extern void ChFi3d_ResultChron(OSD_Chronometer & ch,
|
||||
Standard_IMPORT void ChFi3d_ResultChron(OSD_Chronometer & ch,
|
||||
Standard_Real& time);
|
||||
extern Standard_Boolean ChFi3d_GettraceCHRON();
|
||||
#endif
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : CompleteDS
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void CompleteDS(TopOpeBRepDS_DataStructure& DStr,
|
||||
const TopoDS_Shape& S)
|
||||
{
|
||||
ChFiDS_Map MapEW,MapFS;
|
||||
MapEW.Fill(S,TopAbs_EDGE,TopAbs_WIRE);
|
||||
MapFS.Fill(S,TopAbs_FACE,TopAbs_SHELL);
|
||||
|
||||
TopExp_Explorer ExpE;
|
||||
for (ExpE.Init(S,TopAbs_EDGE); ExpE.More(); ExpE.Next()) {
|
||||
const TopoDS_Edge& E = TopoDS::Edge(ExpE.Current());
|
||||
Standard_Boolean hasgeom = DStr.HasGeometry(E);
|
||||
if (hasgeom) {
|
||||
const TopTools_ListOfShape& WireListAnc = MapEW(E);
|
||||
TopTools_ListIteratorOfListOfShape itaW(WireListAnc);
|
||||
while (itaW.More()) {
|
||||
const TopoDS_Shape& WireAnc = itaW.Value();
|
||||
DStr.AddShape(WireAnc);
|
||||
itaW.Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TopExp_Explorer ExpF;
|
||||
for (ExpF.Init(S,TopAbs_FACE); ExpF.More(); ExpF.Next()) {
|
||||
const TopoDS_Face& F = TopoDS::Face(ExpF.Current());
|
||||
Standard_Boolean hasgeom = DStr.HasGeometry(F);
|
||||
if (hasgeom) {
|
||||
const TopTools_ListOfShape& ShellListAnc = MapFS(F);
|
||||
TopTools_ListIteratorOfListOfShape itaS(ShellListAnc);
|
||||
while (itaS.More()) {
|
||||
const TopoDS_Shape& ShellAnc = itaS.Value();
|
||||
DStr.AddShape(ShellAnc);
|
||||
itaS.Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set the range on the DS Curves
|
||||
for (Standard_Integer ic = 1; ic <= DStr.NbCurves(); ic++) {
|
||||
Standard_Real parmin = RealLast(), parmax = RealFirst();
|
||||
const TopOpeBRepDS_ListOfInterference& LI = DStr.CurveInterferences(ic);
|
||||
for (TopOpeBRepDS_PointIterator it(LI);
|
||||
it.More();
|
||||
it.Next() ) {
|
||||
Standard_Real par = it.Parameter();
|
||||
parmin = Min (parmin,par); parmax = Max (parmax,par);
|
||||
}
|
||||
DStr.ChangeCurve(ic).SetRange(parmin,parmax);
|
||||
}
|
||||
}
|
||||
|
||||
void ChFi3d_Builder::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtentAnalyse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::ExtentAnalyse ()
|
||||
{
|
||||
Standard_Integer nbedges, nbs;
|
||||
for (Standard_Integer iv = 1; iv <= myVDataMap.Extent(); iv++) {
|
||||
nbs = myVDataMap(iv).Extent();
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(iv);
|
||||
nbedges = ChFi3d_NumberOfEdges(Vtx, myVEMap);
|
||||
switch (nbs) {
|
||||
case 1 :
|
||||
ExtentOneCorner(Vtx, myVDataMap.FindFromIndex(iv).First());
|
||||
break;
|
||||
case 2 :
|
||||
if (nbedges <= 3)
|
||||
ExtentTwoCorner(Vtx, myVDataMap.FindFromIndex(iv));
|
||||
break;
|
||||
case 3 :
|
||||
if (nbedges <= 3)
|
||||
ExtentThreeCorner(Vtx, myVDataMap.FindFromIndex(iv));
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Compute
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::Compute()
|
||||
{
|
||||
|
||||
#ifdef DEB //perf
|
||||
t_total=0;t_extent=0; t_perfsetofsurf=0;t_perffilletonvertex=0;
|
||||
t_filds=0;t_reconstruction=0;t_setregul=0;
|
||||
t_perfsetofkpart=0; t_perfsetofkgen=0;t_makextremities=0;
|
||||
t_performsurf=0;t_startsol=0; t_perform1corner=0;t_perform2corner=0;
|
||||
t_perform3corner=0;t_performmore3corner=0;t_inter=0;t_same=0;t_sameinter=0;
|
||||
t_plate=0;t_approxplate=0; t_batten=0;t_remplissage=0;t_t3cornerinit=0;
|
||||
t_spherique=0;t_torique=0;t_notfilling=0;t_filling=0;t_performatend=0;
|
||||
t_t2cornerinit=0; t_perf2cornerbyinter=0;t_chfikpartcompdata=0;
|
||||
t_cheminement=0; t_sameparam=0; t_computedata=0;t_completedata=0;
|
||||
t_t2cornerDS=0;t_t3cornerDS=0;
|
||||
ChFi3d_InitChron(cl_total);
|
||||
ChFi3d_InitChron(cl_extent);
|
||||
#endif
|
||||
|
||||
if (myListStripe.IsEmpty())
|
||||
Standard_Failure::Raise("There are no suitable edges for chamfer or fillet");
|
||||
|
||||
Reset();
|
||||
myDS = new TopOpeBRepDS_HDataStructure();
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
done = Standard_True;
|
||||
hasresult=Standard_False;
|
||||
#ifdef DRAW
|
||||
TestTopOpe::CurrentDS(myDS);
|
||||
TopoDS_Shape bids;
|
||||
TestTopOpe::Shapes(myShape,bids);
|
||||
#endif
|
||||
|
||||
// remplissage de myVDatatMap
|
||||
ChFiDS_ListIteratorOfListOfStripe itel;
|
||||
|
||||
for (itel.Initialize(myListStripe);itel.More(); itel.Next()) {
|
||||
if ((itel.Value()->Spine()->FirstStatus() <= ChFiDS_BreakPoint))
|
||||
myVDataMap.Add(itel.Value()->Spine()->FirstVertex(),itel.Value());
|
||||
else if (itel.Value()->Spine()->FirstStatus() == ChFiDS_FreeBoundary)
|
||||
ExtentOneCorner(itel.Value()->Spine()->FirstVertex(),itel.Value());
|
||||
if ((itel.Value()->Spine()->LastStatus() <= ChFiDS_BreakPoint))
|
||||
myVDataMap.Add(itel.Value()->Spine()->LastVertex() ,itel.Value());
|
||||
else if (itel.Value()->Spine()->LastStatus() == ChFiDS_FreeBoundary)
|
||||
ExtentOneCorner(itel.Value()->Spine()->LastVertex(),itel.Value());
|
||||
}
|
||||
// preanalyse pour evaluer les prolongements.
|
||||
ExtentAnalyse();
|
||||
|
||||
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_extent,t_extent);
|
||||
ChFi3d_InitChron(cl_perfsetofsurf);
|
||||
#endif
|
||||
|
||||
// Construction de la bande de conge sur chaque stripe.
|
||||
for (itel.Initialize(myListStripe);itel.More(); itel.Next()) {
|
||||
itel.Value()->Spine()->SetErrorStatus(ChFiDS_Ok);
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
PerformSetOfSurf(itel.Value());
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
Handle(Standard_Failure) exc = Standard_Failure::Caught();
|
||||
#ifdef DEB
|
||||
cout <<"EXCEPTION Stripe compute " << exc << endl;
|
||||
#endif
|
||||
badstripes.Append(itel.Value());
|
||||
done = Standard_True;
|
||||
if (itel.Value()->Spine()->ErrorStatus()==ChFiDS_Ok)
|
||||
itel.Value()->Spine()->SetErrorStatus(ChFiDS_Error);
|
||||
}
|
||||
if (!done) badstripes.Append(itel.Value());
|
||||
done = Standard_True;
|
||||
}
|
||||
done = (badstripes.IsEmpty());
|
||||
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_perfsetofsurf,t_perfsetofsurf);
|
||||
ChFi3d_InitChron(cl_perffilletonvertex);
|
||||
#endif
|
||||
|
||||
//construire les conges sur chaque vertex +alimenter la Ds
|
||||
if (done) {
|
||||
//Standard_Integer nbresult=0;
|
||||
// for (Standard_Integer j=1;j<=myVDataMap.Extent();j++) {
|
||||
#ifndef DEB
|
||||
static
|
||||
#endif //to avoid Linux warning:<< variable `j' might be clobbered by `longjmp' or `vfork' >>
|
||||
Standard_Integer j;
|
||||
for (j=1;j<=myVDataMap.Extent();j++) {
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
PerformFilletOnVertex(j);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
Handle(Standard_Failure) exc = Standard_Failure::Caught();
|
||||
#ifdef DEB
|
||||
cout <<"EXCEPTION Corner compute " << exc << endl;
|
||||
#endif
|
||||
badvertices.Append(myVDataMap.FindKey(j));
|
||||
hasresult=Standard_False;
|
||||
done = Standard_True;
|
||||
}
|
||||
if (!done) badvertices.Append(myVDataMap.FindKey(j));
|
||||
done = Standard_True;
|
||||
}
|
||||
if (!hasresult) done = badvertices.IsEmpty();
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_perffilletonvertex,t_perffilletonvertex);
|
||||
ChFi3d_InitChron(cl_filds);
|
||||
#endif
|
||||
|
||||
TColStd_MapOfInteger MapIndSo;
|
||||
TopExp_Explorer expso(myShape,TopAbs_SOLID);
|
||||
for(; expso.More(); expso.Next()){
|
||||
const TopoDS_Shape& cursol = expso.Current();
|
||||
Standard_Integer indcursol = DStr.AddShape(cursol);
|
||||
MapIndSo.Add(indcursol);
|
||||
}
|
||||
TopExp_Explorer expsh(myShape,TopAbs_SHELL,TopAbs_SOLID);
|
||||
for(; expsh.More(); expsh.Next()){
|
||||
const TopoDS_Shape& cursh = expsh.Current();
|
||||
Standard_Integer indcursh = DStr.AddShape(cursh);
|
||||
MapIndSo.Add(indcursh);
|
||||
}
|
||||
if (done) {
|
||||
Standard_Integer i1;
|
||||
for (itel.Initialize(myListStripe), i1=0;
|
||||
itel.More();
|
||||
itel.Next(), i1++) {
|
||||
const Handle(ChFiDS_Stripe)& st = itel.Value();
|
||||
// 05/02/02 akm vvv : (OCC119) First we'll check ain't there
|
||||
// intersections between fillets
|
||||
ChFiDS_ListIteratorOfListOfStripe itel1;
|
||||
Standard_Integer i2;
|
||||
for (itel1.Initialize(myListStripe), i2=0;
|
||||
itel1.More();
|
||||
itel1.Next(), i2++) {
|
||||
if (i2 <= i1)
|
||||
// Do not twice intersect the stripes
|
||||
continue;
|
||||
Handle(ChFiDS_Stripe) aCheckStripe = itel1.Value();
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
ChFi3d_StripeEdgeInter (st, aCheckStripe, DStr, tol2d);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
Handle(Standard_Failure) exc = Standard_Failure::Caught();
|
||||
#ifdef DEB
|
||||
cout <<"EXCEPTION Fillets compute " << exc << endl;
|
||||
#endif
|
||||
badstripes.Append(itel.Value());
|
||||
hasresult=Standard_False;
|
||||
done = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 05/02/02 akm ^^^
|
||||
Standard_Integer solidindex = st->SolidIndex();
|
||||
ChFi3d_FilDS(solidindex,st,DStr,myRegul,tolesp,tol2d);
|
||||
if (!done) break;
|
||||
}
|
||||
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_filds,t_filds);
|
||||
ChFi3d_InitChron(cl_reconstruction);
|
||||
#endif
|
||||
|
||||
|
||||
if (done) {
|
||||
BRep_Builder B1;
|
||||
CompleteDS(DStr,myShape);
|
||||
//Update des tolerances sur vertex au max des aretes adjacentes ou
|
||||
//Update des tolerances sur arete degeneree au max des vertex adjacents.
|
||||
TopOpeBRepDS_CurveExplorer cex(DStr);
|
||||
for(;cex.More();cex.Next()){
|
||||
TopOpeBRepDS_Curve& c = *((TopOpeBRepDS_Curve*)(void*)&(cex.Curve()));
|
||||
Standard_Real tolc = 0.;
|
||||
Standard_Boolean degen = c.Curve().IsNull();
|
||||
if(!degen) tolc = c.Tolerance();
|
||||
Standard_Integer ic = cex.Index();
|
||||
TopOpeBRepDS_PointIterator It(myDS->CurvePoints(ic));
|
||||
for(;It.More();It.Next()){
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) II;
|
||||
II = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(It.Value());
|
||||
if (II.IsNull()) continue;
|
||||
TopOpeBRepDS_Kind gk = II->GeometryType();
|
||||
Standard_Integer gi = II->Geometry();
|
||||
if(gk == TopOpeBRepDS_VERTEX){
|
||||
const TopoDS_Vertex& v = TopoDS::Vertex(myDS->Shape(gi));
|
||||
Standard_Real tolv = BRep_Tool::Tolerance(v);
|
||||
if( tolv > 0.0001 ) {
|
||||
tolv += 0.0003;
|
||||
if( tolc < tolv ) tolc = tolv + 0.00001;
|
||||
}
|
||||
if(degen && tolc < tolv) tolc = tolv;
|
||||
else if(tolc>tolv) B1.UpdateVertex(v,tolc);
|
||||
}
|
||||
else if(gk == TopOpeBRepDS_POINT){
|
||||
TopOpeBRepDS_Point& p = DStr.ChangePoint(gi);
|
||||
Standard_Real tolp = p.Tolerance();
|
||||
if(degen && tolc < tolp) tolc = tolp;
|
||||
else if(tolc>tolp) p.Tolerance(tolc);
|
||||
}
|
||||
}
|
||||
if(degen) c.Tolerance(tolc);
|
||||
}
|
||||
myCoup->Perform(myDS);
|
||||
TColStd_MapIteratorOfMapOfInteger It(MapIndSo);
|
||||
for(; It.More(); It.Next()){
|
||||
Standard_Integer indsol = It.Key();
|
||||
const TopoDS_Shape& curshape = DStr.Shape(indsol);
|
||||
myCoup->MergeSolid(curshape,TopAbs_IN);
|
||||
}
|
||||
|
||||
Standard_Integer i=1,n=DStr.NbShapes();
|
||||
for (;i<=n;i++) {
|
||||
const TopoDS_Shape S = DStr.Shape(i);
|
||||
if (S.ShapeType() != TopAbs_EDGE) continue;
|
||||
Standard_Boolean issplitIN = myCoup->IsSplit(S,TopAbs_IN);
|
||||
if ( !issplitIN ) continue;
|
||||
TopTools_ListIteratorOfListOfShape it(myCoup->Splits(S,TopAbs_IN));
|
||||
for (; it.More(); it.Next() ) {
|
||||
const TopoDS_Edge& newE = TopoDS::Edge(it.Value());
|
||||
Standard_Real tole = BRep_Tool::Tolerance(newE);
|
||||
TopExp_Explorer exv(newE,TopAbs_VERTEX);
|
||||
for (; exv.More(); exv.Next() ) {
|
||||
const TopoDS_Vertex& v = TopoDS::Vertex(exv.Current());
|
||||
Standard_Real tolv = BRep_Tool::Tolerance(v);
|
||||
if (tole>tolv) B1.UpdateVertex(v,tole);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasresult) {
|
||||
B1.MakeCompound(TopoDS::Compound(myShapeResult));
|
||||
for(It.Reset(); It.More(); It.Next()){
|
||||
Standard_Integer indsol = It.Key();
|
||||
const TopoDS_Shape& curshape = DStr.Shape(indsol);
|
||||
TopTools_ListIteratorOfListOfShape
|
||||
its = myCoup->Merged(curshape,TopAbs_IN);
|
||||
if(!its.More()) B1.Add(myShapeResult,curshape);
|
||||
else {
|
||||
//Si l'ancien type est du Shape est un Shell, on mettre un Shell et non un Solid, Il reste neanmoins un pbleme pour compound de Shell ouvert.
|
||||
while (its.More()) {
|
||||
const TopAbs_ShapeEnum letype = curshape.ShapeType();
|
||||
if (letype == TopAbs_SHELL){
|
||||
TopExp_Explorer expsh2(its.Value(),TopAbs_SHELL);
|
||||
const TopoDS_Shape& cursh = expsh2.Current();
|
||||
TopoDS_Shape tt = cursh;
|
||||
B1.Add(myShapeResult,cursh);
|
||||
its.Next();
|
||||
}
|
||||
else {
|
||||
B1.Add(myShapeResult,its.Value());
|
||||
its.Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
done=Standard_False;
|
||||
B1.MakeCompound(TopoDS::Compound(badShape));
|
||||
for(It.Reset(); It.More(); It.Next()){
|
||||
Standard_Integer indsol = It.Key();
|
||||
const TopoDS_Shape& curshape = DStr.Shape(indsol);
|
||||
TopTools_ListIteratorOfListOfShape
|
||||
its = myCoup->Merged(curshape,TopAbs_IN);
|
||||
if(!its.More()) B1.Add(badShape,curshape);
|
||||
else {
|
||||
while (its.More()) {
|
||||
B1.Add(badShape,its.Value());
|
||||
its.Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_reconstruction ,t_reconstruction);
|
||||
ChFi3d_InitChron(cl_setregul);
|
||||
#endif
|
||||
|
||||
// On code les regularites apres coup.
|
||||
SetRegul();
|
||||
|
||||
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_setregul ,t_setregul);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_total,t_total);
|
||||
#endif
|
||||
|
||||
|
||||
// affichage des temps pour les perfs
|
||||
|
||||
#ifdef DEB
|
||||
cout<<endl;
|
||||
cout<<"COMPUTE: temps total "<<t_total<<"s dont :"<<endl;
|
||||
cout<<"- Init + ExtentAnalyse "<<t_extent<<"s"<<endl;
|
||||
cout<<"- PerformSetOfSurf "<<t_perfsetofsurf<<"s"<<endl;
|
||||
cout<<"- PerformFilletOnVertex "<<t_perffilletonvertex<<"s"<<endl;
|
||||
cout<<"- FilDS "<<t_filds<<"s"<<endl;
|
||||
cout<<"- Reconstruction "<<t_reconstruction<<"s"<<endl;
|
||||
cout<<"- SetRegul "<<t_setregul<<"s"<<endl<<endl;
|
||||
|
||||
if(ChFi3d_GettraceCHRON()){
|
||||
cout<<endl;
|
||||
cout <<"temps PERFORMSETOFSURF "<<t_perfsetofsurf <<"s dont : "<<endl;
|
||||
cout <<"- SetofKPart "<<t_perfsetofkpart<<"s"<<endl;
|
||||
cout <<"- SetofKGen "<< t_perfsetofkgen <<"s"<<endl;
|
||||
cout <<"- MakeExtremities "<<t_makextremities<<"s"<<endl<<endl;
|
||||
|
||||
|
||||
cout <<"temps SETOFKGEN "<< t_perfsetofkgen<<"s dont : "<<endl;
|
||||
cout<<"- PerformSurf "<<t_performsurf<<"s"<<endl;
|
||||
cout<<"- starsol "<< t_startsol <<"s"<<endl<<endl;
|
||||
|
||||
cout<<"temps PERFORMSURF "<<t_performsurf<<"s dont : " << endl;
|
||||
cout<<"- computedata "<<t_computedata<<"s"<<endl;
|
||||
cout<<"- completedata "<<t_completedata<<"s"<<endl<<endl;
|
||||
|
||||
|
||||
cout<<"temps PERFORMFILLETVERTEX "<<t_perffilletonvertex <<"s dont : " << endl;
|
||||
cout<<"- PerformOneCorner "<<t_perform1corner<<"s"<<endl;
|
||||
cout<<"- PerformIntersectionAtEnd "<<t_performatend<<"s"<<endl;
|
||||
cout<<"- PerformTwoCorner "<<t_perform2corner<<"s"<<endl;
|
||||
cout<<"- PerformThreeCorner "<<t_perform3corner<<"s"<<endl;
|
||||
cout<<"- PerformMoreThreeCorner "<<t_performmore3corner<<"s"<<endl<<endl;
|
||||
|
||||
|
||||
cout<<"temps PerformOneCorner "<<t_perform1corner<<"s dont:"<<endl;
|
||||
cout<<"- temps condition if (same) "<<t_same << "s "<<endl;
|
||||
cout<<"- temps condition if (inter) "<<t_inter<<"s " <<endl;
|
||||
cout<<"- temps condition if (same inter) "<<t_sameinter<<"s " <<endl<<endl;
|
||||
|
||||
cout<<"temps PerformTwocorner "<<t_perform2corner<<"s dont:"<<endl;
|
||||
cout<<"- temps initialisation "<< t_t2cornerinit<<"s"<<endl;
|
||||
cout<<"- temps PerformTwoCornerbyInter "<<t_perf2cornerbyinter<<"s"<<endl;
|
||||
cout<<"- temps ChFiKPart_ComputeData "<<t_chfikpartcompdata <<"s"<<endl;
|
||||
cout<<"- temps cheminement "<<t_cheminement<<"s"<<endl;
|
||||
cout<<"- temps remplissage "<<t_remplissage<<"s"<<endl;
|
||||
cout<<"- temps mise a jour stripes "<<t_t2cornerDS<<"s"<<endl<<endl;
|
||||
|
||||
cout<<" temps PerformThreecorner "<<t_perform3corner<<"s dont:"<<endl;
|
||||
cout<<"- temps initialisation "<< t_t3cornerinit<<"s"<<endl;
|
||||
cout<<"- temps cas spherique "<<t_spherique<<"s"<<endl;
|
||||
cout<<"- temps cas torique "<<t_torique<<"s"<<endl;
|
||||
cout<<"- temps notfilling "<<t_notfilling<<"s"<<endl;
|
||||
cout<<"- temps filling "<<t_filling<<"s"<<endl;
|
||||
cout<<"- temps mise a jour stripes "<<t_t3cornerDS<<"s"<<endl<<endl;
|
||||
|
||||
cout<<"temps PerformMore3Corner "<<t_performmore3corner<<"s dont:"<<endl;
|
||||
cout<<"-temps plate "<<t_plate << "s "<<endl;
|
||||
cout<<"-temps approxplate "<<t_approxplate<<"s " <<endl;
|
||||
cout<<"-temps batten "<< t_batten<<"s " <<endl<<endl;
|
||||
|
||||
cout <<"TEMPS DIVERS "<<endl;
|
||||
cout<<"-temps ChFi3d_sameparameter "<<t_sameparam<<"s"<<endl<<endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformSingularCorner
|
||||
//purpose : Charge le vertex et les aretes degeneree.
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::PerformSingularCorner
|
||||
(const Standard_Integer Index){
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
Handle(ChFiDS_Stripe) stripe;
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
|
||||
|
||||
Handle(ChFiDS_SurfData) Fd;
|
||||
Standard_Integer i, Icurv;
|
||||
#ifndef DEB
|
||||
Standard_Integer Ivtx = 0;
|
||||
#else
|
||||
Standard_Integer Ivtx;
|
||||
#endif
|
||||
for (It.Initialize(myVDataMap(Index)), i=0; It.More(); It.Next(),i++){
|
||||
stripe = It.Value();
|
||||
// la SurfData en cause et ses CommonPoints,
|
||||
Standard_Integer sens = 0;
|
||||
Standard_Integer num = ChFi3d_IndexOfSurfData(Vtx,stripe,sens);
|
||||
Standard_Boolean isfirst = (sens == 1);
|
||||
Fd = stripe->SetOfSurfData()->Sequence().Value(num);
|
||||
const ChFiDS_CommonPoint& CV1 = Fd->Vertex(isfirst,1);
|
||||
const ChFiDS_CommonPoint& CV2 = Fd->Vertex(isfirst,2);
|
||||
// Est ce toujours degenere ?
|
||||
if ( CV1.Point().IsEqual( CV2.Point(), 0) ) {
|
||||
// si oui on stoke le vertex dans la stripe
|
||||
// et on fabrique l'arete en bout
|
||||
if (i==0) Ivtx = ChFi3d_IndexPointInDS(CV1, DStr);
|
||||
Standard_Real tolreached;
|
||||
Standard_Real Pardeb, Parfin;
|
||||
gp_Pnt2d VOnS1, VOnS2;
|
||||
Handle(Geom_Curve) C3d;
|
||||
Handle(Geom2d_Curve) PCurv;
|
||||
TopOpeBRepDS_Curve Crv;
|
||||
if (isfirst) {
|
||||
VOnS1 = Fd->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(Fd->InterferenceOnS1().FirstParameter());
|
||||
VOnS2 = Fd->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(Fd->InterferenceOnS2().FirstParameter());
|
||||
}
|
||||
else {
|
||||
VOnS1 = Fd->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(Fd->InterferenceOnS1().LastParameter());
|
||||
VOnS2 = Fd->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(Fd->InterferenceOnS2().LastParameter());
|
||||
}
|
||||
|
||||
ChFi3d_ComputeArete(CV1, VOnS1,
|
||||
CV2, VOnS2,
|
||||
DStr.Surface(Fd->Surf()).Surface(),
|
||||
C3d, PCurv,
|
||||
Pardeb,Parfin,tolapp3d,tolapp2d,tolreached,0);
|
||||
Crv = TopOpeBRepDS_Curve(C3d,tolreached);
|
||||
Icurv = DStr.AddCurve(Crv);
|
||||
|
||||
stripe->SetCurve(Icurv, isfirst);
|
||||
stripe->SetParameters(isfirst, Pardeb,Parfin);
|
||||
stripe->ChangePCurve(isfirst) = PCurv;
|
||||
stripe->SetIndexPoint(Ivtx, isfirst, 1);
|
||||
stripe->SetIndexPoint(Ivtx, isfirst, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformFilletOnVertex
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::PerformFilletOnVertex
|
||||
(const Standard_Integer Index){
|
||||
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
Handle(ChFiDS_Stripe) stripe;
|
||||
Handle(ChFiDS_Spine) sp;
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
|
||||
|
||||
Handle(ChFiDS_SurfData) Fd;
|
||||
Standard_Integer i;
|
||||
Standard_Boolean nondegenere = Standard_True;
|
||||
Standard_Boolean toujoursdegenere = Standard_True;
|
||||
#ifndef DEB
|
||||
Standard_Boolean isfirst = Standard_False;
|
||||
#else
|
||||
Standard_Boolean isfirst;
|
||||
#endif
|
||||
for (It.Initialize(myVDataMap(Index)), i=0; It.More(); It.Next(),i++){
|
||||
stripe = It.Value();
|
||||
sp = stripe->Spine();
|
||||
// la SurfData en cause et ses CommonPoints,
|
||||
Standard_Integer sens = 0;
|
||||
Standard_Integer num = ChFi3d_IndexOfSurfData(Vtx,stripe,sens);
|
||||
isfirst = (sens == 1);
|
||||
Fd = stripe->SetOfSurfData()->Sequence().Value(num);
|
||||
const ChFiDS_CommonPoint& CV1 = Fd->Vertex(isfirst,1);
|
||||
const ChFiDS_CommonPoint& CV2 = Fd->Vertex(isfirst,2);
|
||||
// Est ce toujours degenere ?
|
||||
if ( CV1.Point().IsEqual( CV2.Point(), 0) )
|
||||
nondegenere = Standard_False;
|
||||
else toujoursdegenere = Standard_False;
|
||||
}
|
||||
|
||||
// calcul du nombre de faces = nombre d'aretes
|
||||
/* TopTools_ListIteratorOfListOfShape ItF,JtF,ItE;
|
||||
Standard_Integer nbf = 0, jf = 0;
|
||||
for (ItF.Initialize(myVFMap(Vtx)); ItF.More(); ItF.Next()){
|
||||
jf++;
|
||||
Standard_Integer kf = 1;
|
||||
const TopoDS_Shape& cur = ItF.Value();
|
||||
for (JtF.Initialize(myVFMap(Vtx)); JtF.More() && (kf < jf); JtF.Next(), kf++){
|
||||
if(cur.IsSame(JtF.Value())) break;
|
||||
}
|
||||
if(kf == jf) nbf++;
|
||||
}
|
||||
Standard_Integer nba=myVEMap(Vtx).Extent();
|
||||
for (ItE.Initialize(myVEMap(Vtx)); ItE.More(); ItE.Next()){
|
||||
const TopoDS_Edge& cur = TopoDS::Edge(ItE.Value());
|
||||
if (BRep_Tool::Degenerated(cur)) nba--;
|
||||
}
|
||||
nba=nba/2;*/
|
||||
Standard_Integer nba = ChFi3d_NumberOfEdges(Vtx, myVEMap);
|
||||
|
||||
if (nondegenere) { // Traitement normal
|
||||
switch (i) {
|
||||
case 1 :
|
||||
{
|
||||
if(sp->Status(isfirst) == ChFiDS_FreeBoundary) return;
|
||||
if(nba>3) {
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_performatend);
|
||||
#endif
|
||||
PerformIntersectionAtEnd(Index);
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(cl_performatend,t_performatend);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_perform1corner);
|
||||
#endif
|
||||
if (MoreSurfdata(Index))
|
||||
PerformMoreSurfdata(Index);
|
||||
else PerformOneCorner(Index);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_perform1corner,t_perform1corner);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
{
|
||||
if(nba>3){
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_performmore3corner);
|
||||
#endif
|
||||
PerformMoreThreeCorner(Index, i);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_perform2corner);
|
||||
#endif
|
||||
PerformTwoCorner(Index);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_perform2corner,t_perform2corner);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
{
|
||||
if(nba>3){
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_performmore3corner);
|
||||
#endif
|
||||
PerformMoreThreeCorner(Index, i);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_perform3corner);
|
||||
#endif
|
||||
PerformThreeCorner(Index);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_perform3corner,t_perform3corner);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
default : {
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_InitChron(cl_performmore3corner);
|
||||
#endif
|
||||
PerformMoreThreeCorner(Index, i);
|
||||
#ifdef DEB //perf
|
||||
ChFi3d_ResultChron(cl_performmore3corner,t_performmore3corner);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // Traitement des cas singulier
|
||||
if (toujoursdegenere) PerformSingularCorner(Index);
|
||||
else PerformMoreThreeCorner(Index, i);//Derniere chance...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Reset
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::Reset()
|
||||
{
|
||||
done = Standard_False;
|
||||
myVDataMap.Clear();
|
||||
myRegul.Clear();
|
||||
myEVIMap.Clear();
|
||||
badstripes.Clear();
|
||||
badvertices.Clear();
|
||||
|
||||
ChFiDS_ListIteratorOfListOfStripe itel;
|
||||
for (itel.Initialize(myListStripe); itel.More(); ){
|
||||
if(!itel.Value()->Spine().IsNull()){
|
||||
itel.Value()->Reset();
|
||||
itel.Next();
|
||||
}
|
||||
else myListStripe.Remove(itel);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Generated
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TopTools_ListOfShape& ChFi3d_Builder::Generated(const TopoDS_Shape& EouV)
|
||||
{
|
||||
myGenerated.Clear();
|
||||
if(EouV.IsNull()) return myGenerated;
|
||||
if(EouV.ShapeType() != TopAbs_EDGE &&
|
||||
EouV.ShapeType() != TopAbs_VERTEX) return myGenerated;
|
||||
if(myEVIMap.IsBound(EouV)) {
|
||||
const TColStd_ListOfInteger& L = myEVIMap.Find(EouV);
|
||||
TColStd_ListIteratorOfListOfInteger IL;
|
||||
for(IL.Initialize(L); IL.More(); IL.Next()){
|
||||
Standard_Integer I = IL.Value();
|
||||
const TopTools_ListOfShape& LS = myCoup->NewFaces(I);
|
||||
TopTools_ListIteratorOfListOfShape ILS;
|
||||
for(ILS.Initialize(LS); ILS.More(); ILS.Next()){
|
||||
myGenerated.Append(ILS.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
return myGenerated;
|
||||
}
|
||||
|
||||
|
4962
src/ChFi3d/ChFi3d_Builder_0.cxx
Executable file
4962
src/ChFi3d/ChFi3d_Builder_0.cxx
Executable file
File diff suppressed because it is too large
Load Diff
570
src/ChFi3d/ChFi3d_Builder_0.hxx
Executable file
570
src/ChFi3d/ChFi3d_Builder_0.hxx
Executable file
@@ -0,0 +1,570 @@
|
||||
// File: ChFi3d_Builder_0.hxx
|
||||
// Created: Thu Mar 24 17:23:09 1994
|
||||
// Author: Isabelle GRIGNON
|
||||
// <isg@zerox>
|
||||
|
||||
|
||||
#ifndef ChFi3d_Builder_0_HeaderFile
|
||||
#define ChFi3d_Builder_0_HeaderFile
|
||||
|
||||
#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
|
||||
#include <TopOpeBRepDS_CurvePointInterference.hxx>
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <TopOpeBRepDS_Curve.hxx>
|
||||
#include <TopOpeBRepDS_Surface.hxx>
|
||||
#include <BRepBlend_Extremity.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <ChFiDS_Spine.hxx>
|
||||
#include <ChFiDS_HElSpine.hxx>
|
||||
#include <ChFiDS_CommonPoint.hxx>
|
||||
#include <ChFiDS_Regularities.hxx>
|
||||
#include <ChFiDS_FaceInterference.hxx>
|
||||
#include <ChFiDS_Map.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <IntSurf_LineOn2S.hxx>
|
||||
#include <IntSurf_TypeTrans.hxx>
|
||||
#include <GeomFill_Boundary.hxx>
|
||||
#include <GeomFill_BoundWithSurf.hxx>
|
||||
#include <GeomFill_SimpleBound.hxx>
|
||||
#include <GeomFill_ConstrainedFilling.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Extrema_LocateExtCC.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
#ifdef DEB
|
||||
#include <OSD_Chronometer.hxx>
|
||||
extern OSD_Chronometer simul,elspine,chemine;
|
||||
#endif
|
||||
|
||||
Standard_Real ChFi3d_InPeriod(const Standard_Real U,
|
||||
const Standard_Real UFirst,
|
||||
const Standard_Real ULast,
|
||||
const Standard_Real Eps);
|
||||
|
||||
void ChFi3d_Boite(const gp_Pnt2d& p1,const gp_Pnt2d& p2,
|
||||
Standard_Real& mu,Standard_Real& Mu,
|
||||
Standard_Real& mv,Standard_Real& Mv);
|
||||
|
||||
void ChFi3d_Boite(const gp_Pnt2d& p1,const gp_Pnt2d& p2,
|
||||
const gp_Pnt2d& p3,const gp_Pnt2d& p4,
|
||||
Standard_Real& Du,Standard_Real& Dv,
|
||||
Standard_Real& mu,Standard_Real& Mu,
|
||||
Standard_Real& mv,Standard_Real& Mv);
|
||||
|
||||
void ChFi3d_SetPointTolerance(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Bnd_Box& box,
|
||||
const Standard_Integer IP);
|
||||
|
||||
void ChFi3d_EnlargeBox(const Handle(Geom_Curve)& C,
|
||||
const Standard_Real wd,
|
||||
const Standard_Real wf,
|
||||
Bnd_Box& box1,
|
||||
Bnd_Box& box2);
|
||||
|
||||
void ChFi3d_EnlargeBox(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Handle(Geom2d_Curve)& PC,
|
||||
const Standard_Real wd,
|
||||
const Standard_Real wf,
|
||||
Bnd_Box& box1,
|
||||
Bnd_Box& box2);
|
||||
|
||||
void ChFi3d_EnlargeBox(const TopoDS_Edge& E,
|
||||
const TopTools_ListOfShape& LF,
|
||||
const Standard_Real w,
|
||||
Bnd_Box& box);
|
||||
|
||||
void ChFi3d_EnlargeBox(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_Stripe)& st,
|
||||
const Handle(ChFiDS_SurfData)& sd,
|
||||
Bnd_Box& b1,
|
||||
Bnd_Box& b2,
|
||||
const Standard_Boolean isfirst);
|
||||
|
||||
GeomAbs_Shape ChFi3d_evalconti(const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2);
|
||||
|
||||
void ChFi3d_conexfaces(const TopoDS_Edge& E,
|
||||
TopoDS_Face& F1,
|
||||
TopoDS_Face& F2,
|
||||
const ChFiDS_Map& EFMap);
|
||||
|
||||
ChFiDS_State ChFi3d_EdgeState(TopoDS_Edge* E,
|
||||
const ChFiDS_Map& EFMap);
|
||||
|
||||
Standard_Boolean ChFi3d_KParticular
|
||||
(const Handle(ChFiDS_Spine)& Spine,
|
||||
const Standard_Integer IE,
|
||||
const BRepAdaptor_Surface& S1,
|
||||
const BRepAdaptor_Surface& S2);
|
||||
|
||||
void ChFi3d_BoundFac(BRepAdaptor_Surface& S,
|
||||
const Standard_Real umin,
|
||||
const Standard_Real umax,
|
||||
const Standard_Real vmin,
|
||||
const Standard_Real vmax,
|
||||
const Standard_Boolean checknaturalbounds = Standard_True);
|
||||
|
||||
void ChFi3d_BoundSrf(GeomAdaptor_Surface& S,
|
||||
const Standard_Real umin,
|
||||
const Standard_Real umax,
|
||||
const Standard_Real vmin,
|
||||
const Standard_Real vmax,
|
||||
const Standard_Boolean checknaturalbounds = Standard_True);
|
||||
|
||||
Standard_Boolean ChFi3d_InterPlaneEdge (Handle(Adaptor3d_HSurface)& Plan,
|
||||
Handle(Adaptor3d_HCurve)& C,
|
||||
Standard_Real& W,
|
||||
const Standard_Boolean Sens,
|
||||
const Standard_Real tolc);
|
||||
|
||||
void ChFi3d_ExtrSpineCarac(const TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_Stripe)& cd,
|
||||
const Standard_Integer i,
|
||||
const Standard_Real p,
|
||||
const Standard_Integer jf,
|
||||
const Standard_Integer sens,
|
||||
gp_Pnt& P,
|
||||
gp_Vec& V,
|
||||
Standard_Real& R);
|
||||
|
||||
Handle(Geom_Circle) ChFi3d_CircularSpine(Standard_Real& WFirst,
|
||||
Standard_Real& WLast,
|
||||
const gp_Pnt& Pdeb,
|
||||
const gp_Vec& Vdeb,
|
||||
const gp_Pnt& Pfin,
|
||||
const gp_Vec& Vfin,
|
||||
const Standard_Real rad);
|
||||
|
||||
Handle(Geom_BezierCurve) ChFi3d_Spine(const gp_Pnt& pd,
|
||||
gp_Vec& vd,
|
||||
const gp_Pnt& pf,
|
||||
gp_Vec& vf,
|
||||
const Standard_Real R);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Adaptor3d_HSurface)& Fac,
|
||||
Handle(Geom2d_Curve)& curv,
|
||||
const Standard_Integer sens1,
|
||||
const gp_Pnt2d& pfac1,
|
||||
const gp_Vec2d& vfac1,
|
||||
const Standard_Integer sens2,
|
||||
const gp_Pnt2d& pfac2,
|
||||
const gp_Vec2d& vfac2,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
Handle(Geom2d_Curve)& curv,
|
||||
const Standard_Integer sens1,
|
||||
const gp_Pnt2d& p1,
|
||||
gp_Vec& v1,
|
||||
const Standard_Integer sens2,
|
||||
const gp_Pnt2d& p2,
|
||||
gp_Vec& v2,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Geom_Surface)& s,
|
||||
const gp_Pnt2d& p1,
|
||||
const gp_Pnt2d& p2,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta,
|
||||
const Standard_Boolean isfreeboundary = Standard_False);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Adaptor3d_HSurface)& HS,
|
||||
const gp_Pnt2d& p1,
|
||||
const gp_Pnt2d& p2,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta,
|
||||
const Standard_Boolean isfreeboundary = Standard_False);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Adaptor3d_HSurface)& HS,
|
||||
const Handle(Geom2d_Curve)& curv,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta,
|
||||
const Standard_Boolean isfreeboundary = Standard_False);
|
||||
|
||||
Handle(GeomFill_Boundary) ChFi3d_mkbound
|
||||
(const Handle(Adaptor3d_HSurface)& Fac,
|
||||
Handle(Geom2d_Curve)& curv,
|
||||
const gp_Pnt2d& p1,
|
||||
const gp_Pnt2d& p2,
|
||||
const Standard_Real t3d,
|
||||
const Standard_Real ta,
|
||||
const Standard_Boolean isfreeboundary = Standard_False);
|
||||
|
||||
void ChFi3d_Coefficient(const gp_Vec& V3d,
|
||||
const gp_Vec& D1u,
|
||||
const gp_Vec& D1v,
|
||||
Standard_Real& DU,
|
||||
Standard_Real& DV);
|
||||
|
||||
Handle(Geom2d_Curve) ChFi3d_BuildPCurve
|
||||
(const gp_Pnt2d& p1,
|
||||
gp_Dir2d& d1,
|
||||
const gp_Pnt2d& p2,
|
||||
gp_Dir2d& d2,
|
||||
const Standard_Boolean redresse = Standard_True);
|
||||
|
||||
Handle(Geom2d_Curve) ChFi3d_BuildPCurve
|
||||
(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const gp_Pnt2d& p1,
|
||||
const gp_Vec& v1,
|
||||
const gp_Pnt2d& p2,
|
||||
const gp_Vec& v2,
|
||||
const Standard_Boolean redresse = Standard_False);
|
||||
|
||||
Handle(Geom2d_Curve) ChFi3d_BuildPCurve
|
||||
(const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const gp_Pnt2d& p1,
|
||||
const gp_Vec2d& v1,
|
||||
const gp_Pnt2d& p2,
|
||||
const gp_Vec2d& v2,
|
||||
const Standard_Boolean redresse = Standard_False);
|
||||
|
||||
Standard_Boolean ChFi3d_CheckSameParameter
|
||||
(const Handle(Adaptor3d_HCurve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached);
|
||||
|
||||
Standard_Boolean ChFi3d_SameParameter(const Handle(Adaptor3d_HCurve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached);
|
||||
|
||||
Standard_Boolean ChFi3d_SameParameter(const Handle(Geom_Curve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real Pardeb,
|
||||
const Standard_Real Parfin,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached);
|
||||
|
||||
void ChFi3d_ComputePCurv(const Handle(Geom_Curve)& C3d,
|
||||
const gp_Pnt2d& UV1,
|
||||
const gp_Pnt2d& UV2,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Geom_Surface)& S,
|
||||
const Standard_Real Pardeb,
|
||||
const Standard_Real Parfin,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached,
|
||||
const Standard_Boolean reverse = Standard_False);
|
||||
|
||||
void ChFi3d_ComputePCurv(const Handle(Adaptor3d_HCurve)& C3d,
|
||||
const gp_Pnt2d& UV1,
|
||||
const gp_Pnt2d& UV2,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real Pardeb,
|
||||
const Standard_Real Parfin,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached,
|
||||
const Standard_Boolean reverse = Standard_False);
|
||||
|
||||
void ChFi3d_ComputePCurv(const gp_Pnt2d& UV1,
|
||||
const gp_Pnt2d& UV2,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Standard_Real Pardeb,
|
||||
const Standard_Real Parfin,
|
||||
const Standard_Boolean reverse = Standard_False);
|
||||
|
||||
Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
|
||||
const Standard_Real pref1,
|
||||
Standard_Real& p1,
|
||||
const Standard_Integer jf1,
|
||||
const Standard_Integer sens1,
|
||||
const Handle(ChFiDS_SurfData)& fd2,
|
||||
const Standard_Real pref2,
|
||||
Standard_Real& p2,
|
||||
const Standard_Integer jf2,
|
||||
const Standard_Integer sens2,
|
||||
const gp_Pnt2d& RefP2d,
|
||||
const Standard_Boolean Check2dDistance = Standard_False,
|
||||
const Standard_Boolean enlarge = Standard_False);
|
||||
|
||||
Standard_Boolean ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_Stripe)& cd1,
|
||||
const Handle(ChFiDS_Stripe)& cd2,
|
||||
const Standard_Integer i1,
|
||||
const Standard_Integer i2,
|
||||
const Standard_Integer sens1,
|
||||
const Standard_Integer sens2,
|
||||
Standard_Real& p1,
|
||||
Standard_Real& p2,
|
||||
TopoDS_Face& face,
|
||||
Standard_Boolean& sameside,
|
||||
Standard_Integer& jf1,
|
||||
Standard_Integer& jf2,
|
||||
Standard_Boolean& visavis,
|
||||
const TopoDS_Vertex& Vtx,
|
||||
const Standard_Boolean Check2dDistance = Standard_False,
|
||||
const Standard_Boolean enlarge = Standard_False);
|
||||
|
||||
void ChFi3d_ProjectPCurv(const Handle(Adaptor3d_HCurve)& HCg,
|
||||
const Handle(Adaptor3d_HSurface)& HSg,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached) ;
|
||||
|
||||
void ChFi3d_ReparamPcurv(const Standard_Real Uf,
|
||||
const Standard_Real Ul,
|
||||
Handle(Geom2d_Curve)& Pcurv) ;
|
||||
|
||||
void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
|
||||
const gp_Pnt2d& UV1,
|
||||
const ChFiDS_CommonPoint& P2,
|
||||
const gp_Pnt2d& UV2,
|
||||
const Handle(Geom_Surface)& Surf,
|
||||
Handle(Geom_Curve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
Standard_Real& Pardeb,
|
||||
Standard_Real& Parfin,
|
||||
const Standard_Real tol3d,
|
||||
const Standard_Real tol2d,
|
||||
Standard_Real& tolreached,
|
||||
const Standard_Integer IFlag);
|
||||
|
||||
Handle(TopOpeBRepDS_SurfaceCurveInterference)
|
||||
ChFi3d_FilCurveInDS(const Standard_Integer Icurv,
|
||||
const Standard_Integer Isurf,
|
||||
const Handle(Geom2d_Curve)& Pcurv,
|
||||
const TopAbs_Orientation Et);
|
||||
|
||||
TopAbs_Orientation ChFi3d_TrsfTrans(const IntSurf_TypeTrans T1);
|
||||
|
||||
Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP,
|
||||
const IntSurf_TypeTrans TransLine,
|
||||
const Standard_Boolean Start,
|
||||
ChFiDS_CommonPoint& CP,
|
||||
const Standard_Real Tol);
|
||||
|
||||
|
||||
Standard_Integer ChFi3d_SolidIndex(const Handle(ChFiDS_Spine)& sp,
|
||||
TopOpeBRepDS_DataStructure& DStr,
|
||||
ChFiDS_Map& MapESo,
|
||||
ChFiDS_Map& MapESh);
|
||||
|
||||
Standard_Integer ChFi3d_IndexPointInDS(const ChFiDS_CommonPoint& P1,
|
||||
TopOpeBRepDS_DataStructure& DStr);
|
||||
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) ChFi3d_FilPointInDS
|
||||
(const TopAbs_Orientation Et,
|
||||
const Standard_Integer Ic,
|
||||
const Standard_Integer Ip,
|
||||
const Standard_Real Par,
|
||||
const Standard_Boolean IsVertex = Standard_False);
|
||||
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) ChFi3d_FilVertexInDS
|
||||
(const TopAbs_Orientation Et,
|
||||
const Standard_Integer Ic,
|
||||
const Standard_Integer Ip,
|
||||
const Standard_Real Par);
|
||||
|
||||
void ChFi3d_FilDS(const Standard_Integer SolidIndex,
|
||||
const Handle(ChFiDS_Stripe)& CorDat,
|
||||
TopOpeBRepDS_DataStructure& DStr,
|
||||
ChFiDS_Regularities& reglist,
|
||||
const Standard_Real tol3d,
|
||||
const Standard_Real tol2d);
|
||||
|
||||
|
||||
void ChFi3d_StripeEdgeInter (const Handle(ChFiDS_Stripe)& theStripe1,
|
||||
const Handle(ChFiDS_Stripe)& theStripe2,
|
||||
TopOpeBRepDS_DataStructure& DStr,
|
||||
const Standard_Real tol2d);
|
||||
|
||||
Standard_Integer ChFi3d_IndexOfSurfData(const TopoDS_Vertex& V1,
|
||||
const Handle(ChFiDS_Stripe)& CD,
|
||||
Standard_Integer& sens);
|
||||
|
||||
TopoDS_Edge ChFi3d_EdgeFromV1(const TopoDS_Vertex& V1,
|
||||
const Handle(ChFiDS_Stripe)& CD,
|
||||
Standard_Integer& sens);
|
||||
|
||||
Standard_Real ChFi3d_ConvTol2dToTol3d(const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real tol2d);
|
||||
|
||||
Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1,
|
||||
Handle(Adaptor3d_HSurface)& S2,
|
||||
const TColStd_Array1OfReal& Pardeb,
|
||||
const TColStd_Array1OfReal& Parfin,
|
||||
Handle(Geom_Curve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pc1,
|
||||
Handle(Geom2d_Curve)& Pc2,
|
||||
const Standard_Real tol3d,
|
||||
const Standard_Real tol2d,
|
||||
Standard_Real& tolreached,
|
||||
const Standard_Boolean wholeCurv
|
||||
= Standard_True);
|
||||
|
||||
Standard_Boolean ChFi3d_IntCS(Handle(Adaptor3d_HSurface)& S,
|
||||
Handle(Adaptor3d_HCurve)& C,
|
||||
gp_Pnt2d& p2dS,
|
||||
Standard_Real& wc);
|
||||
|
||||
void ChFi3d_ComputesIntPC (const ChFiDS_FaceInterference& Fi1,
|
||||
const ChFiDS_FaceInterference& Fi2,
|
||||
const Handle(GeomAdaptor_HSurface)& HS1,
|
||||
const Handle(GeomAdaptor_HSurface)& HS2,
|
||||
Standard_Real& UInt1,
|
||||
Standard_Real& UInt2);
|
||||
|
||||
void ChFi3d_ComputesIntPC (const ChFiDS_FaceInterference& Fi1,
|
||||
const ChFiDS_FaceInterference& Fi2,
|
||||
const Handle(GeomAdaptor_HSurface)& HS1,
|
||||
const Handle(GeomAdaptor_HSurface)& HS2,
|
||||
Standard_Real& UInt1,
|
||||
Standard_Real& UInt2,
|
||||
gp_Pnt& P);
|
||||
|
||||
Handle(GeomAdaptor_HSurface) ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& Fd1,
|
||||
const Standard_Integer& IFaCo1,
|
||||
const Standard_Integer& IFaArc1);
|
||||
|
||||
Standard_Integer ChFi3d_SearchPivot(Standard_Integer* s,
|
||||
Standard_Real u[3][3],
|
||||
const Standard_Real t);
|
||||
|
||||
Standard_Boolean ChFi3d_SearchFD(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_Stripe)& cd1,
|
||||
const Handle(ChFiDS_Stripe)& cd2,
|
||||
const Standard_Integer sens1,
|
||||
const Standard_Integer sens2,
|
||||
Standard_Integer& i1,
|
||||
Standard_Integer& i2,
|
||||
Standard_Real& p1,
|
||||
Standard_Real& p2,
|
||||
const Standard_Integer ind1,
|
||||
const Standard_Integer ind2,
|
||||
TopoDS_Face& face,
|
||||
Standard_Boolean& sameside,
|
||||
Standard_Integer& jf1,
|
||||
Standard_Integer& jf2);
|
||||
|
||||
|
||||
void ChFi3d_Parameters(const Handle(Geom_Surface)& S,
|
||||
const gp_Pnt& p3d,
|
||||
Standard_Real& u,
|
||||
Standard_Real& v);
|
||||
|
||||
void ChFi3d_TrimCurve(const Handle(Geom_Curve)& gc,
|
||||
const gp_Pnt& FirstP,
|
||||
const gp_Pnt& LastP,
|
||||
Handle(Geom_TrimmedCurve)& gtc);
|
||||
|
||||
Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
|
||||
Handle(ChFiDS_Spine)& Spine,
|
||||
const GeomAbs_Shape continuity,
|
||||
const Standard_Real tol);
|
||||
|
||||
TopoDS_Face ChFi3d_EnlargeFace(const Handle(ChFiDS_Spine)& Spine,
|
||||
const Handle(BRepAdaptor_HSurface)& HS,
|
||||
const Standard_Real Tol );
|
||||
|
||||
|
||||
void ChFi3d_cherche_face1 (const TopTools_ListOfShape & map,
|
||||
const TopoDS_Face & F1,
|
||||
TopoDS_Face & F);
|
||||
|
||||
void ChFi3d_cherche_element( const TopoDS_Vertex & V,
|
||||
const TopoDS_Edge & E1,
|
||||
const TopoDS_Face & F1,
|
||||
TopoDS_Edge & E ,
|
||||
TopoDS_Vertex & Vtx );
|
||||
|
||||
Standard_Real ChFi3d_EvalTolReached(const Handle(Adaptor3d_HSurface)& S1,
|
||||
const Handle(Geom2d_Curve)& pc1,
|
||||
const Handle(Adaptor3d_HSurface)& S2,
|
||||
const Handle(Geom2d_Curve)& pc2,
|
||||
const Handle(Geom_Curve)& C);
|
||||
|
||||
void ChFi3d_cherche_edge( const TopoDS_Vertex & V,
|
||||
const TopTools_Array1OfShape & E1,
|
||||
const TopoDS_Face & F1,
|
||||
TopoDS_Edge & E ,
|
||||
TopoDS_Vertex & Vtx );
|
||||
|
||||
Standard_Integer ChFi3d_nbface (const TopTools_ListOfShape & mapVF );
|
||||
|
||||
void ChFi3d_edge_common_faces (const TopTools_ListOfShape & mapEF,
|
||||
TopoDS_Face & F1,
|
||||
TopoDS_Face & F2);
|
||||
|
||||
|
||||
Standard_Real ChFi3d_AngleEdge (const TopoDS_Vertex & Vtx,
|
||||
const TopoDS_Edge& E1,
|
||||
const TopoDS_Edge & E2);
|
||||
|
||||
void ChFi3d_ChercheBordsLibres(const ChFiDS_Map & myVEMap,
|
||||
const TopoDS_Vertex & V1,
|
||||
Standard_Boolean & bordlibre,
|
||||
TopoDS_Edge & edgelibre1,
|
||||
TopoDS_Edge & edgelibre2);
|
||||
|
||||
Standard_Integer ChFi3d_NbNotDegeneratedEdges (const TopoDS_Vertex& Vtx,
|
||||
const ChFiDS_Map& VEMap);
|
||||
Standard_Integer ChFi3d_NumberOfEdges(const TopoDS_Vertex& Vtx,
|
||||
const ChFiDS_Map& VEMap);
|
||||
|
||||
void ChFi3d_cherche_vertex (const TopoDS_Edge & E1,
|
||||
const TopoDS_Edge & E2,
|
||||
TopoDS_Vertex & vertex,
|
||||
Standard_Boolean & trouve);
|
||||
|
||||
void ChFi3d_Couture( const TopoDS_Face & F,
|
||||
Standard_Boolean & couture,
|
||||
TopoDS_Edge & edgecouture);
|
||||
|
||||
void ChFi3d_CoutureOnVertex( const TopoDS_Face & F,
|
||||
const TopoDS_Vertex & V,
|
||||
Standard_Boolean & couture,
|
||||
TopoDS_Edge & edgecouture);
|
||||
|
||||
Standard_Boolean ChFi3d_IsPseudoSeam( const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F );
|
||||
|
||||
Handle(Geom_BSplineCurve) ChFi3d_ApproxByC2( const Handle(Geom_Curve)& C );
|
||||
|
||||
Standard_Boolean ChFi3d_IsSmooth( const Handle(Geom_Curve)& C );
|
||||
|
||||
#endif
|
1003
src/ChFi3d/ChFi3d_Builder_1.cxx
Executable file
1003
src/ChFi3d/ChFi3d_Builder_1.cxx
Executable file
File diff suppressed because it is too large
Load Diff
2995
src/ChFi3d/ChFi3d_Builder_2.cxx
Executable file
2995
src/ChFi3d/ChFi3d_Builder_2.cxx
Executable file
File diff suppressed because it is too large
Load Diff
2220
src/ChFi3d/ChFi3d_Builder_6.cxx
Executable file
2220
src/ChFi3d/ChFi3d_Builder_6.cxx
Executable file
File diff suppressed because it is too large
Load Diff
4371
src/ChFi3d/ChFi3d_Builder_C1.cxx
Executable file
4371
src/ChFi3d/ChFi3d_Builder_C1.cxx
Executable file
File diff suppressed because it is too large
Load Diff
672
src/ChFi3d/ChFi3d_Builder_C2.cxx
Executable file
672
src/ChFi3d/ChFi3d_Builder_C2.cxx
Executable file
@@ -0,0 +1,672 @@
|
||||
// File: ChFi3d_Builder_C2.cxx
|
||||
// Created: Tue Aug 20 14:14:29 1996
|
||||
// Author: Stagiaire Xuan Tang PHAMPHU
|
||||
// <xpu@pomalox.paris1.matra-dtv.fr>
|
||||
|
||||
#include <ChFi3d_Builder.jxx>
|
||||
#include <ChFi3d.hxx>
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <GeomLib.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_BoundedCurve.hxx>
|
||||
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Curve2d.hxx>
|
||||
#include <BRepAdaptor_HCurve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <TopOpeBRepDS_Point.hxx>
|
||||
#include <TopOpeBRepDS_Curve.hxx>
|
||||
#include <TopOpeBRepDS_Surface.hxx>
|
||||
#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
|
||||
#include <TopOpeBRepDS_CurvePointInterference.hxx>
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <TopOpeBRepDS_ListOfInterference.hxx>
|
||||
|
||||
#include <ChFiDS_HData.hxx>
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <ChFiDS_CommonPoint.hxx>
|
||||
#include <ChFiDS_FaceInterference.hxx>
|
||||
#include <ChFiDS_SequenceOfSurfData.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
static void Reduce(const Standard_Real& p1,
|
||||
const Standard_Real& p2,
|
||||
Handle(GeomAdaptor_HSurface)& hs1,
|
||||
Handle(GeomAdaptor_HSurface)& hs2)
|
||||
{
|
||||
GeomAdaptor_Surface& s1 = hs1->ChangeSurface();
|
||||
GeomAdaptor_Surface& s2 = hs2->ChangeSurface();
|
||||
const Handle(Geom_Surface&) surf = s1.Surface();
|
||||
Standard_Real ud,uf,vd,vf;
|
||||
surf->Bounds(ud,uf,vd,vf);
|
||||
Standard_Real milmoins = 0.51*vd+0.49*vf, milplus = 0.49*vd+0.51*vf;
|
||||
if(p1 < p2) {
|
||||
s1.Load(surf,ud,uf,vd,milmoins);
|
||||
s2.Load(surf,ud,uf,milplus,vf);
|
||||
}
|
||||
else{
|
||||
s1.Load(surf,ud,uf,milplus,vf);
|
||||
s2.Load(surf,ud,uf,vd,milmoins);
|
||||
}
|
||||
}
|
||||
|
||||
static void Reduce(const Standard_Real& p1,
|
||||
const Standard_Real& p2,
|
||||
Handle(GeomAdaptor_HCurve)& hc)
|
||||
{
|
||||
GeomAdaptor_Curve& c = hc->ChangeCurve();
|
||||
Standard_Real f = c.FirstParameter();
|
||||
Standard_Real l = c.LastParameter();
|
||||
Standard_Real milmoins = 0.51*f+0.49*l, milplus = 0.49*f+0.51*l;
|
||||
if(p1 < p2) {
|
||||
c.Load(c.Curve(),f,milmoins);
|
||||
}
|
||||
else{
|
||||
c.Load(c.Curve(),milplus,l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformTwoCornerbyInter
|
||||
//purpose : Effectue un PerformTwoCorner par intersection.
|
||||
// Dans le cas Biseau on utilise pour tous les cas le
|
||||
// cheminement biparam/biparam; on reapproxime alors la courbe
|
||||
// 3d et les 2 pcurves .
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Index)
|
||||
|
||||
{
|
||||
done = 0;
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
|
||||
//On extrait les informations necessaires sur les conges
|
||||
//------------------------------------------------------
|
||||
|
||||
//le premier
|
||||
//----------
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
It.Initialize(myVDataMap(Index));
|
||||
Handle(ChFiDS_Stripe)& Corner1 = It.Value();
|
||||
Standard_Integer Sens1;
|
||||
Standard_Integer IFd1 =
|
||||
ChFi3d_IndexOfSurfData(Vtx,Corner1,Sens1);
|
||||
ChFiDS_SequenceOfSurfData& SeqFil1 =
|
||||
Corner1->ChangeSetOfSurfData()->ChangeSequence();
|
||||
Handle(ChFiDS_SurfData)& Fd1 = SeqFil1.ChangeValue(IFd1);
|
||||
|
||||
//le deuxieme
|
||||
//----------
|
||||
It.Next();
|
||||
Handle(ChFiDS_Stripe)& Corner2 = It.Value();
|
||||
Standard_Integer Sens2;
|
||||
Standard_Integer IFd2;
|
||||
if(Corner2 == Corner1) {
|
||||
Sens2 = -1;
|
||||
IFd2 = Corner2->SetOfSurfData()->Length();
|
||||
}
|
||||
else{ IFd2 = ChFi3d_IndexOfSurfData(Vtx,Corner2,Sens2); }
|
||||
ChFiDS_SequenceOfSurfData& SeqFil2 =
|
||||
Corner2->ChangeSetOfSurfData()->ChangeSequence();
|
||||
Handle(ChFiDS_SurfData)& Fd2 = SeqFil2.ChangeValue(IFd2);
|
||||
|
||||
// On analyse les concavites, dans le cas de concavites differentes,
|
||||
// prevoir un raccord evolutif du type ThreeCorner de R vers 0.
|
||||
// Sinon on recherche la face en vis a vis
|
||||
// et l intersection eventuelle des 2 pcurves sur cette face.
|
||||
|
||||
ChFiDS_State Stat1,Stat2;
|
||||
Standard_Boolean isfirst1 = (Sens1 == 1);
|
||||
Standard_Boolean isfirst2 = (Sens2 == 1);
|
||||
Stat1 = Corner1->Spine()->Status(isfirst1);
|
||||
Stat2 = Corner2->Spine()->Status(isfirst2);
|
||||
/*#ifdef DEB
|
||||
Standard_Boolean evolcoin = ((Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnDiff) ||
|
||||
(Stat2 == ChFiDS_OnSame && Stat1 == ChFiDS_OnDiff));
|
||||
#endif*/
|
||||
Standard_Boolean OkinterCC,Okvisavis,SameSide;
|
||||
Standard_Integer IFaCo1,IFaCo2;
|
||||
Standard_Real UIntPC1,UIntPC2;
|
||||
TopoDS_Face FaCo;
|
||||
OkinterCC = ChFi3d_IsInFront(DStr,Corner1,Corner2,IFd1,IFd2,Sens1,Sens2,
|
||||
UIntPC1,UIntPC2,FaCo,SameSide,
|
||||
IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
|
||||
if (!Okvisavis) {
|
||||
#if DEB
|
||||
cout<<"TwoCorner : pas de face commune"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
if (!OkinterCC) {
|
||||
// On calcule l'intersection des pcurves sans les restreindre par les
|
||||
// common point
|
||||
OkinterCC= ChFi3d_IsInFront(DStr,Corner1,Corner2,IFd1,IFd2,Sens1,Sens2,
|
||||
UIntPC1,UIntPC2,FaCo,SameSide,
|
||||
IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True,1);
|
||||
}
|
||||
|
||||
if (!Okvisavis) {
|
||||
#if DEB
|
||||
cout<<"TwoCorner : pas de face commune"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
if (!OkinterCC) {
|
||||
#if DEB
|
||||
cout<<"biseau : echec intersection des lignes de tangence sur face commune"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
Standard_Integer IFaArc1 = 3-IFaCo1, IFaArc2 = 3-IFaCo2;
|
||||
|
||||
// On verifie que les conges ont bien un commonpoint sur un arc commun.
|
||||
// Cet edge est le pivot du biseau ou de la rotule.
|
||||
|
||||
ChFiDS_CommonPoint& CP1 = Fd1->ChangeVertex(isfirst1,IFaArc1);
|
||||
ChFiDS_CommonPoint& CP2 = Fd2->ChangeVertex(isfirst2,IFaArc2);
|
||||
|
||||
if (!CP1.IsOnArc() || !CP2.IsOnArc()) {
|
||||
#if DEB
|
||||
cout<<"echec 1 des 2 conges n est pas sur arc"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
if ( ! CP1.Arc().IsSame( CP2.Arc()) ) {
|
||||
// look like OnSame + OnDiff case (eap, Arp 9 2002, occ266)
|
||||
#if DEB
|
||||
cout<<"PerformTwoCornerbyInter(): conges ne sont pas sur la meme arc"<<endl;
|
||||
#endif
|
||||
done = Standard_True;
|
||||
PerformMoreThreeCorner(Index, 2);
|
||||
return done;
|
||||
}
|
||||
|
||||
TopoDS_Edge pivot;
|
||||
pivot = CP1.Arc();
|
||||
Standard_Real parCP1 = CP1.ParameterOnArc();
|
||||
Standard_Real parCP2 = CP2.ParameterOnArc();
|
||||
Handle(BRepAdaptor_HCurve) Hpivot = new BRepAdaptor_HCurve(pivot);
|
||||
if (!pivot.IsSame(CP2.Arc())){
|
||||
Handle(Geom_Curve) csau;
|
||||
Standard_Real ubid,vbid;
|
||||
csau=BRep_Tool::Curve(pivot,ubid,vbid );
|
||||
Handle(Geom_BoundedCurve) C1= Handle(Geom_BoundedCurve)::DownCast(csau);
|
||||
if (! C1.IsNull()) {
|
||||
GeomLib::ExtendCurveToPoint(C1,CP2.Point(),1,Standard_False);
|
||||
GeomAdaptor_Curve cad;
|
||||
cad.Load(C1);
|
||||
Extrema_ExtPC ext(CP2.Point(),cad,1.e-4);
|
||||
parCP2 = ext.Point(1).Parameter();
|
||||
}
|
||||
}
|
||||
gp_Pnt psp1 = Hpivot->Value(parCP1);
|
||||
gp_Pnt psp2 = Hpivot->Value(parCP2);
|
||||
Standard_Real sameparam = (psp1.Distance(psp2) < 10 * tolesp);
|
||||
|
||||
TopoDS_Face FF1 = TopoDS::Face(DStr.Shape(Fd1->Index(IFaArc1)));
|
||||
TopoDS_Face FF2 = TopoDS::Face(DStr.Shape(Fd2->Index(IFaArc2)));
|
||||
TopTools_ListIteratorOfListOfShape Kt;
|
||||
Standard_Boolean ok1 = Standard_False, ok2 = Standard_False;
|
||||
for (Kt.Initialize(myEFMap(pivot)); Kt.More(); Kt.Next()){
|
||||
TopoDS_Face F = TopoDS::Face(Kt.Value());
|
||||
if(!ok1 && FF1.IsSame(F)){
|
||||
ok1 = Standard_True;
|
||||
}
|
||||
if(!ok2 && FF2.IsSame(F)){
|
||||
ok2 = Standard_True;
|
||||
}
|
||||
}
|
||||
if(!ok1 || !ok2){
|
||||
//On est dans un contexte merdique
|
||||
#if DEB
|
||||
cout<<"echec une des surfaces n a pas de face d appui commune avec l edge pivot"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
|
||||
Handle(GeomAdaptor_HSurface) HS1, HS2;
|
||||
HS1 = ChFi3d_BoundSurf (DStr,Fd1,IFaCo1,IFaArc1);
|
||||
HS2 = ChFi3d_BoundSurf (DStr,Fd2,IFaCo2,IFaArc2);
|
||||
|
||||
TColStd_Array1OfReal Pardeb(1,4),Parfin(1,4);
|
||||
|
||||
Handle(Geom2d_Curve) PGc1,PGc2;
|
||||
Handle(Geom_Curve) Gc;
|
||||
|
||||
if(sameparam) {
|
||||
// Du cote face commune, calcul de Pardeb.
|
||||
ChFi3d_ComputesIntPC (Fd1->Interference(IFaCo1),
|
||||
Fd2->Interference(IFaCo2),
|
||||
HS1,HS2,UIntPC1,UIntPC2);
|
||||
gp_Pnt2d UV;
|
||||
UV = Fd1->Interference(IFaCo1).PCurveOnSurf()->Value(UIntPC1);
|
||||
Pardeb(1)= UV.X(); Pardeb(2)=UV.Y();
|
||||
UV = Fd2->Interference(IFaCo2).PCurveOnSurf()->Value(UIntPC2);
|
||||
Pardeb(3)= UV.X(); Pardeb(4)=UV.Y();
|
||||
gp_Pnt PFaCo = HS1->Surface().Value(Pardeb(1),Pardeb(2));
|
||||
|
||||
// Du cote arc, calcul de Parfin.
|
||||
Standard_Real UIntArc1 = Fd1->Interference(IFaArc1).Parameter(isfirst1);
|
||||
Standard_Real UIntArc2 = Fd2->Interference(IFaArc2).Parameter(isfirst2);
|
||||
|
||||
ChFi3d_ComputesIntPC (Fd1->Interference(IFaArc1),Fd2->Interference(IFaArc2),
|
||||
HS1,HS2,UIntArc1,UIntArc2);
|
||||
UV = Fd1->Interference(IFaArc1).PCurveOnSurf()->Value(UIntArc1);
|
||||
Parfin(1)= UV.X(); Parfin(2)=UV.Y();
|
||||
UV = Fd2->Interference(IFaArc2).PCurveOnSurf()->Value(UIntArc2);
|
||||
Parfin(3)= UV.X(); Parfin(4)=UV.Y();
|
||||
|
||||
if(Fd1->Surf() == Fd2->Surf()){
|
||||
Reduce(UIntPC1,UIntPC2,HS1,HS2);
|
||||
}
|
||||
|
||||
Standard_Real tolreached;
|
||||
if (IFaCo1 == 1 &&
|
||||
!ChFi3d_ComputeCurves(HS1,HS2,Pardeb,Parfin,Gc,
|
||||
PGc1,PGc2,tolesp,tol2d,tolreached)) {
|
||||
#if DEB
|
||||
cout<<"echec calcul biseau echec interSS"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
else if (IFaCo1 == 2 &&
|
||||
!ChFi3d_ComputeCurves(HS1,HS2,Parfin,Pardeb,Gc,
|
||||
PGc1,PGc2,tolesp,tol2d,tolreached)) {
|
||||
#if DEB
|
||||
cout<<"echec calcul biseau echec interSS"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
// On met a jour les CornerData avec les resultats de l intersection.
|
||||
Standard_Real WFirst = Gc->FirstParameter();
|
||||
Standard_Real WLast = Gc->LastParameter();
|
||||
Standard_Integer Ipoin1;
|
||||
Standard_Integer Ipoin2;
|
||||
ChFiDS_CommonPoint& cpco1 = Fd1->ChangeVertex(isfirst1,IFaCo1);
|
||||
ChFiDS_CommonPoint& cpco2 = Fd2->ChangeVertex(isfirst2,IFaCo2);
|
||||
Standard_Real tolpco = Max(cpco1.Tolerance(),cpco2.Tolerance());
|
||||
ChFiDS_CommonPoint& cparc1 = Fd1->ChangeVertex(isfirst1,IFaArc1);
|
||||
ChFiDS_CommonPoint& cparc2 = Fd2->ChangeVertex(isfirst2,IFaArc2);
|
||||
Standard_Real tolparc = Max(cparc1.Tolerance(),cparc2.Tolerance());
|
||||
Standard_Integer ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc,tolreached));
|
||||
//Corner1
|
||||
Corner1->SetParameters(isfirst1,WFirst,WLast);
|
||||
Corner1->SetCurve(ICurv,isfirst1);
|
||||
Corner1->ChangePCurve(isfirst1) = PGc1;
|
||||
cpco1.Reset();
|
||||
cpco1.SetPoint(PFaCo);
|
||||
cpco1.SetTolerance(Max(tolreached,tolpco));
|
||||
Fd1->ChangeInterference(IFaCo1).SetParameter(UIntPC1,isfirst1);
|
||||
tolparc = Max(tolparc,tolreached);
|
||||
cparc1.SetTolerance(Max(tolparc,tolreached));
|
||||
Ipoin1 = ChFi3d_IndexPointInDS(Fd1->Vertex(isfirst1,1),DStr);
|
||||
Corner1->SetIndexPoint(Ipoin1,isfirst1,1);
|
||||
Ipoin2 = ChFi3d_IndexPointInDS(Fd1->Vertex(isfirst1,2),DStr);
|
||||
Corner1->SetIndexPoint(Ipoin2,isfirst1,2);
|
||||
//Corner2
|
||||
Corner2->SetParameters(isfirst2,WFirst,WLast);
|
||||
Corner2->SetCurve(ICurv,isfirst2);
|
||||
Corner2->ChangePCurve(isfirst2) = PGc2;
|
||||
Fd2->ChangeInterference(IFaCo2).SetParameter(UIntPC2,isfirst2);
|
||||
Fd2->ChangeVertex(isfirst2,IFaCo2) = Fd1->Vertex(isfirst1,IFaCo1);
|
||||
Fd2->ChangeVertex(isfirst2,IFaArc2) = Fd1->Vertex(isfirst1,IFaArc1);
|
||||
if (IFaCo1!=IFaCo2) Corner2->SetOrientation(TopAbs_REVERSED,isfirst2);
|
||||
Corner2->SetIndexPoint(Corner1->IndexPoint(isfirst1,IFaCo1),
|
||||
isfirst2,IFaCo2);
|
||||
Corner2->SetIndexPoint(Corner1->IndexPoint(isfirst1,IFaArc1),
|
||||
isfirst2,IFaArc2);
|
||||
//On update les tolerances des points.
|
||||
Bnd_Box bco,barc;
|
||||
if(IFaCo1 == 1) ChFi3d_EnlargeBox(DStr,Corner1,Fd1,bco,barc,isfirst1);
|
||||
else ChFi3d_EnlargeBox(DStr,Corner1,Fd1,barc,bco,isfirst1);
|
||||
if(IFaCo2 == 1) ChFi3d_EnlargeBox(DStr,Corner2,Fd2,bco,barc,isfirst2);
|
||||
else ChFi3d_EnlargeBox(DStr,Corner2,Fd2,barc,bco,isfirst2);
|
||||
const ChFiDS_CommonPoint& cparc = Fd1->Vertex(isfirst1,IFaArc1);
|
||||
ChFi3d_EnlargeBox(cparc.Arc(),myEFMap(cparc.Arc()),cparc.ParameterOnArc(),barc);
|
||||
ChFi3d_SetPointTolerance(DStr,barc,Corner1->IndexPoint(isfirst1,IFaArc1));
|
||||
ChFi3d_SetPointTolerance(DStr,bco,Corner1->IndexPoint(isfirst1,IFaCo1));
|
||||
}
|
||||
else {
|
||||
// Il faut identifier la surface qui deborde,
|
||||
// trouver le point de fin de l intersection Surf/Surf
|
||||
// par l intersection de la ligne de tangence du petit sur
|
||||
// la face opposee avec la surface du gros,
|
||||
// et enfin intersecter le gros avec la face en bout
|
||||
// entre ce point et le point sur arc.
|
||||
#ifndef DEB
|
||||
Standard_Boolean parcrois = Standard_False ;
|
||||
#else
|
||||
Standard_Boolean parcrois;
|
||||
#endif
|
||||
TopExp_Explorer Expl;
|
||||
for(Expl.Init(pivot.Oriented(TopAbs_FORWARD),TopAbs_VERTEX);
|
||||
Expl.More(); Expl.Next()){
|
||||
if(Expl.Current().IsSame(Vtx)){
|
||||
parcrois = (Expl.Current().Orientation() == TopAbs_FORWARD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Handle(ChFiDS_Stripe) BigCD, SmaCD;
|
||||
Handle(ChFiDS_SurfData) BigFD, SmaFD;
|
||||
Handle(GeomAdaptor_HSurface) BigHS, SmaHS;
|
||||
Standard_Integer IFaCoBig, IFaCoSma, IFaArcBig, IFaArcSma;
|
||||
Standard_Boolean isfirstBig, isfirstSma;
|
||||
Standard_Real UIntPCBig, UIntPCSma;
|
||||
|
||||
if((parcrois && parCP2 > parCP1) || (!parcrois && parCP2 < parCP1)){
|
||||
UIntPCBig = UIntPC2; UIntPCSma = UIntPC1;
|
||||
BigHS = HS2; SmaHS = HS1;
|
||||
BigCD = Corner2; SmaCD = Corner1;
|
||||
BigFD = Fd2; SmaFD = Fd1;
|
||||
IFaCoBig = IFaCo2; IFaCoSma = IFaCo1;
|
||||
IFaArcBig = IFaArc2; IFaArcSma = IFaArc1;
|
||||
isfirstBig = isfirst2; isfirstSma = isfirst1;
|
||||
}
|
||||
else{
|
||||
UIntPCBig = UIntPC1, UIntPCSma = UIntPC2;
|
||||
BigHS = HS1; SmaHS = HS2;
|
||||
BigCD = Corner1; SmaCD = Corner2;
|
||||
BigFD = Fd1; SmaFD = Fd2;
|
||||
IFaCoBig = IFaCo1; IFaCoSma = IFaCo2;
|
||||
IFaArcBig = IFaArc1; IFaArcSma = IFaArc2;
|
||||
isfirstBig = isfirst1; isfirstSma = isfirst2;
|
||||
}
|
||||
|
||||
//Intersection du gros avec le petit :
|
||||
//------------------------------------
|
||||
|
||||
// Pardeb (parametres du point PFaCo)
|
||||
// on verifie l'intersection
|
||||
ChFi3d_ComputesIntPC (SmaFD->Interference(IFaCoSma),
|
||||
BigFD->Interference(IFaCoBig),
|
||||
SmaHS,BigHS,UIntPCSma,UIntPCBig);
|
||||
gp_Pnt2d UVi;
|
||||
UVi = BigFD->Interference(IFaCoBig).PCurveOnSurf()->Value(UIntPCBig);
|
||||
Pardeb(3)= UVi.X(); Pardeb(4)=UVi.Y();
|
||||
UVi = SmaFD->Interference(IFaCoSma).PCurveOnSurf()->Value(UIntPCSma);
|
||||
Pardeb(1)= UVi.X(); Pardeb(2)=UVi.Y();
|
||||
gp_Pnt PFaCo = SmaHS->Value(UVi.X(),UVi.Y());
|
||||
|
||||
// Parfin (parametres du point PMil)
|
||||
const ChFiDS_FaceInterference& FiArcSma = SmaFD->Interference(IFaArcSma);
|
||||
Handle(Geom_Curve) ctg = DStr.Curve(FiArcSma.LineIndex()).Curve();
|
||||
Handle(GeomAdaptor_HCurve) Hctg = new GeomAdaptor_HCurve();
|
||||
GeomAdaptor_Curve& bid = Hctg->ChangeCurve();
|
||||
Standard_Real temp,wi;
|
||||
|
||||
if (isfirstSma) {
|
||||
wi = temp = FiArcSma.FirstParameter();
|
||||
if (UIntPCSma < temp)
|
||||
temp = UIntPCSma;
|
||||
bid.Load(ctg,temp,FiArcSma.LastParameter());
|
||||
}
|
||||
else {
|
||||
wi = temp = FiArcSma.LastParameter();
|
||||
if (UIntPCSma > temp)
|
||||
temp = UIntPCSma;
|
||||
bid.Load(ctg,FiArcSma.FirstParameter(),temp);
|
||||
}
|
||||
if(SmaFD->Surf() == BigFD->Surf()){
|
||||
Reduce(UIntPCSma,UIntPCBig,SmaHS,BigHS);
|
||||
Reduce(UIntPCSma,UIntPCBig,Hctg);
|
||||
}
|
||||
if(!ChFi3d_IntCS(BigHS,Hctg,UVi,wi)){
|
||||
#if DEB
|
||||
cout<<"biseau : echec inter C S"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
Parfin(3) = UVi.X(); Parfin(4) = UVi.Y();
|
||||
UVi = FiArcSma.PCurveOnSurf()->Value(wi);
|
||||
Parfin(1) = UVi.X(); Parfin(2) = UVi.Y();
|
||||
gp_Pnt PMil = SmaHS->Value(Parfin(1),Parfin(2));
|
||||
|
||||
Standard_Real tolreached;
|
||||
if (!ChFi3d_ComputeCurves(SmaHS,BigHS,Pardeb,Parfin,Gc,
|
||||
PGc1,PGc2,tolesp,tol2d,tolreached)) {
|
||||
#if DEB
|
||||
cout<<"echec calcul biseau echec interSS"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
// On met a jour la SmaCD, c est fini pour elle.
|
||||
Standard_Real WFirst = Gc->FirstParameter();
|
||||
Standard_Real WLast = Gc->LastParameter();
|
||||
Standard_Integer IpointCo, IpointMil, IpointArc;
|
||||
ChFiDS_CommonPoint& psmaco = SmaFD->ChangeVertex(isfirstSma,IFaCoSma);
|
||||
ChFiDS_CommonPoint& pbigco = BigFD->ChangeVertex(isfirstBig,IFaCoBig);
|
||||
Standard_Real tolpco = Max(psmaco.Tolerance(),pbigco.Tolerance());
|
||||
ChFiDS_CommonPoint& psmamil = SmaFD->ChangeVertex(isfirstSma,IFaArcSma);
|
||||
Standard_Real tolpmil = psmamil.Tolerance();
|
||||
Standard_Integer ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc,tolreached));
|
||||
|
||||
SmaCD->SetParameters(isfirstSma,WFirst,WLast);
|
||||
SmaCD->SetCurve(ICurv,isfirstSma);
|
||||
SmaCD->ChangePCurve(isfirstSma) = PGc1;
|
||||
psmaco.Reset();
|
||||
psmaco.SetPoint(PFaCo);
|
||||
psmaco.SetTolerance(Max(tolpco,tolreached));
|
||||
SmaFD->ChangeInterference(IFaCoSma).SetParameter(UIntPCSma,isfirstSma);
|
||||
psmamil.Reset();
|
||||
psmamil.SetPoint(PMil);
|
||||
psmamil.SetTolerance(Max(tolpmil,tolreached));
|
||||
SmaFD->ChangeInterference(IFaArcSma).SetParameter(wi,isfirstSma);
|
||||
IpointCo = ChFi3d_IndexPointInDS(psmaco,DStr);
|
||||
SmaCD->SetIndexPoint(IpointCo,isfirstSma,IFaCoSma);
|
||||
IpointMil = ChFi3d_IndexPointInDS(psmamil,DStr);
|
||||
SmaCD->SetIndexPoint(IpointMil,isfirstSma,IFaArcSma);
|
||||
if (IFaCoSma == 2) SmaCD->SetOrientation(TopAbs_REVERSED,isfirstSma);
|
||||
|
||||
// Pour la BigCD on met ces premiers resultats dans la DS.
|
||||
BigCD->SetIndexPoint(IpointCo,isfirstBig,IFaCoBig);
|
||||
BigFD->ChangeVertex(isfirstBig,IFaCoBig) = psmaco;
|
||||
BigFD->ChangeInterference(IFaCoBig).SetParameter(UIntPCBig,isfirstBig);
|
||||
|
||||
TopOpeBRepDS_ListOfInterference& Li = DStr.ChangeCurveInterferences(ICurv);
|
||||
Handle(TopOpeBRepDS_CurvePointInterference) Interfp;
|
||||
Interfp = ChFi3d_FilPointInDS(TopAbs_FORWARD,ICurv,IpointCo,WFirst);
|
||||
Li.Append(Interfp);
|
||||
Interfp = ChFi3d_FilPointInDS(TopAbs_REVERSED,ICurv,IpointMil,WLast);
|
||||
Li.Append(Interfp);
|
||||
|
||||
// la transition des courbes d intersection sur la Big
|
||||
TopAbs_Orientation tra = BigFD->InterferenceOnS1().Transition();
|
||||
TopAbs_Orientation ofac = DStr.Shape(BigFD->IndexOfS1()).Orientation();
|
||||
TopAbs_Orientation ofil = BigFD->Orientation();
|
||||
TopAbs_Orientation tracurv = TopAbs::Compose(ofac,ofil);
|
||||
tracurv = TopAbs::Compose(tracurv,tra);
|
||||
if(!isfirstBig) tracurv = TopAbs::Reverse(tracurv);
|
||||
if(IFaCoBig != 1) tracurv = TopAbs::Reverse(tracurv);
|
||||
|
||||
Handle(TopOpeBRepDS_SurfaceCurveInterference) Interfc;
|
||||
Standard_Integer ISurf = BigFD->Surf();
|
||||
Interfc = ChFi3d_FilCurveInDS (ICurv,ISurf,PGc2,tracurv);
|
||||
DStr.ChangeSurfaceInterferences(ISurf).Append(Interfc);
|
||||
|
||||
//On update les tolerances des points (on commence).
|
||||
Bnd_Box bco,bmil,barc;
|
||||
if(IFaCoSma == 1) ChFi3d_EnlargeBox(DStr,SmaCD,SmaFD,bco,bmil,isfirstSma);
|
||||
else ChFi3d_EnlargeBox(DStr,SmaCD,SmaFD,bmil,bco,isfirstSma);
|
||||
ChFi3d_EnlargeBox(BigHS,PGc2,WFirst,WLast,bco,bmil);
|
||||
|
||||
// Intersection du gros avec la face en bout :
|
||||
// -------------------------------------------
|
||||
|
||||
// Pardeb (parametres de PMil)
|
||||
// On rejoue l intersection courbe surface mais avec la representation
|
||||
// pcurve on face de la courbe pour etre bien sur.
|
||||
TopoDS_Face F = TopoDS::Face(DStr.Shape(SmaFD->Index(IFaArcSma)));
|
||||
Handle(BRepAdaptor_HSurface) HF = new BRepAdaptor_HSurface(F);
|
||||
Standard_Real fsma = FiArcSma.FirstParameter();
|
||||
Standard_Real lsma = FiArcSma.LastParameter();
|
||||
Standard_Real deltSma = 0.05 * (lsma - fsma);
|
||||
Handle(Geom2d_Curve) pcpc = SmaFD->Interference(IFaArcSma).PCurveOnFace();
|
||||
fsma = Max(pcpc->FirstParameter(),wi-deltSma);
|
||||
lsma = Min(pcpc->LastParameter(),wi+deltSma);
|
||||
if ( lsma<fsma ) {
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
Handle(Geom2dAdaptor_HCurve) c2df =
|
||||
new Geom2dAdaptor_HCurve(SmaFD->Interference(IFaArcSma).PCurveOnFace(),fsma,lsma);
|
||||
Adaptor3d_CurveOnSurface consf(c2df,HF);
|
||||
Handle(Adaptor3d_HCurveOnSurface) Hconsf = new Adaptor3d_HCurveOnSurface(consf);
|
||||
if(!ChFi3d_IntCS(BigHS,Hconsf,UVi,wi)) {
|
||||
#if DEB
|
||||
cout<<"biseau : echec inter C S"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
Pardeb(3) = UVi.X(); Pardeb(4) = UVi.Y();
|
||||
UVi = SmaFD->Interference(IFaArcSma).PCurveOnFace()->Value(wi);
|
||||
Pardeb(1) = UVi.X(); Pardeb(2) = UVi.Y();
|
||||
gp_Pnt2d ppff1 = UVi;
|
||||
|
||||
// Parfin (parametres du point cpend)
|
||||
Standard_Real ptg = BigFD->Interference(IFaArcBig).Parameter(isfirstBig);
|
||||
UVi = BigFD->Interference(IFaArcBig).PCurveOnSurf()->Value(ptg);
|
||||
Parfin(3) = UVi.X(); Parfin(4) = UVi.Y();
|
||||
ChFiDS_CommonPoint& cpend = BigFD->ChangeVertex(isfirstBig,IFaArcBig);
|
||||
TopoDS_Edge etest = cpend.Arc();
|
||||
if(BRep_Tool::IsClosed(etest,F)) etest.Reverse();
|
||||
BRepAdaptor_Curve2d arc(etest,F);
|
||||
UVi = arc.Value(cpend.ParameterOnArc());
|
||||
Parfin(1) = UVi.X(); Parfin(2) = UVi.Y();
|
||||
gp_Pnt2d ppff2 = UVi;
|
||||
|
||||
// Intersection.
|
||||
Standard_Real uu1,uu2,vv1,vv2;
|
||||
ChFi3d_Boite(ppff1,ppff2,uu1,uu2,vv1,vv2);
|
||||
// pour le cas ou les deux chanfreins sont sur deux aretes OnSame,
|
||||
// il faut etendre la surface portant F, sinon, au moins ne pas la
|
||||
// restreindre.
|
||||
ChFi3d_BoundFac(HF->ChangeSurface(),uu1,uu2,vv1,vv2,Standard_True);
|
||||
|
||||
if (!ChFi3d_ComputeCurves(HF,BigHS,Pardeb,Parfin,Gc,
|
||||
PGc1,PGc2,tolesp,tol2d,tolreached)) {
|
||||
#if DEB
|
||||
cout<<"echec calcul biseau echec interSS"<<endl;
|
||||
#endif
|
||||
done=Standard_False;
|
||||
return done;
|
||||
}
|
||||
|
||||
// On finit de mettre a jour la BigCD et la DS.
|
||||
WFirst = Gc->FirstParameter();
|
||||
WLast = Gc->LastParameter();
|
||||
ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc,tolreached));
|
||||
cpend.SetTolerance(Max(cpend.Tolerance(),tolreached));
|
||||
IpointArc = ChFi3d_IndexPointInDS(cpend,DStr);
|
||||
BigCD->SetIndexPoint(IpointArc,isfirstBig,IFaArcBig);
|
||||
|
||||
TopOpeBRepDS_ListOfInterference& Li7 = DStr.ChangeCurveInterferences(ICurv);
|
||||
Interfp = ChFi3d_FilPointInDS(TopAbs_FORWARD,ICurv,IpointMil,WFirst);
|
||||
Li7.Append(Interfp);
|
||||
Interfp = ChFi3d_FilPointInDS(TopAbs_REVERSED,ICurv,IpointArc,WLast);
|
||||
Li7.Append(Interfp);
|
||||
Interfc = ChFi3d_FilCurveInDS (ICurv,ISurf,PGc2,tracurv);
|
||||
DStr.ChangeSurfaceInterferences(ISurf).Append(Interfc);
|
||||
BigCD->InDS(isfirstBig);
|
||||
|
||||
// Et enfin on met dans la DS les informations cote face.
|
||||
Standard_Integer IShape = DStr.AddShape(F);
|
||||
if(SmaFD->Surf() == BigFD->Surf()){
|
||||
tracurv = TopAbs::Compose(etest.Orientation(),
|
||||
cpend.TransitionOnArc());
|
||||
}
|
||||
else {
|
||||
TopExp_Explorer Exp;
|
||||
for (Exp.Init(F.Oriented(TopAbs_FORWARD),
|
||||
TopAbs_EDGE);Exp.More();Exp.Next()) {
|
||||
if (Exp.Current().IsSame(etest)) {
|
||||
tracurv = TopAbs::Compose(Exp.Current().Orientation(),
|
||||
cpend.TransitionOnArc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Interfc = ChFi3d_FilCurveInDS(ICurv,IShape,PGc1,tracurv);
|
||||
DStr.ChangeShapeInterferences(IShape).Append(Interfc);
|
||||
|
||||
//On update les tolerances des points (on finit).
|
||||
Handle(ChFiDS_Stripe) bidst;
|
||||
if(IFaCoBig == 1) ChFi3d_EnlargeBox(DStr,bidst,BigFD,bco,barc,isfirstBig);
|
||||
else ChFi3d_EnlargeBox(DStr,bidst,BigFD,barc,bco,isfirstBig);
|
||||
ChFi3d_EnlargeBox(BigHS,PGc2,WFirst,WLast,bmil,barc);
|
||||
ChFi3d_EnlargeBox(HF,PGc1,WFirst,WLast,bmil,barc);
|
||||
ChFi3d_EnlargeBox(Gc,WFirst,WLast,bmil,barc);
|
||||
const ChFiDS_CommonPoint& cparc = BigFD->Vertex(isfirstBig,IFaArcBig);
|
||||
ChFi3d_EnlargeBox(cparc.Arc(),myEFMap(cparc.Arc()),cparc.ParameterOnArc(),barc);
|
||||
|
||||
ChFi3d_SetPointTolerance(DStr,bco,SmaCD->IndexPoint(isfirstSma,IFaCoSma));
|
||||
ChFi3d_SetPointTolerance(DStr,bmil,SmaCD->IndexPoint(isfirstSma,IFaArcSma));
|
||||
ChFi3d_SetPointTolerance(DStr,barc,BigCD->IndexPoint(isfirstBig,IFaArcBig));
|
||||
}
|
||||
done = 1;
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
2974
src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
Executable file
2974
src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
Executable file
File diff suppressed because it is too large
Load Diff
229
src/ChFi3d/ChFi3d_Builder_NotImp.cxx
Executable file
229
src/ChFi3d/ChFi3d_Builder_NotImp.cxx
Executable file
@@ -0,0 +1,229 @@
|
||||
// File: ChFi3d_Builder_NotImp.cxx
|
||||
// Created: Mon May 18 16:35:34 1998
|
||||
// Author: Philippe NOUAILLE
|
||||
// <pne@cleox.paris1.matra-dtv.fr>
|
||||
|
||||
|
||||
#include <ChFi3d_Builder.jxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : SimulSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::SimulSurf(Handle(ChFiDS_SurfData)& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("SimulSurf Not Implemented");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SimulSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::SimulSurf(Handle(ChFiDS_SurfData)& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("SimulSurf Not Implemented");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SimulSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::SimulSurf(Handle(ChFiDS_SurfData)& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("SimulSurf Not Implemented");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::PerformSurf(ChFiDS_SequenceOfSurfData& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("PerformSurf Not Implemented");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::PerformSurf(ChFiDS_SequenceOfSurfData& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("PerformSurf Not Implemented");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformSurf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_Builder::PerformSurf(ChFiDS_SequenceOfSurfData& ,
|
||||
const Handle(ChFiDS_HElSpine)& ,
|
||||
const Handle(ChFiDS_Spine)& ,
|
||||
const Standard_Integer ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(Adaptor3d_TopolTool)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
const Handle(BRepAdaptor_HSurface)& ,
|
||||
const Handle(BRepAdaptor_HCurve2d)& ,
|
||||
Standard_Boolean& ,
|
||||
const TopAbs_Orientation ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const Standard_Boolean ,
|
||||
const math_Vector& )
|
||||
{
|
||||
Standard_Failure::Raise("PerformSurf Not Implemented");
|
||||
|
||||
}
|
1185
src/ChFi3d/ChFi3d_Builder_SpKP.cxx
Executable file
1185
src/ChFi3d/ChFi3d_Builder_SpKP.cxx
Executable file
File diff suppressed because it is too large
Load Diff
21
src/ChFi3d/ChFi3d_CMPLRS.edl
Executable file
21
src/ChFi3d/ChFi3d_CMPLRS.edl
Executable file
@@ -0,0 +1,21 @@
|
||||
-- File: CMPLRS.edl
|
||||
-- Author: Jean GAUTIER
|
||||
-- History: Mon Feb 19 12:04:00 1996 Jean GAUTIER Creation
|
||||
-- Copyright: Matra Datavision 1996
|
||||
|
||||
|
||||
--
|
||||
-- Templates HP-UX
|
||||
--
|
||||
@if ( %Station == "hp" ) then
|
||||
|
||||
@string %CMPLRS_CXX_Options = %CMPLRS_CXX_Options " -w ";
|
||||
--- POP suivant directive POP : @string %CMPLRS_CXX_Options = %CMPLRS_CXX_Options " -w +a1 ";
|
||||
--
|
||||
-- FSA : +O2 est trop consomateur de swap pour l'instant.
|
||||
|
||||
@set %CMPLRS_CXX_ModeOpt = "+O1";
|
||||
|
||||
@endif;
|
||||
|
||||
|
451
src/ChFi3d/ChFi3d_ChBuilder.cdl
Executable file
451
src/ChFi3d/ChFi3d_ChBuilder.cdl
Executable file
@@ -0,0 +1,451 @@
|
||||
-- File: ChFi3d_ChBuilder.cdl
|
||||
-- Created: Wed Apr 26 10:35:08 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
class ChBuilder from ChFi3d inherits Builder from ChFi3d
|
||||
|
||||
---Purpose: construction tool for 3D chamfers on edges.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
State from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
HElSpine from ChFiDS,
|
||||
SequenceOfSurfData from ChFiDS,
|
||||
SurfData from ChFiDS,
|
||||
Stripe from ChFiDS,
|
||||
ListOfStripe from ChFiDS,
|
||||
Spine from ChFiDS,
|
||||
SecHArray1 from ChFiDS,
|
||||
Function from Blend,
|
||||
HCurve from Adaptor3d,
|
||||
HCurve2d from BRepAdaptor,
|
||||
HSurface from BRepAdaptor,
|
||||
HCurve from Adaptor3d,
|
||||
TopolTool from Adaptor3d,
|
||||
Vector from math,
|
||||
ChamfMethod from ChFiDS ,
|
||||
Pnt2d from gp
|
||||
|
||||
raises
|
||||
ConstructionError from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(S : Shape from TopoDS; Ta : Real from Standard = 1.0e-2)
|
||||
returns ChBuilder from ChFi3d;
|
||||
---Purpose: initializes the Builder with the Shape <S> for the
|
||||
-- computation of chamfers
|
||||
|
||||
|
||||
Add(me : in out; E : Edge from TopoDS)
|
||||
---Purpose: initializes a contour with the edge <E> as first
|
||||
-- (the next are found by propagation ).
|
||||
-- The two distances (parameters of the chamfer) must
|
||||
-- be set after.
|
||||
raises ConstructionError from Standard
|
||||
---Purpose: if the edge <E> has more than 2 adjacent faces
|
||||
is static;
|
||||
|
||||
Add(me : in out;
|
||||
Dis : Real from Standard;
|
||||
E : Edge from TopoDS;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: initializes a new contour with the edge <E> as first
|
||||
-- (the next are found by propagation ), and the
|
||||
-- distance <Dis>
|
||||
raises ConstructionError from Standard
|
||||
---Purpose: if the edge <E> has more than 2 adjacent faces
|
||||
is static;
|
||||
|
||||
SetDist(me : in out;
|
||||
Dis : Real;
|
||||
IC : Integer from Standard;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: set the distance <Dis> of the fillet
|
||||
-- contour of index <IC> in the DS with <Dis> on <F>.
|
||||
raises DomainError from Standard
|
||||
---Purpose: if the face <F> is not one of common faces
|
||||
-- of an edge of the contour <IC>
|
||||
is static;
|
||||
|
||||
|
||||
GetDist(me ;
|
||||
IC : Integer from Standard;
|
||||
Dis : out Real from Standard)
|
||||
---Purpose: gives the distances <Dis> of the fillet
|
||||
-- contour of index <IC> in the DS
|
||||
is static;
|
||||
|
||||
Add(me : in out;
|
||||
Dis1, Dis2 : Real from Standard;
|
||||
E : Edge from TopoDS;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: initializes a new contour with the edge <E> as first
|
||||
-- (the next are found by propagation ), and the
|
||||
-- distance <Dis1> and <Dis2>
|
||||
raises ConstructionError from Standard
|
||||
---Purpose: if the edge <E> has more than 2 adjacent faces
|
||||
is static;
|
||||
|
||||
SetDists(me : in out;
|
||||
Dis1, Dis2 : Real;
|
||||
IC : Integer from Standard;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: set the distances <Dis1> and <Dis2> of the fillet
|
||||
-- contour of index <IC> in the DS with <Dis1> on <F>.
|
||||
raises DomainError from Standard
|
||||
---Purpose: if the face <F> is not one of common faces
|
||||
-- of an edge of the contour <IC>
|
||||
is static;
|
||||
|
||||
|
||||
Dists(me ;
|
||||
IC : Integer from Standard;
|
||||
Dis1, Dis2 : out Real from Standard)
|
||||
---Purpose: gives the distances <Dis1> and <Dis2> of the fillet
|
||||
-- contour of index <IC> in the DS
|
||||
is static;
|
||||
|
||||
|
||||
AddDA(me : in out;
|
||||
Dis : Real from Standard;
|
||||
Angle : Real from Standard;
|
||||
E : Edge from TopoDS;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: initializes a new contour with the edge <E> as first
|
||||
-- (the next are found by propagation ), and the
|
||||
-- distance <Dis1> and <Angle>
|
||||
raises ConstructionError from Standard
|
||||
---Purpose: if the edge <E> has more than 2 adjacent faces
|
||||
is static;
|
||||
|
||||
|
||||
SetDistAngle(me : in out;
|
||||
Dis : Real from Standard;
|
||||
Angle : Real from Standard;
|
||||
IC : Integer from Standard;
|
||||
F : Face from TopoDS)
|
||||
---Purpose: set the distance <Dis> and <Angle> of the fillet
|
||||
-- contour of index <IC> in the DS with <Dis> on <F>.
|
||||
raises DomainError from Standard
|
||||
---Purpose: if the face <F> is not one of common faces
|
||||
-- of an edge of the contour <IC>
|
||||
is static;
|
||||
|
||||
|
||||
GetDistAngle(me ;
|
||||
IC : Integer from Standard;
|
||||
Dis : in out Real from Standard;
|
||||
Angle : in out Real from Standard;
|
||||
DisOnFace1 : in out Boolean from Standard)
|
||||
---Purpose: gives the distances <Dis> and <Angle> of the fillet
|
||||
-- contour of index <IC> in the DS
|
||||
is static;
|
||||
|
||||
IsChamfer(me;
|
||||
IC : Integer from Standard)
|
||||
returns ChamfMethod from ChFiDS is static;
|
||||
---Purpose: renvoi la methode des chanfreins utilisee
|
||||
|
||||
ResetContour(me : in out;
|
||||
IC : Integer from Standard)
|
||||
---Purpose: Reset tous rayons du contour IC.
|
||||
is static;
|
||||
|
||||
---Methods for quick simulation
|
||||
-------------------------------
|
||||
|
||||
Simulate(me : in out;
|
||||
IC : Integer from Standard);
|
||||
|
||||
NbSurf(me; IC : Integer from Standard)
|
||||
returns Integer from Standard;
|
||||
|
||||
Sect(me; IC, IS : Integer from Standard)
|
||||
returns mutable SecHArray1 from ChFiDS;
|
||||
|
||||
SimulKPart(me; SD : mutable SurfData from ChFiDS)
|
||||
is protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean
|
||||
is protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is redefined;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is redefined;
|
||||
|
||||
---Methods for computation
|
||||
--------------------------
|
||||
|
||||
PerformFirstSection(me ;
|
||||
S : Spine from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1,S2 : in out HSurface from BRepAdaptor;
|
||||
I1,I2 : TopolTool from Adaptor3d;
|
||||
Par : Real from Standard;
|
||||
SolDep : in out Vector from math;
|
||||
Pos1,Pos2 : out State from TopAbs)
|
||||
returns Boolean from Standard
|
||||
is protected;
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean
|
||||
is redefined;
|
||||
---Purpose: Methode, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer).
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is redefined;
|
||||
---Purpose: Method, implemented in the inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/face.
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is redefined;
|
||||
---Purpose: Method, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/face.
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
|
||||
is redefined;
|
||||
---Purpose: Method, implemented in inheritants, calculates
|
||||
-- the elements of construction of the surface (fillet
|
||||
-- or chamfer) contact edge/edge.
|
||||
|
||||
PerformTwoCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is protected;
|
||||
---Purpose: computes the intersection of two chamfers on
|
||||
-- the vertex of index <Index> in myVDataMap.
|
||||
|
||||
PerformThreeCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is protected;
|
||||
---Purpose: computes the intersection of three chamfers on
|
||||
-- the vertex of index <Index> in myVDataMap.
|
||||
|
||||
|
||||
ExtentOneCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
S : Stripe from ChFiDS)
|
||||
is protected;
|
||||
---Purpose: extends the spine of the Stripe <S> at the
|
||||
-- extremity of the vertex <V>.
|
||||
|
||||
|
||||
ExtentTwoCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is protected;
|
||||
---Purpose: extends the spine of the 2 stripes of <LS> at the
|
||||
-- extremity of the vertex <V>
|
||||
|
||||
|
||||
ExtentThreeCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is protected;
|
||||
---Purpose: extends the spine of the 2 stripes of <LS> at the
|
||||
-- extremity of the vertex <V>
|
||||
|
||||
|
||||
SetRegul(me : in out) is protected;
|
||||
---Purpose: set the regularities
|
||||
|
||||
|
||||
ConexFaces(me;
|
||||
Sp : Spine from ChFiDS;
|
||||
IEdge : Integer from Standard;
|
||||
F1, F2 : out Face from TopoDS)
|
||||
is static private;
|
||||
|
||||
FindChoiceDistAngle(me;
|
||||
Choice : Integer from Standard;
|
||||
DisOnF1 : Boolean from Standard)
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
end ChBuilder;
|
||||
|
||||
|
2259
src/ChFi3d/ChFi3d_ChBuilder.cxx
Executable file
2259
src/ChFi3d/ChFi3d_ChBuilder.cxx
Executable file
File diff suppressed because it is too large
Load Diff
18
src/ChFi3d/ChFi3d_ChBuilder_C2.cxx
Executable file
18
src/ChFi3d/ChFi3d_ChBuilder_C2.cxx
Executable file
@@ -0,0 +1,18 @@
|
||||
// File: ChFi3d_ChBuilder_C2.cxx
|
||||
// Created: Fri Jul 26 17:27:36 1996
|
||||
// Author: Stagiaire Xuan Trang PHAMPHU
|
||||
// <xpu@pomalox.paris1.matra-dtv.fr>
|
||||
|
||||
|
||||
#include <ChFi3d_ChBuilder.jxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformTwoCorner
|
||||
//purpose :
|
||||
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_ChBuilder::PerformTwoCorner(const Standard_Integer Index)
|
||||
{
|
||||
PerformTwoCornerbyInter(Index);
|
||||
}
|
883
src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
Executable file
883
src/ChFi3d/ChFi3d_ChBuilder_C3.cxx
Executable file
@@ -0,0 +1,883 @@
|
||||
// File: ChFi3d_ChBuilder_C3.cxx
|
||||
// Created: Tue Jul 4 11:21:18 1995
|
||||
// Author: Stagiaire Flore Lantheaume
|
||||
// <fla@phylox>
|
||||
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <ChFi3d_ChBuilder.jxx>
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
|
||||
#include <ChFiKPart_ComputeData_Fcts.hxx>
|
||||
|
||||
#include <ChFiDS_HData.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_Spine.hxx>
|
||||
#include <ChFiDS_ChamfSpine.hxx>
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <ChFiDS_Regul.hxx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
|
||||
#include <GeomAbs_SurfaceType.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <Geom2dInt_GInter.hxx>
|
||||
|
||||
#include <GeomInt_IntSS.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
|
||||
#include <TopOpeBRepDS_HDataStructure.hxx>
|
||||
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
|
||||
#include <ProjLib_ProjectedCurve.hxx>
|
||||
|
||||
#include <ElSLib.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <IntCurveSurface_HInter.hxx>
|
||||
#include <IntCurveSurface_IntersectionPoint.hxx>
|
||||
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : CoPlanar
|
||||
//purpose : Sert a savoir si 4 points sont coplanaires, pour cela on calcul
|
||||
// la distance de PntD par rapport au plan passant par les trois
|
||||
// points PntA, PntB, PntC
|
||||
//
|
||||
//=======================================================================
|
||||
|
||||
static int CoPlanar(const gp_Pnt PntA,
|
||||
const gp_Pnt PntB,
|
||||
const gp_Pnt PntC,
|
||||
const gp_Pnt PntD)
|
||||
{
|
||||
Standard_Boolean IsCoplanar;
|
||||
|
||||
gp_Vec vecAB(PntA, PntB);
|
||||
gp_Vec vecAC(PntA, PntC);
|
||||
gp_Vec vecAD(PntA, PntD);
|
||||
|
||||
Standard_Real nor2AB = vecAB.SquareMagnitude();
|
||||
Standard_Real nor2AC = vecAC.SquareMagnitude();
|
||||
Standard_Real ProABAC = vecAB.Dot(vecAC);
|
||||
|
||||
|
||||
Standard_Real Alpha = nor2AB * nor2AC - ProABAC * ProABAC;
|
||||
|
||||
if (Alpha < Precision::Confusion()) {
|
||||
IsCoplanar = Standard_True;
|
||||
}
|
||||
else {
|
||||
Standard_Real ProABAD = vecAB.Dot(vecAD);
|
||||
Standard_Real ProACAD = vecAC.Dot(vecAD);
|
||||
Standard_Real Alpha1 = ProABAD * nor2AC - ProABAC * ProACAD;
|
||||
Standard_Real Alpha2 = ProACAD * nor2AB - ProABAC * ProABAD;
|
||||
gp_Vec vecDABC = Alpha1 * vecAB + Alpha2 * vecAC - Alpha * vecAD;
|
||||
|
||||
IsCoplanar = (vecDABC.Magnitude() / Alpha < Precision::Confusion() );
|
||||
|
||||
}
|
||||
|
||||
return IsCoplanar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BoundSurf
|
||||
//purpose : computes a GeomAdaptor_Surface from the surface and trims
|
||||
// it to allow the intersection computation
|
||||
//=======================================================================
|
||||
|
||||
static Handle(GeomAdaptor_HSurface) BoundSurf(const Handle(Geom_Surface)& S,
|
||||
const gp_Pnt2d& Pdeb,
|
||||
const gp_Pnt2d& Pfin)
|
||||
{
|
||||
Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
|
||||
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
|
||||
GAS.Load(S);
|
||||
|
||||
Standard_Real uu1,uu2,vv1,vv2;
|
||||
Standard_Real uuu1,uuu2,vvv1,vvv2;
|
||||
S->Bounds(uuu1,uuu2,vvv1,vvv2);
|
||||
ChFi3d_Boite(Pdeb,Pfin,uu1,uu2,vv1,vv2);
|
||||
Standard_Real Step = Max((uu2-uu1),(vv2-vv1));
|
||||
Step *= 0.2;
|
||||
uuu1 = Max((uu1-Step),uuu1); uuu2 = Min((uu2+Step),uuu2);
|
||||
vvv1 = Max((vv1-Step),vvv1); vvv2 = Min((vv2+Step),vvv2);
|
||||
GAS.Load(S,uuu1,uuu2,vvv1,vvv2);
|
||||
return HS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeIntersection
|
||||
//purpose : compute the 3d curve <gc> and the pcurves <pc1> and <pc2>
|
||||
// of the intersection between one of the 3 SurfData <SD> and
|
||||
// the SurfData of the corner <SDCoin>. Here we know the
|
||||
// extremities of the intersection <pdeb> and <pfin>, and
|
||||
// their parameters <p2dfin>, <p2ddeb> on <SD>.
|
||||
// <ptcoindeb> cointains the intersection 2d point on the corner
|
||||
// which corresponds to the point <pdeb>
|
||||
// <derudeb> and <dervdeb> are the derivative vectors on the
|
||||
// SurfData <SD> at the point <ptdeb>
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean ComputeIntersection(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& SD,
|
||||
const Handle(ChFiDS_SurfData)& SDCoin,
|
||||
const gp_Pnt& pdeb,
|
||||
const gp_Pnt2d& p2ddeb,
|
||||
const gp_Pnt& pfin,
|
||||
const gp_Pnt2d& p2dfin,
|
||||
Handle(Geom_Curve)& gc,
|
||||
Handle(Geom2d_Curve)& pc1,
|
||||
Handle(Geom2d_Curve)& pc2,
|
||||
gp_Vec& derudeb,
|
||||
gp_Vec& dervdeb,
|
||||
gp_Pnt2d& ptcoindeb,
|
||||
const Standard_Real tol3d,
|
||||
const Standard_Real tol2d,
|
||||
Standard_Real& tolreached)
|
||||
{
|
||||
// gp_Pnt2d UVf1,UVf2,UVl1,UVl2;
|
||||
|
||||
// take the surface of the pivot SurfData and trim it to allow
|
||||
// the intersection computation if it's an analytic surface
|
||||
Handle(GeomAdaptor_HSurface) HS1;
|
||||
HS1 = ChFi3d_BoundSurf(DStr,SD,1,2);
|
||||
|
||||
const Handle(Geom_Surface)& gpl = DStr.Surface(SDCoin->Surf()).Surface();
|
||||
const Handle(Geom_Surface)& gSD = DStr.Surface(SD->Surf()).Surface();
|
||||
|
||||
// compute pardeb
|
||||
TColStd_Array1OfReal Pardeb(1,4),Parfin(1,4);
|
||||
Standard_Real u,v;
|
||||
gp_Pnt Pbidon;
|
||||
u = p2ddeb.X();
|
||||
v = p2ddeb.Y();
|
||||
gSD->D1(u,v,Pbidon,derudeb,dervdeb);
|
||||
Pardeb(1) = u;
|
||||
Pardeb(2) = v;
|
||||
// gp_Pnt2d pd2(u,v);
|
||||
|
||||
ChFi3d_Parameters(gpl,pdeb,u,v);
|
||||
Pardeb(3) = u;
|
||||
Pardeb(4) = v;
|
||||
ptcoindeb.SetCoord(u,v);
|
||||
|
||||
// compute parfin
|
||||
u = p2dfin.X();
|
||||
v = p2dfin.Y();
|
||||
Parfin(1) = u;
|
||||
Parfin(2) = v;
|
||||
// gp_Pnt2d pf2(u,v);
|
||||
|
||||
ChFi3d_Parameters(gpl,pfin,u,v);
|
||||
Parfin(3) = u;
|
||||
Parfin(4) = v;
|
||||
gp_Pnt2d cpf2(u,v);
|
||||
|
||||
// Trims the chamfer surface to allow the intersection computation
|
||||
// and computes a GeomAdaptor_Surface for using the ComputeCurves
|
||||
// function
|
||||
Handle(GeomAdaptor_HSurface) HS2;
|
||||
HS2 = BoundSurf(gpl,ptcoindeb,cpf2);
|
||||
|
||||
// compute the intersection curves and pcurves
|
||||
return ChFi3d_ComputeCurves(HS1,HS2,Pardeb,Parfin,gc,
|
||||
pc1,pc2,tol3d,tol2d,tolreached);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// function : PerformThreeCorner
|
||||
// purpose : compute the intersection of three chamfers on a same
|
||||
// vertex of index <Jndex> in myVDataMap
|
||||
//======================================================================
|
||||
|
||||
void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
|
||||
{
|
||||
|
||||
//modifier pour le passer en option dans le cdl!!!!!!!!!!!!
|
||||
Standard_Boolean issmooth = Standard_False;
|
||||
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Jndex);
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
// Standard_Integer Index[3],pivot,deb,fin,ii,jj,kk;
|
||||
Standard_Integer Index[3],pivot=0,deb=0,fin=0,ii;
|
||||
Handle(ChFiDS_Stripe) CD[3];
|
||||
TopoDS_Face face[3];
|
||||
Standard_Integer jf[3][3];
|
||||
Standard_Boolean sameside[3], oksea[3];
|
||||
for(Standard_Integer g = 0; g <= 2; g++){oksea[g] = Standard_False;}
|
||||
Standard_Integer i[3][3];
|
||||
Standard_Integer sens[3];
|
||||
Standard_Real p[3][3];
|
||||
|
||||
Standard_Boolean c1triangle = Standard_False;
|
||||
|
||||
for (It.Initialize(myVDataMap(Jndex)),ii=0;It.More() && ii<3;It.Next(),ii++){
|
||||
Index[ii] = ChFi3d_IndexOfSurfData(Vtx,It.Value(),sens[ii]);
|
||||
CD[ii] = It.Value();
|
||||
}
|
||||
// On verifie que l une des CD ne figure pas deux fois, au quel cas
|
||||
// il faut modifier le retour de IndexOfSurfData qui prend la
|
||||
// premiere des solutions.
|
||||
if(CD[0] == CD[1]){
|
||||
Index[1] = CD[1]->SetOfSurfData()->Length();
|
||||
sens[1] = -1;
|
||||
}
|
||||
else if(CD[1] == CD[2]){
|
||||
Index[2] = CD[2]->SetOfSurfData()->Length();
|
||||
sens[2] = -1;
|
||||
}
|
||||
else if(CD[0] == CD[2]){
|
||||
Index[2] = CD[2]->SetOfSurfData()->Length();
|
||||
sens[2] = -1;
|
||||
}
|
||||
oksea[2] = ChFi3d_SearchFD(DStr,CD[0],CD[1],sens[0],sens[1],i[0][1],i[1][0],
|
||||
p[0][1],p[1][0],Index[0],Index[1],face[2],sameside[2],
|
||||
jf[0][1],jf[1][0]);
|
||||
oksea[1] = ChFi3d_SearchFD(DStr,CD[0],CD[2],sens[0],sens[2],i[0][2],i[2][0],
|
||||
p[0][2],p[2][0],Index[0],Index[2],face[1],sameside[1],
|
||||
jf[0][2],jf[2][0]);
|
||||
oksea[0] = ChFi3d_SearchFD(DStr,CD[1],CD[2],sens[1],sens[2],i[1][2],i[2][1],
|
||||
p[1][2],p[2][1],Index[1],Index[2],face[0],sameside[0],
|
||||
jf[1][2],jf[2][1]);
|
||||
//
|
||||
// Analyse des concavites des 3 chanfreins :
|
||||
// - 2 concavites identiques et 1 inverse.
|
||||
// - 3 concavites identiques
|
||||
//
|
||||
Standard_Boolean CornerAllSame = Standard_False;
|
||||
Standard_Boolean okinter = Standard_True;
|
||||
Standard_Boolean visavis;
|
||||
|
||||
if(oksea[2] && oksea[1] && !sameside[2] && !sameside[1]) {
|
||||
pivot = 0; deb = 1; fin = 2;
|
||||
//on calcule l'intersection des pcurves sans les restreindre a leur common point
|
||||
if (!oksea[0])
|
||||
okinter = ChFi3d_IsInFront(DStr,CD[1],CD[2],i[1][2],i[2][1],sens[1],sens[2],
|
||||
p[1][2],p[2][1],face[0],sameside[0],
|
||||
jf[1][2],jf[2][1],visavis,Vtx,Standard_False,1);
|
||||
}
|
||||
else if(oksea[2] && oksea[0] && !sameside[2] && !sameside[0]) {
|
||||
pivot = 1; deb = 2; fin = 0;
|
||||
if (!oksea[1])
|
||||
okinter = ChFi3d_IsInFront(DStr,CD[0],CD[2],i[0][2],i[2][0],sens[0],sens[2],
|
||||
p[0][2],p[2][0],face[1],sameside[1],
|
||||
jf[0][2],jf[2][0],visavis,Vtx,Standard_False,1);
|
||||
}
|
||||
else if(oksea[1] && oksea[0] && !sameside[1] && !sameside[0]) {
|
||||
pivot = 2; deb = 0; fin = 1;
|
||||
if (!oksea[2])
|
||||
okinter = ChFi3d_IsInFront(DStr,CD[0],CD[1],i[0][1],i[1][0],sens[0],sens[1],
|
||||
p[0][1],p[1][0],face[2],sameside[2],
|
||||
jf[0][1],jf[1][0],visavis,Vtx,Standard_False,1);
|
||||
}
|
||||
else if(oksea[0] && oksea[1] && oksea[2]){
|
||||
// 3 concavites identiques.
|
||||
pivot = ChFi3d_SearchPivot(sens,p,tol2d);
|
||||
if(pivot < 0)
|
||||
// on prend un pivot au hasard!!!!!!!!!!!!!!!
|
||||
pivot = 0;
|
||||
deb = (pivot+1)%3 ; fin = (pivot+2)%3;
|
||||
CornerAllSame = Standard_True;
|
||||
}
|
||||
else Standard_Failure::Raise("FD en vis a vis non trouvees");
|
||||
if (!okinter)
|
||||
Standard_Failure::Raise("Echec intersection PCurves OnCommonFace");
|
||||
|
||||
// on a le pivot, le CD deb et le CD fin (enfin on espere !?!) :
|
||||
// -------------------------------------------------------------
|
||||
|
||||
/* Remarque Importante : dans le cas ou les indices des Surf data
|
||||
du pivot sur lesquelles ont ete trouvees les intersections de pcurves
|
||||
ne sont pas egaux, il va y avoir changement de Surf data lors du
|
||||
cheminement et creations de Surf data mutantes a 3 ou 5 cotes!!!
|
||||
NON TRAITE !!!!!! (pour l instant)*/
|
||||
if(i[pivot][deb] != i[pivot][fin]){
|
||||
Standard_NotImplemented::Raise("coin mutant non programme");
|
||||
}
|
||||
/* Autre Remarque : dans le cas ou les indices des Surf data
|
||||
du deb (de la fin) sur lesquelles ont ete trouvees les intersections
|
||||
de pcurves ne sont pas egaux, il va y avoir changement de face lors du
|
||||
cheminement NON GERE !!!!!! (pour l instant). Prevoir un
|
||||
PerformSetOfSurf adapte.*/
|
||||
if(oksea[pivot] &&
|
||||
(i[deb][pivot] != i[deb][fin] || i[fin][pivot] != i[fin][deb])){
|
||||
Standard_NotImplemented::Raise("coin sur plusieurs faces non programme");
|
||||
}
|
||||
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fddeb = CD[deb]->ChangeSetOfSurfData()->ChangeValue(i[deb][pivot]);
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fdfin = CD[fin]->ChangeSetOfSurfData()->ChangeValue(i[fin][pivot]);
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fdpiv = CD[pivot]->ChangeSetOfSurfData()->ChangeValue(i[pivot][deb]);
|
||||
|
||||
|
||||
// On construit les HSurfaces et autres outils qui vont bien.
|
||||
// ----------------------------------------------------------
|
||||
|
||||
Handle(BRepAdaptor_HSurface) Fac = new BRepAdaptor_HSurface(face[pivot]);
|
||||
Handle(GeomAdaptor_HSurface)
|
||||
bidsurf = new GeomAdaptor_HSurface(Fac->ChangeSurface().Surface());
|
||||
Handle(Adaptor3d_TopolTool) IFac = new Adaptor3d_TopolTool(bidsurf);
|
||||
|
||||
Handle(GeomAdaptor_HSurface) Surf = ChFi3d_BoundSurf (DStr,fdpiv,jf[pivot][deb],jf[pivot][fin]);
|
||||
Handle(Adaptor3d_TopolTool) ISurf = new Adaptor3d_TopolTool(Surf);
|
||||
|
||||
// Creation of a new Stripe for the corner
|
||||
Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
|
||||
Handle(ChFiDS_HData)& cornerset = corner->ChangeSetOfSurfData();
|
||||
cornerset = new ChFiDS_HData();
|
||||
Handle(ChFiDS_SurfData) coin = new ChFiDS_SurfData();
|
||||
cornerset->Append(coin);
|
||||
|
||||
// Pour plus de surete, on verifie les intersections des pcurves des chanfreins sur leur
|
||||
// face commune
|
||||
Handle(GeomAdaptor_HSurface) HSdeb
|
||||
= new GeomAdaptor_HSurface( GeomAdaptor_Surface(DStr.Surface(fddeb->Surf()).Surface()) );
|
||||
Handle(GeomAdaptor_HSurface) HSfin
|
||||
= new GeomAdaptor_HSurface( GeomAdaptor_Surface(DStr.Surface(fdfin->Surf()).Surface()) );
|
||||
Handle(GeomAdaptor_HSurface) HSpiv
|
||||
= new GeomAdaptor_HSurface( GeomAdaptor_Surface(DStr.Surface(fdpiv->Surf()).Surface()) );
|
||||
|
||||
gp_Pnt2d p2d[4];
|
||||
gp_Pnt p3d[4], PSom;
|
||||
|
||||
ChFi3d_ComputesIntPC (fdpiv->Interference(jf[pivot][deb]),fddeb->Interference(jf[deb][pivot]),
|
||||
HSpiv,HSdeb,p[pivot][deb],p[deb][pivot], p3d[fin]);
|
||||
ChFi3d_ComputesIntPC (fdpiv->Interference(jf[pivot][fin]),fdfin->Interference(jf[fin][pivot]),
|
||||
HSpiv,HSfin,p[pivot][fin],p[fin][pivot], p3d[deb]);
|
||||
ChFi3d_ComputesIntPC (fddeb->Interference(jf[deb][fin]),fdfin->Interference(jf[fin][deb]),
|
||||
HSdeb,HSfin,p[deb][fin],p[fin][deb], PSom);
|
||||
|
||||
|
||||
|
||||
// On determine les extremites du coin
|
||||
//------------------------------------
|
||||
// c1triangle : on n'a besoin que des 3 points intersection des 3 chanfreins
|
||||
// sinon : on a les 2 points intersection de fdpiv avec fddeb et fdfin, et on
|
||||
// cree 2 autres points sur la face commune a l'aide des deux premiers
|
||||
|
||||
// p2d[deb] et p2d[fin] sur la surface du chanfrein fdpiv.
|
||||
// p2d[piv], p2d[3] (confondus si c1triangle) sur la face en bout du chanfrein de fdpiv
|
||||
// p2d[piv](resp.vp2d[3]) est sur la Uiso de fddeb(resp. fdfin) passant par p2d[deb]
|
||||
// (resp. p2d[fin])
|
||||
|
||||
// if (CornerAllSame)
|
||||
// c1triangle = (Abs(p[deb][pivot]-p[deb][fin])<tolesp &&
|
||||
// Abs(p[fin][pivot]-p[fin][deb])<tolesp);
|
||||
|
||||
gp_Vec2d Tg3,Tgpiv;
|
||||
|
||||
// if (c1triangle)
|
||||
// p2d[pivot] = fddeb->Interference(jf[deb][fin]).PCurveOnFace()->Value(p[deb][pivot]);
|
||||
// else {
|
||||
if (issmooth) {
|
||||
fddeb->Interference(jf[deb][fin]).PCurveOnFace()->D1(p[deb][pivot],p2d[pivot],Tgpiv);
|
||||
fdfin->Interference(jf[fin][deb]).PCurveOnFace()->D1(p[fin][pivot],p2d[3],Tg3);
|
||||
}
|
||||
else {
|
||||
p2d[pivot] = fddeb->Interference(jf[deb][fin]).PCurveOnFace()->Value(p[deb][pivot]);
|
||||
p2d[3] = fdfin->Interference(jf[fin][deb]).PCurveOnFace()->Value(p[fin][pivot]);
|
||||
}
|
||||
// }
|
||||
p2d[fin] = fdpiv->Interference(jf[pivot][deb]).PCurveOnSurf()->Value(p[pivot][deb]);
|
||||
p2d[deb] = fdpiv->Interference(jf[pivot][fin]).PCurveOnSurf()->Value(p[pivot][fin]);
|
||||
|
||||
// gp_Pnt pnt;
|
||||
gp_Vec deru,derv;
|
||||
|
||||
// p3d[fin] = HSpiv->Value(p2d[fin].X(),p2d[fin].Y());
|
||||
// p3d[deb] = HSpiv->Value(p2d[deb].X(),p2d[deb].Y());
|
||||
Fac->D1(p2d[pivot].X(),p2d[pivot].Y(),p3d[pivot],deru,derv);
|
||||
gp_Vec norpl = deru.Crossed(derv);
|
||||
// if (!c1triangle)
|
||||
p3d[3] = Fac->Value(p2d[3].X(),p2d[3].Y());
|
||||
|
||||
Standard_Real DistMin = (p3d[3]).Distance(p3d[fin]);
|
||||
Standard_Real DistTmp = (p3d[pivot]).Distance(p3d[deb]);
|
||||
Standard_Real DistDebFin = (p3d[pivot]).Distance(p3d[3]);
|
||||
|
||||
if (DistTmp > DistMin) DistMin = DistTmp;
|
||||
|
||||
// on elargi la notion de triangle pour eviter de creer
|
||||
// des surfaces ecraser avec deux coins proches
|
||||
// attention ceci entraine un effet de seuil
|
||||
if (CornerAllSame)
|
||||
c1triangle = (DistDebFin < 0.3 * DistMin);
|
||||
|
||||
if (c1triangle)
|
||||
p3d[pivot] = PSom;
|
||||
|
||||
|
||||
// on calcule la surface portant le coin
|
||||
//--------------------------------------
|
||||
// Si c1triangle ou les 4 points p3d sont coplanaires, alors
|
||||
// le chanfrein est porte par le plan passant par les 3 premiers p3d.
|
||||
// Sinon, on construit le chanfrein par la methode GeomFill_ConstrainedFilling
|
||||
Standard_Boolean c1plan = c1triangle;
|
||||
gp_Vec v1(p3d[pivot],p3d[deb]);
|
||||
gp_Vec v2(p3d[pivot],p3d[fin]);
|
||||
gp_Vec nor = v1.Crossed(v2);
|
||||
|
||||
done = Standard_False;
|
||||
|
||||
Standard_Integer Icf=0,Icl=0;
|
||||
Handle(Geom2d_Curve) debpc1,finpc1;
|
||||
|
||||
if (!c1triangle) {
|
||||
c1plan = CoPlanar(p3d[0], p3d[1], p3d[2], p3d[3]);
|
||||
}
|
||||
|
||||
if (c1plan) {
|
||||
// c1plan
|
||||
//-------
|
||||
|
||||
// on construit le plan
|
||||
gp_Dir ndir(nor);
|
||||
// gp_Dir xdir(gp_Vec(p3d[fin],p3d[deb]));
|
||||
gp_Dir xdir = gp_Dir(gp_Vec(p3d[fin],p3d[deb]));
|
||||
gp_Ax3 planAx3(p3d[pivot],ndir,xdir);
|
||||
if (planAx3.YDirection().Dot(v1)<=0.)
|
||||
planAx3.YReverse();
|
||||
Handle(Geom_Plane) gpl= new Geom_Plane(planAx3);
|
||||
coin->ChangeSurf(ChFiKPart_IndexSurfaceInDS(gpl,DStr));
|
||||
|
||||
// on oriente coin
|
||||
gp_Vec norface = norpl;
|
||||
if (face[pivot].Orientation() == TopAbs_REVERSED )
|
||||
norface.Reverse();
|
||||
gp_Vec norcoin = gpl->Pln().Position().XDirection().
|
||||
Crossed (gpl->Pln().Position().YDirection());
|
||||
if ( norcoin.Dot(norface) <= 0. )
|
||||
coin->ChangeOrientation() = TopAbs_REVERSED;
|
||||
else
|
||||
coin->ChangeOrientation() = TopAbs_FORWARD;
|
||||
|
||||
// on calcule les intersections
|
||||
Handle(Geom_Curve) gcpiv,gcdeb,gcfin;
|
||||
Handle(Geom_TrimmedCurve) gcface;
|
||||
Handle(Geom2d_Curve) pivpc1,pivpc2,debpc2,finpc2,facepc1,facepc2;
|
||||
gp_Pnt2d ptbid;
|
||||
|
||||
//intersection coin-pivot
|
||||
Standard_Real tolrcoinpiv;
|
||||
if (!ComputeIntersection(DStr,fdpiv,coin,
|
||||
p3d[fin],p2d[fin],p3d[deb],p2d[deb],
|
||||
gcpiv,pivpc1,pivpc2,deru,derv,ptbid,
|
||||
tolesp,tol2d,tolrcoinpiv))
|
||||
StdFail_NotDone::Raise("echec calcul intersection coin-pivot");
|
||||
gp_Vec norpiv = deru.Crossed(derv);
|
||||
|
||||
//intersection coin-deb
|
||||
Standard_Real tolrcoindeb;
|
||||
gp_Pnt2d p2d1,p2d2;
|
||||
if(c1triangle)
|
||||
p2d1 = fddeb->Interference(jf[deb][fin]).PCurveOnSurf()->Value(p[deb][fin]);
|
||||
else
|
||||
p2d1 = fddeb->Interference(jf[deb][fin]).PCurveOnSurf()->Value(p[deb][pivot]);
|
||||
|
||||
p2d2 = fddeb->Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
|
||||
|
||||
if (!ComputeIntersection(DStr,fddeb,coin,
|
||||
p3d[pivot],p2d1,p3d[fin],p2d2,
|
||||
gcdeb,debpc1,debpc2,deru,derv,ptbid,
|
||||
tolesp,tol2d,tolrcoindeb))
|
||||
StdFail_NotDone::Raise("echec calcul intersection coin-deb");
|
||||
Icf = DStr.AddCurve(TopOpeBRepDS_Curve(gcdeb,tolrcoindeb));
|
||||
|
||||
//intersection coin-fin
|
||||
Standard_Real tolrcoinfin;
|
||||
gp_Pnt p3dface;
|
||||
if (c1triangle){
|
||||
p3dface = p3d[pivot];
|
||||
p2d1 = fdfin->Interference(jf[fin][deb]).PCurveOnSurf()->Value(p[fin][deb]);
|
||||
}
|
||||
else {
|
||||
p3dface = p3d[3];
|
||||
p2d1 = fdfin->Interference(jf[fin][deb]).PCurveOnSurf()->Value(p[fin][pivot]);
|
||||
}
|
||||
p2d2 = fdfin->Interference(jf[fin][pivot]).PCurveOnSurf()->Value(p[fin][pivot]);
|
||||
if (!ComputeIntersection(DStr,fdfin,coin,
|
||||
p3dface,p2d1,p3d[deb],p2d2,
|
||||
gcfin,finpc1,finpc2,deru,derv,ptbid,
|
||||
tolesp,tol2d,tolrcoinfin))
|
||||
StdFail_NotDone::Raise("echec calcul intersection coin-face");
|
||||
Icl = DStr.AddCurve(TopOpeBRepDS_Curve(gcfin,tolrcoinfin));
|
||||
|
||||
//!c1triangle: intersection coin-face[pivot]
|
||||
if (!c1triangle) {
|
||||
GeomInt_IntSS inter;
|
||||
BRepAdaptor_Surface facebid(face[pivot]);
|
||||
Handle(Geom_Surface)
|
||||
surfbid = Handle(Geom_Surface)::DownCast(facebid.Surface().Surface()->Transformed(facebid.Trsf()));
|
||||
inter.Perform(gpl,surfbid,Precision::Intersection());
|
||||
if (inter.IsDone()) {
|
||||
Standard_Integer nbl = inter.NbLines();
|
||||
if (nbl > 1) {
|
||||
#ifdef DEB
|
||||
cout<<"trop d'intersection entre les surfaces"<<endl;
|
||||
#endif
|
||||
}
|
||||
else if (nbl == 1) {
|
||||
ChFi3d_TrimCurve(inter.Line(1),p3d[pivot],p3dface,gcface);
|
||||
|
||||
Handle(GeomAdaptor_HCurve) gac = new GeomAdaptor_HCurve();
|
||||
gac->ChangeCurve().Load(gcface);
|
||||
Handle(GeomAdaptor_HSurface) gas = new GeomAdaptor_HSurface;
|
||||
gas->ChangeSurface().Load(gpl);
|
||||
Handle(BRepAdaptor_HSurface) gaf = new BRepAdaptor_HSurface;
|
||||
gaf->ChangeSurface().Initialize(face[pivot]);
|
||||
|
||||
Standard_Real tolr;
|
||||
ChFi3d_ProjectPCurv(gac,gaf,facepc1,tolesp,tolr);
|
||||
ChFi3d_ProjectPCurv(gac,gas,facepc2,tolesp,tolr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// on remplit les donnees du coin oriente face-pivot
|
||||
TopAbs_Orientation trans;
|
||||
|
||||
//avec les CommonPoints
|
||||
coin->ChangeVertexFirstOnS1().SetPoint(p3d[pivot]);
|
||||
coin->ChangeVertexFirstOnS2().SetPoint(p3d[fin]);
|
||||
if (c1triangle)
|
||||
coin->ChangeVertexLastOnS1().SetPoint(p3d[pivot]);
|
||||
else
|
||||
coin->ChangeVertexLastOnS1().SetPoint(p3d[3]);
|
||||
coin->ChangeVertexLastOnS2().SetPoint(p3d[deb]);
|
||||
|
||||
//avec les FaceInterference
|
||||
// Standard_Integer Igcpiv,Igcdeb,Igcfin,Igcface;
|
||||
Standard_Integer Igcpiv,Igcface;
|
||||
ChFiDS_FaceInterference& fi1 = coin->ChangeInterferenceOnS1();
|
||||
ChFiDS_FaceInterference& fi2 = coin->ChangeInterferenceOnS2();
|
||||
|
||||
//sur face[pivot]
|
||||
if (norcoin.Dot(norpl) <= 0.)
|
||||
trans = TopAbs_FORWARD;
|
||||
else
|
||||
trans = TopAbs_REVERSED;
|
||||
Handle(Geom2d_Curve) bidpc;
|
||||
if (c1triangle)
|
||||
fi1.SetInterference(0,trans,bidpc,bidpc);
|
||||
else {
|
||||
Igcface = ChFiKPart_IndexCurveInDS(gcface,DStr);
|
||||
fi1.SetInterference(Igcface,trans,facepc1,facepc2);
|
||||
fi1.SetFirstParameter(gcface->FirstParameter());
|
||||
fi1.SetLastParameter(gcface->LastParameter());
|
||||
}
|
||||
//sur le pivot
|
||||
if (norcoin.Dot(norpiv) <= 0.)
|
||||
trans = TopAbs_REVERSED;
|
||||
else
|
||||
trans = TopAbs_FORWARD;
|
||||
Igcpiv = ChFiKPart_IndexCurveInDS(gcpiv,DStr);
|
||||
fi2.SetInterference(Igcpiv,trans,pivpc1,pivpc2);
|
||||
fi2.SetFirstParameter(gcpiv->FirstParameter());
|
||||
fi2.SetLastParameter(gcpiv->LastParameter());
|
||||
|
||||
done = Standard_True;
|
||||
|
||||
}
|
||||
else {
|
||||
// !c1plan
|
||||
//--------
|
||||
|
||||
Handle(Geom_Surface) Surfcoin;
|
||||
Handle(Geom2d_Curve) PCurveOnFace,PCurveOnPiv;
|
||||
|
||||
// le contour a remplir est constitue de courbes isos sur deb et fin
|
||||
// de deux pcurves calculees sur piv et la face opposee.
|
||||
Handle(GeomFill_Boundary) Bdeb,Bfin,Bpiv,Bfac;
|
||||
Standard_Integer ind1 = fddeb->Interference(jf[deb][pivot]).LineIndex();
|
||||
Standard_Integer ind2 = fdfin->Interference(jf[fin][pivot]).LineIndex();
|
||||
gp_Pnt Pfin,Pdeb;
|
||||
gp_Vec vpfin,vpdeb;
|
||||
|
||||
DStr.Curve(ind1).Curve()->D1(p[deb][pivot],Pfin,vpfin);
|
||||
DStr.Curve(ind2).Curve()->D1(p[fin][pivot],Pdeb,vpdeb);
|
||||
|
||||
if (issmooth) {
|
||||
// les bords de coin sont des lignes courbes qui suivent les
|
||||
// tangentes donnees
|
||||
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],p2d[pivot],Tgpiv,
|
||||
sens[fin],p2d[3],Tg3,tolesp,2.e-4);
|
||||
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],p2d[fin],vpfin,
|
||||
sens[fin],p2d[deb],vpdeb,tolesp,2.e-4);
|
||||
}
|
||||
else {
|
||||
// les bords de coin sont des segments
|
||||
// Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
|
||||
// p2d[3],tolesp,2.e-4);
|
||||
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
|
||||
p2d[3],tolesp,2.e-4);
|
||||
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,p2d[fin],
|
||||
p2d[deb],tolesp,2.e-4);
|
||||
}
|
||||
|
||||
gp_Pnt2d pdeb1 = fddeb->Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
|
||||
gp_Pnt2d pdeb2 = fddeb->Interference(jf[deb][fin]).PCurveOnSurf()->Value(p[deb][pivot]);
|
||||
gp_Pnt2d pfin1 = fdfin->Interference(jf[fin][pivot]).PCurveOnSurf()->Value(p[fin][pivot]);
|
||||
gp_Pnt2d pfin2 = fdfin->Interference(jf[fin][deb]).PCurveOnSurf()->Value(p[fin][pivot]);
|
||||
|
||||
if (issmooth) {
|
||||
// il faut homogeneiser, mettre les bords "BoundWithSurf"
|
||||
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,tolesp,2.e-4);
|
||||
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,tolesp,2.e-4);
|
||||
}
|
||||
else {
|
||||
// ou les 4 bords de type "FreeBoundary"
|
||||
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,
|
||||
tolesp,2.e-4,Standard_True);
|
||||
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,
|
||||
tolesp,2.e-4,Standard_True);
|
||||
}
|
||||
GeomFill_ConstrainedFilling fil(8,20);
|
||||
fil.Init(Bpiv,Bfin,Bfac,Bdeb);
|
||||
|
||||
Surfcoin = fil.Surface();
|
||||
// on se ramene au sens face surf: S1 = face, S2 = surf
|
||||
Surfcoin->VReverse();
|
||||
|
||||
done = CompleteData(coin,Surfcoin,
|
||||
Fac,PCurveOnFace,
|
||||
Surf,PCurveOnPiv,fdpiv->Orientation(),0,
|
||||
0,0,0,0);
|
||||
}
|
||||
Standard_Real P1deb,P2deb,P1fin,P2fin;
|
||||
|
||||
if (done){
|
||||
Standard_Integer If1,If2,Il1,Il2;
|
||||
|
||||
// Mise a jour des 4 Stripes et de la DS
|
||||
// -------------------------------------
|
||||
|
||||
const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
|
||||
const ChFiDS_CommonPoint& Pf2 = coin->VertexFirstOnS2();
|
||||
ChFiDS_CommonPoint& Pl1 = coin->ChangeVertexLastOnS1();
|
||||
if(c1triangle)
|
||||
Pl1 = coin->ChangeVertexFirstOnS1();
|
||||
const ChFiDS_CommonPoint& Pl2 = coin->VertexLastOnS2();
|
||||
|
||||
// le coin pour commencer,
|
||||
// -----------------------
|
||||
ChFiDS_Regul regdeb, regfin;
|
||||
If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
|
||||
If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
|
||||
if (c1triangle)
|
||||
Il1 = If1;
|
||||
else
|
||||
Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
|
||||
Il2 = ChFi3d_IndexPointInDS(Pl2,DStr);
|
||||
|
||||
coin->ChangeIndexOfS1(DStr.AddShape(face[pivot]));
|
||||
coin->ChangeIndexOfS2(-fdpiv->Surf());
|
||||
|
||||
// first points
|
||||
gp_Pnt2d pp1,pp2;
|
||||
if (c1plan) {
|
||||
P1deb = DStr.Curve(Icf).Curve()->FirstParameter();
|
||||
P2deb = DStr.Curve(Icf).Curve()->LastParameter();
|
||||
}
|
||||
else {
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().FirstParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value( coin->InterferenceOnS2().FirstParameter());
|
||||
Handle(Geom_Curve) C3d;
|
||||
Standard_Real tolreached;
|
||||
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeFirstPCurve(),P1deb,P2deb,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
|
||||
Icf = DStr.AddCurve(Tcurv);
|
||||
}
|
||||
|
||||
regdeb.SetCurve(Icf);
|
||||
regdeb.SetS1(coin->Surf(),0);
|
||||
regdeb.SetS2(fddeb->Surf(),0);
|
||||
myRegul.Append(regdeb);
|
||||
corner->ChangeFirstCurve(Icf);
|
||||
corner->ChangeFirstParameters(P1deb,P2deb);
|
||||
corner->ChangeIndexFirstPointOnS1(If1);
|
||||
corner->ChangeIndexFirstPointOnS2(If2);
|
||||
|
||||
// last points
|
||||
if (c1plan) {
|
||||
P1fin = DStr.Curve(Icl).Curve()->FirstParameter();
|
||||
P2fin = DStr.Curve(Icl).Curve()->LastParameter();
|
||||
}
|
||||
else {
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().LastParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().LastParameter());
|
||||
Handle(Geom_Curve) C3d;
|
||||
Standard_Real tolreached;
|
||||
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeLastPCurve(),P1fin,P2fin,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
|
||||
Icl = DStr.AddCurve(Tcurv);
|
||||
}
|
||||
regfin.SetCurve(Icl);
|
||||
regfin.SetS1(coin->Surf(),0);
|
||||
regfin.SetS2(fdfin->Surf(),0);
|
||||
myRegul.Append(regfin);
|
||||
corner->ChangeLastCurve(Icl);
|
||||
corner->ChangeLastParameters(P1fin,P2fin);
|
||||
corner->ChangeIndexLastPointOnS1(Il1);
|
||||
corner->ChangeIndexLastPointOnS2(Il2);
|
||||
|
||||
// puis la CornerData du debut,
|
||||
// ----------------------------
|
||||
Standard_Boolean isfirst = (sens[deb] == 1), rev = (jf[deb][fin] == 2);
|
||||
Standard_Integer isurf1 = 1, isurf2 = 2;
|
||||
Standard_Real par = p[deb][pivot], par2 = p[deb][pivot];
|
||||
if(c1triangle) par2 = p[deb][fin];
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
CD[deb]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
CD[deb]->SetCurve(Icf,isfirst);
|
||||
CD[deb]->SetIndexPoint(If1,isfirst,isurf1);
|
||||
CD[deb]->SetIndexPoint(If2,isfirst,isurf2);
|
||||
CD[deb]->SetParameters(isfirst,P1deb,P2deb);
|
||||
fddeb->ChangeVertex(isfirst,isurf1) = Pf1;
|
||||
fddeb->ChangeVertex(isfirst,isurf2) = Pf2;
|
||||
fddeb->ChangeInterference(isurf1).SetParameter(par2,isfirst);
|
||||
fddeb->ChangeInterference(isurf2).SetParameter(par,isfirst);
|
||||
if (c1plan)
|
||||
CD[deb]->ChangePCurve(isfirst) = debpc1;
|
||||
else {
|
||||
pp1 = fddeb->InterferenceOnS1().PCurveOnSurf()->Value(par);
|
||||
pp2 = fddeb->InterferenceOnS2().PCurveOnSurf()->Value(par);
|
||||
ChFi3d_ComputePCurv(pp1,pp2,CD[deb]->ChangePCurve(isfirst),P1deb,P2deb,rev);
|
||||
}
|
||||
|
||||
// puis la CornerData de la fin,
|
||||
// -----------------------------
|
||||
isfirst = (sens[fin] == 1); rev = (jf[fin][deb] == 2);
|
||||
isurf1 = 1; isurf2 = 2;
|
||||
par = p[fin][pivot]; par2 = p[fin][pivot];
|
||||
if(c1triangle) par2 = p[fin][deb];
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
CD[fin]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
CD[fin]->SetCurve(Icl,isfirst);
|
||||
CD[fin]->SetIndexPoint(Il1,isfirst,isurf1);
|
||||
CD[fin]->SetIndexPoint(Il2,isfirst,isurf2);
|
||||
CD[fin]->SetParameters(isfirst,P1fin,P2fin);
|
||||
fdfin->ChangeVertex(isfirst,isurf1) = Pl1;
|
||||
fdfin->ChangeVertex(isfirst,isurf2) = Pl2;
|
||||
fdfin->ChangeInterference(isurf1).SetParameter(par2,isfirst);
|
||||
fdfin->ChangeInterference(isurf2).SetParameter(par,isfirst);
|
||||
if (c1plan)
|
||||
CD[fin]->ChangePCurve(isfirst) = finpc1;
|
||||
else {
|
||||
pp1 = fdfin->InterferenceOnS1().PCurveOnSurf()->Value(par);
|
||||
pp2 = fdfin->InterferenceOnS2().PCurveOnSurf()->Value(par);
|
||||
ChFi3d_ComputePCurv(pp1,pp2,CD[fin]->ChangePCurve(isfirst),P1fin,P2fin,rev);
|
||||
}
|
||||
|
||||
// et enfin le pivot.
|
||||
// ------------------
|
||||
ChFiDS_FaceInterference& fi = coin->ChangeInterferenceOnS2();
|
||||
isfirst = (sens[pivot] == 1); rev = (jf[pivot][deb] == 2);
|
||||
isurf1 = 1; isurf2 = 2;
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
CD[pivot]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
CD[pivot]->SetCurve(fi.LineIndex(),isfirst);
|
||||
CD[pivot]->ChangePCurve(isfirst) = fi.PCurveOnFace();
|
||||
CD[pivot]->SetIndexPoint(If2,isfirst,isurf1);
|
||||
CD[pivot]->SetIndexPoint(Il2,isfirst,isurf2);
|
||||
CD[pivot]->SetParameters(isfirst,fi.FirstParameter(),fi.LastParameter());
|
||||
fdpiv->ChangeVertex(isfirst,isurf1) = Pf2;
|
||||
fdpiv->ChangeVertex(isfirst,isurf2) = Pl2;
|
||||
fdpiv->ChangeInterference(isurf1).SetParameter(p[pivot][deb],isfirst);
|
||||
fdpiv->ChangeInterference(isurf2).SetParameter(p[pivot][fin],isfirst);
|
||||
CD[pivot]->InDS(isfirst); // filDS fait deja le boulot depuis le coin.
|
||||
}
|
||||
|
||||
//On tronque les corners data et met a jour les index.
|
||||
//----------------------------------------------------
|
||||
|
||||
if(i[deb][pivot] < Index[deb]){
|
||||
CD[deb]->ChangeSetOfSurfData()->Remove(i[deb][pivot]+1,Index[deb]);
|
||||
Index[deb] = i[deb][pivot];
|
||||
}
|
||||
else if(i[deb][pivot] > Index[deb]) {
|
||||
CD[deb]->ChangeSetOfSurfData()->Remove(Index[deb],i[deb][pivot]-1);
|
||||
i[deb][pivot] = Index[deb];
|
||||
}
|
||||
if(i[fin][pivot] < Index[fin]) {
|
||||
CD[fin]->ChangeSetOfSurfData()->Remove(i[fin][pivot]+1,Index[fin]);
|
||||
Index[fin] = i[fin][pivot];
|
||||
}
|
||||
else if(i[fin][pivot] > Index[fin]) {
|
||||
CD[fin]->ChangeSetOfSurfData()->Remove(Index[fin],i[fin][pivot]-1);
|
||||
i[fin][pivot] = Index[fin];
|
||||
}
|
||||
// il faudra ici tenir compte des coins mutants.
|
||||
if(i[pivot][deb] < Index[pivot]) {
|
||||
CD[pivot]->ChangeSetOfSurfData()->Remove(i[pivot][deb]+1,Index[pivot]);
|
||||
Index[pivot] = i[pivot][deb];
|
||||
}
|
||||
else if(i[pivot][deb] > Index[pivot]) {
|
||||
CD[pivot]->ChangeSetOfSurfData()->Remove(Index[pivot],i[pivot][deb]-1);
|
||||
i[pivot][deb] = Index[pivot];
|
||||
}
|
||||
if(!myEVIMap.IsBound(Vtx)){
|
||||
TColStd_ListOfInteger li;
|
||||
myEVIMap.Bind(Vtx,li);
|
||||
}
|
||||
myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
|
||||
corner->SetSolidIndex(CD[pivot]->SolidIndex());
|
||||
myListStripe.Append(corner);
|
||||
}
|
299
src/ChFi3d/ChFi3d_Debug.cxx
Executable file
299
src/ChFi3d/ChFi3d_Debug.cxx
Executable file
@@ -0,0 +1,299 @@
|
||||
// File: ChFi3d_Debug.cxx
|
||||
// Created: Wed Sep 21 12:49:56 1994
|
||||
// Author: Laurent BOURESCHE
|
||||
// <lbo@phylox>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <TopOpeBRepDS_Surface.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <OSD_Chronometer.hxx>
|
||||
|
||||
#ifdef DRAW
|
||||
#include <DBRep.hxx>
|
||||
#endif
|
||||
|
||||
#ifdef DEB
|
||||
OSD_Chronometer simul,elspine,chemine;
|
||||
#endif
|
||||
|
||||
//*********************************
|
||||
// chronometrage de la simulation
|
||||
//*********************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceCHRON = Standard_False;
|
||||
void ChFi3d_SettraceCHRON(const Standard_Boolean b)
|
||||
{ ChFi3d_traceCHRON = b; }
|
||||
Standard_Boolean ChFi3d_GettraceCHRON()
|
||||
{ return ChFi3d_traceCHRON; }
|
||||
|
||||
//*********************************
|
||||
// trace d une ligne de cheminement
|
||||
//*********************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceDRAWWALK = Standard_False;
|
||||
void ChFi3d_SettraceDRAWWALK(const Standard_Boolean b)
|
||||
{ ChFi3d_traceDRAWWALK = b; }
|
||||
Standard_Boolean ChFi3d_GettraceDRAWWALK()
|
||||
{ return ChFi3d_traceDRAWWALK; }
|
||||
|
||||
//**********************************
|
||||
// trace d une ligne d intersection
|
||||
//**********************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceDRAWINT = Standard_False;
|
||||
void ChFi3d_SettraceDRAWINT(const Standard_Boolean b)
|
||||
{ ChFi3d_traceDRAWINT = b; }
|
||||
Standard_Boolean ChFi3d_GettraceDRAWINT()
|
||||
{ return ChFi3d_traceDRAWINT; }
|
||||
|
||||
//*************************************************
|
||||
// recuperation des surfaces des conges approximes.
|
||||
//*************************************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceDRAWFIL = Standard_False;
|
||||
void ChFi3d_SettraceDRAWFIL(const Standard_Boolean b)
|
||||
{ ChFi3d_traceDRAWFIL = b; }
|
||||
Standard_Boolean ChFi3d_GettraceDRAWFIL()
|
||||
{ return ChFi3d_traceDRAWFIL; }
|
||||
|
||||
|
||||
//*************************************************
|
||||
// recuperation des faces elargie pour le cheminement.
|
||||
//*************************************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceDRAWENLARGE = Standard_False;
|
||||
void ChFi3d_SettraceDRAWENLARGE(const Standard_Boolean b)
|
||||
{ ChFi3d_traceDRAWENLARGE = b; }
|
||||
Standard_Boolean ChFi3d_GettraceDRAWENLARGE()
|
||||
{ return ChFi3d_traceDRAWENLARGE; }
|
||||
|
||||
//*************************************************
|
||||
// recuperation de la ligne guide pour les coins triples.
|
||||
//*************************************************
|
||||
|
||||
static Standard_Boolean ChFi3d_traceDRAWSPINE = Standard_False;
|
||||
void ChFi3d_SettraceDRAWSPINE(const Standard_Boolean b)
|
||||
{ ChFi3d_traceDRAWSPINE = b; }
|
||||
Standard_Boolean ChFi3d_GettraceDRAWSPINE()
|
||||
{ return ChFi3d_traceDRAWSPINE; }
|
||||
|
||||
//*************************************************
|
||||
// set du type de ligne guide pour les coins triples.
|
||||
//*************************************************
|
||||
|
||||
void ChFi3d_SetcontextSPINEBEZIER(const Standard_Boolean b);
|
||||
void ChFi3d_SetcontextSPINECIRCLE(const Standard_Boolean b);
|
||||
void ChFi3d_SetcontextSPINECE(const Standard_Boolean b);
|
||||
|
||||
static Standard_Boolean ChFi3d_contextSPINEBEZIER = Standard_False;
|
||||
void ChFi3d_SetcontextSPINEBEZIER(const Standard_Boolean b){
|
||||
ChFi3d_contextSPINEBEZIER = b;
|
||||
if(b){
|
||||
ChFi3d_SetcontextSPINECIRCLE(Standard_False);
|
||||
ChFi3d_SetcontextSPINECE(Standard_False);
|
||||
}
|
||||
}
|
||||
Standard_Boolean ChFi3d_GetcontextSPINEBEZIER()
|
||||
{ return ChFi3d_contextSPINEBEZIER; }
|
||||
|
||||
static Standard_Boolean ChFi3d_contextSPINECIRCLE = Standard_False;
|
||||
void ChFi3d_SetcontextSPINECIRCLE(const Standard_Boolean b){
|
||||
ChFi3d_contextSPINECIRCLE = b;
|
||||
if(b){
|
||||
ChFi3d_SetcontextSPINEBEZIER(Standard_False);
|
||||
ChFi3d_SetcontextSPINECE(Standard_False);
|
||||
}
|
||||
}
|
||||
Standard_Boolean ChFi3d_GetcontextSPINECIRCLE()
|
||||
{ return ChFi3d_contextSPINECIRCLE; }
|
||||
|
||||
static Standard_Boolean ChFi3d_contextSPINECE = Standard_False;
|
||||
void ChFi3d_SetcontextSPINECE(const Standard_Boolean b){
|
||||
ChFi3d_contextSPINECE = b;
|
||||
if(b){
|
||||
ChFi3d_SetcontextSPINEBEZIER(Standard_False);
|
||||
ChFi3d_SetcontextSPINECIRCLE(Standard_False);
|
||||
}
|
||||
}
|
||||
Standard_Boolean ChFi3d_GetcontextSPINECE()
|
||||
{ return ChFi3d_contextSPINECE; }
|
||||
|
||||
//*************************************************
|
||||
// Passage force par le cheminement pour les KPart
|
||||
//*************************************************
|
||||
static Standard_Boolean ChFi3d_contextFORCEBLEND = Standard_False;
|
||||
void ChFi3d_SetcontextFORCEBLEND(const Standard_Boolean b)
|
||||
{ ChFi3d_contextFORCEBLEND = b; }
|
||||
Standard_Boolean ChFi3d_GetcontextFORCEBLEND()
|
||||
{ return ChFi3d_contextFORCEBLEND; }
|
||||
|
||||
static Standard_Boolean ChFi3d_contextFORCEFILLING = Standard_False;
|
||||
void ChFi3d_SetcontextFORCEFILLING(const Standard_Boolean b)
|
||||
{ ChFi3d_contextFORCEFILLING = b; }
|
||||
Standard_Boolean ChFi3d_GetcontextFORCEFILLING()
|
||||
{ return ChFi3d_contextFORCEFILLING; }
|
||||
|
||||
//*************************************************
|
||||
// Pas d optimisation pour les approx
|
||||
//*************************************************
|
||||
static Standard_Boolean ChFi3d_contextNOOPT = Standard_False;
|
||||
void ChFi3d_SetcontextNOOPT(const Standard_Boolean b)
|
||||
{ ChFi3d_contextNOOPT = b; }
|
||||
Standard_Boolean ChFi3d_GetcontextNOOPT()
|
||||
{ return ChFi3d_contextNOOPT; }
|
||||
|
||||
// ***********************************************
|
||||
// initialisation et resultat d'un chrono
|
||||
//************************************************
|
||||
Standard_EXPORT void ChFi3d_InitChron(OSD_Chronometer& ch)
|
||||
{
|
||||
ch.Reset();
|
||||
ch.Start();
|
||||
}
|
||||
|
||||
Standard_EXPORT void ChFi3d_ResultChron( OSD_Chronometer & ch,
|
||||
Standard_Real & time)
|
||||
{
|
||||
Standard_Real tch ;
|
||||
ch.Stop();
|
||||
ch.Show(tch);
|
||||
time=time +tch;
|
||||
}
|
||||
|
||||
|
||||
//==============================================================
|
||||
// function : ChFi3d_CheckSurfData
|
||||
// purpose : fonction permettant de tracer une SurfData afin
|
||||
// de verifier la bonne construction de tous les
|
||||
// elements, notamment des pcurves
|
||||
//==============================================================
|
||||
#ifdef DRAW
|
||||
static Standard_Integer NbSD = 0;
|
||||
#endif
|
||||
void ChFi3d_CheckSurfData(const TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_SurfData)& Data)
|
||||
{
|
||||
//trace de la surface definie par le chanfrein ou le conge
|
||||
// correspondant a la SurfData
|
||||
|
||||
Handle(Geom_Surface) surf = (DStr.Surface( Data->Surf())).Surface();
|
||||
if (!surf.IsNull()){
|
||||
BRep_Builder B;
|
||||
TopoDS_Face F;
|
||||
B.MakeFace(F,surf,0.);
|
||||
TopoDS_Wire W;
|
||||
B.MakeWire(W);
|
||||
|
||||
TopoDS_Vertex V1,V2,V3,V4;
|
||||
B.MakeVertex(V1,Data->VertexFirstOnS1().Point(),0.);
|
||||
B.MakeVertex(V2,Data->VertexLastOnS1().Point(),0.);
|
||||
B.MakeVertex(V3,Data->VertexLastOnS2().Point(),0.);
|
||||
B.MakeVertex(V4,Data->VertexFirstOnS2().Point(),0.);
|
||||
|
||||
TopoDS_Edge E1,E2,E3,E4;
|
||||
B.MakeEdge(E1);
|
||||
B.MakeEdge(E2);
|
||||
B.MakeEdge(E3);
|
||||
B.MakeEdge(E4);
|
||||
|
||||
B.UpdateEdge(E1,Data->InterferenceOnS1().PCurveOnSurf(),F,0.);
|
||||
B.UpdateEdge(E3,Data->InterferenceOnS2().PCurveOnSurf(),F,0.);
|
||||
V1.Orientation(TopAbs_FORWARD);
|
||||
B.Add(E1,V1);
|
||||
B.UpdateVertex(V1,Data->InterferenceOnS1().FirstParameter(),E1,0.);
|
||||
V2.Orientation(TopAbs_REVERSED);
|
||||
B.Add(E1,V2);
|
||||
B.UpdateVertex(V2,Data->InterferenceOnS1().LastParameter(),E1,0.);
|
||||
|
||||
|
||||
V4.Orientation(TopAbs_FORWARD);
|
||||
B.Add(E3,V4);
|
||||
B.UpdateVertex(V4,Data->InterferenceOnS2().FirstParameter(),E3,0.);
|
||||
V3.Orientation(TopAbs_REVERSED);
|
||||
B.Add(E3,V3);
|
||||
B.UpdateVertex(V3,Data->InterferenceOnS2().LastParameter(),E3,0.);
|
||||
|
||||
gp_Pnt2d pp1,pp2,pp3,pp4;
|
||||
pp1 = Data->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(Data->InterferenceOnS1().FirstParameter());
|
||||
pp2 = Data->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(Data->InterferenceOnS1().LastParameter());
|
||||
pp3 = Data->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(Data->InterferenceOnS2().LastParameter());
|
||||
pp4 = Data->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(Data->InterferenceOnS2().FirstParameter());
|
||||
gp_Dir2d d1(gp_Vec2d(pp1,pp4));
|
||||
gp_Dir2d d2(gp_Vec2d(pp2,pp3));
|
||||
Handle(Geom2d_Line) l1 = new Geom2d_Line(pp1,d1);
|
||||
Handle(Geom2d_Line) l2 = new Geom2d_Line(pp2,d2);
|
||||
|
||||
B.UpdateEdge(E4,l1,F,0.);
|
||||
V1.Orientation(TopAbs_FORWARD);
|
||||
B.Add(E4,V1);
|
||||
B.UpdateVertex(V1,0.,E4,0.);
|
||||
V4.Orientation(TopAbs_REVERSED);
|
||||
B.Add(E4,V4);
|
||||
B.UpdateVertex(V4,pp4.Distance(pp1),E4,0.);
|
||||
|
||||
B.UpdateEdge(E2,l2,F,0.);
|
||||
V2.Orientation(TopAbs_FORWARD);
|
||||
B.Add(E2,V2);
|
||||
B.UpdateVertex(V2,0.,E2,0.);
|
||||
V3.Orientation(TopAbs_REVERSED);
|
||||
B.Add(E2,V3);
|
||||
B.UpdateVertex(V3,pp3.Distance(pp2),E2,0.);
|
||||
|
||||
gp_Pnt pw1,pw2,ppp;
|
||||
ppp = surf->Value(pp1.X(),pp1.Y());
|
||||
pw1 = surf->Value(0.9*pp1.X()+0.1*pp2.X(),0.9*pp1.Y()+0.1*pp2.Y());
|
||||
pw2 = surf->Value(0.9*pp1.X()+0.1*pp4.X(),0.9*pp1.Y()+0.1*pp4.Y());
|
||||
gp_Vec vv1(ppp,pw1);
|
||||
gp_Vec vv2(ppp,pw2);
|
||||
gp_Vec Vwire = vv1^vv2;
|
||||
|
||||
surf->D1(pp1.X(),pp1.Y(),pw1,vv1,vv2);
|
||||
gp_Vec Vsurf = vv1^vv2;
|
||||
Standard_Boolean rev = Vsurf.Dot(Vwire)<=0.;
|
||||
|
||||
E1.Orientation(TopAbs_FORWARD);
|
||||
E2.Orientation(TopAbs_FORWARD);
|
||||
E3.Orientation(TopAbs_REVERSED);
|
||||
E4.Orientation(TopAbs_REVERSED);
|
||||
if(rev){
|
||||
E1.Orientation(TopAbs_REVERSED);
|
||||
E2.Orientation(TopAbs_REVERSED);
|
||||
E3.Orientation(TopAbs_FORWARD);
|
||||
E4.Orientation(TopAbs_FORWARD);
|
||||
}
|
||||
B.Add(W,E1);
|
||||
B.Add(W,E2);
|
||||
B.Add(W,E3);
|
||||
B.Add(W,E4);
|
||||
|
||||
W.Orientation(TopAbs_FORWARD);
|
||||
B.Add(F,W);
|
||||
|
||||
#ifdef DRAW
|
||||
// char name[100];
|
||||
char* name = new char[100];
|
||||
sprintf(name,"fillet_%d",NbSD++);
|
||||
DBRep::Set(name,F);
|
||||
#endif
|
||||
}
|
||||
}
|
466
src/ChFi3d/ChFi3d_FilBuilder.cdl
Executable file
466
src/ChFi3d/ChFi3d_FilBuilder.cdl
Executable file
@@ -0,0 +1,466 @@
|
||||
-- File: ChFi3d_FilBuilder.cdl
|
||||
-- Created: Tue Apr 25 10:54:55 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@phylox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
class FilBuilder from ChFi3d inherits Builder from ChFi3d
|
||||
|
||||
---Purpose: Tool of construction of fillets 3d on edges.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
XY from gp,
|
||||
State from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
Function from Law,
|
||||
HCurve from Adaptor3d,
|
||||
TopolTool from Adaptor3d,
|
||||
HCurve2d from BRepAdaptor,
|
||||
HSurface from BRepAdaptor,
|
||||
HElSpine from ChFiDS,
|
||||
SurfData from ChFiDS,
|
||||
SequenceOfSurfData from ChFiDS,
|
||||
Stripe from ChFiDS,
|
||||
ListOfStripe from ChFiDS,
|
||||
Spine from ChFiDS,
|
||||
Function from Blend,
|
||||
SecHArray1 from ChFiDS,
|
||||
FilletShape from ChFi3d,
|
||||
SectionShape from BlendFunc,
|
||||
Vector from math,
|
||||
Line from BRepBlend
|
||||
|
||||
is
|
||||
|
||||
Create(S : Shape from TopoDS;
|
||||
FShape: FilletShape from ChFi3d = ChFi3d_Rational;
|
||||
Ta : Real from Standard = 1.0e-2)
|
||||
|
||||
returns FilBuilder from ChFi3d;
|
||||
|
||||
SetFilletShape(me: in out; FShape: FilletShape from ChFi3d)
|
||||
---Purpose: Sets the type of fillet surface.
|
||||
|
||||
is static;
|
||||
|
||||
GetFilletShape(me)
|
||||
---Purpose: Returns the type of fillet surface.
|
||||
returns FilletShape from ChFi3d
|
||||
is static;
|
||||
|
||||
------------------------------------------------
|
||||
--- Ajout d un contour sans indication de rayon.
|
||||
------------------------------------------------
|
||||
|
||||
Add(me : in out; E : Edge from TopoDS)
|
||||
---Purpose: initialisation of a contour with the first edge
|
||||
-- (the following are found by propagation).
|
||||
-- Attention, you need to start with SetRadius.
|
||||
--
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------------
|
||||
--- Ajout ou update d un contour avec un rayon defini pour la
|
||||
-- totalite du contour.
|
||||
------------------------------------------------------------------
|
||||
|
||||
Add(me : in out; Radius : Real; E : Edge from TopoDS)
|
||||
---Purpose: initialisation of the constant vector the corresponding 1st edge.
|
||||
--
|
||||
is static;
|
||||
|
||||
--Add(me : in out; C: Function from Law; E : Edge from TopoDS)
|
||||
-- ---Purpose: initialisation of the vector (the vector is defined by
|
||||
-- -- a curve - this is an evolutive vector).
|
||||
--is static;
|
||||
|
||||
--SetRadius(me : in out; Radius : Real; IC : Integer from Standard)
|
||||
-- ---Purpose: Set the radius of the contour of index IC.
|
||||
--is static;
|
||||
|
||||
SetRadius(me : in out;
|
||||
C : Function from Law;
|
||||
IC : Integer from Standard;
|
||||
IinC : Integer from Standard)
|
||||
---Purpose: Set the radius of the contour of index IC.
|
||||
is static;
|
||||
|
||||
IsConstant(me : in out;
|
||||
IC : Integer from Standard)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns true the contour is flaged as edge constant.
|
||||
is static;
|
||||
|
||||
|
||||
Radius(me : in out;
|
||||
IC : Integer from Standard)
|
||||
returns Real from Standard
|
||||
---Purpose: Returns the vector if the contour is flagged as edge
|
||||
-- constant.
|
||||
is static;
|
||||
|
||||
|
||||
ResetContour(me : in out;
|
||||
IC : Integer from Standard)
|
||||
---Purpose: Reset all vectors of contour IC.
|
||||
is static;
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
--- Update selectif d un contour avec un rayon constant applique
|
||||
-- a la portion de contour correspondant a un edge.
|
||||
------------------------------------------------------------------
|
||||
|
||||
SetRadius(me : in out;
|
||||
Radius : Real;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS)
|
||||
---Purpose: Set a constant on edge E of the contour of
|
||||
-- index IC. Since then E is flagged as constant.
|
||||
is static;
|
||||
|
||||
UnSet(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS)
|
||||
---Purpose: Extracts the flag constant and the vector of edge E.
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------------
|
||||
--- Update selectif d un contour avec une valeur de rayon
|
||||
-- appliquee a un vertex du contour.
|
||||
------------------------------------------------------------------
|
||||
|
||||
SetRadius(me : in out;
|
||||
Radius : Real;
|
||||
IC : Integer from Standard;
|
||||
V : Vertex from TopoDS)
|
||||
---Purpose: Set a vector on vertex V of the contour of index IC.
|
||||
is static;
|
||||
|
||||
UnSet(me : in out;
|
||||
IC : Integer from Standard;
|
||||
V : Vertex from TopoDS)
|
||||
---Purpose: Extracts the vector of the vertex V.
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------------
|
||||
--- Update selectif d un contour avec une valeur de rayon
|
||||
-- appliquee a un parametre du contour.
|
||||
------------------------------------------------------------------
|
||||
|
||||
SetRadius(me : in out;
|
||||
UandR : XY from gp;
|
||||
IC : Integer from Standard;
|
||||
IinC : Integer from Standard)
|
||||
---Purpose: Set a vertex on the point of parametre U in the edge IinC
|
||||
-- of the contour of index IC
|
||||
is static;
|
||||
|
||||
------------------------------------------------------------------
|
||||
--- Methode pour recuperer et editer la portion de contour a rayon
|
||||
-- variable ou constant encadrant un edge donne.
|
||||
------------------------------------------------------------------
|
||||
|
||||
IsConstant(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns true E is flagged as edge constant.
|
||||
is static;
|
||||
|
||||
|
||||
Radius(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS)
|
||||
returns Real from Standard
|
||||
---Purpose: Returns the vector if E is flagged as edge constant.
|
||||
is static;
|
||||
|
||||
|
||||
GetBounds(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS;
|
||||
First,Last : out Real from Standard)
|
||||
returns Boolean from Standard
|
||||
---Purpose: Returns in First and Last les extremities of the
|
||||
-- part of variable vector framing E, returns
|
||||
-- False if E is flagged as edge constant.
|
||||
is static;
|
||||
|
||||
GetLaw(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS)
|
||||
returns mutable Function from Law
|
||||
---Purpose: Returns the rule of elementary evolution of the
|
||||
-- part to variable vector framing E, returns a
|
||||
-- rule zero if E is flagged as edge constant.
|
||||
is static;
|
||||
|
||||
SetLaw(me : in out;
|
||||
IC : Integer from Standard;
|
||||
E : Edge from TopoDS;
|
||||
L : Function from Law)
|
||||
---Purpose: Sets the rule of elementary evolution of the
|
||||
-- part to variable vector framing E.
|
||||
is static;
|
||||
|
||||
|
||||
---Methods for quick simulation
|
||||
-------------------------------
|
||||
|
||||
Simulate(me : in out;
|
||||
IC : Integer from Standard);
|
||||
|
||||
NbSurf(me; IC : Integer from Standard)
|
||||
returns Integer from Standard;
|
||||
|
||||
Sect(me; IC, IS : Integer from Standard)
|
||||
returns mutable SecHArray1 from ChFiDS;
|
||||
|
||||
SimulKPart(me; SD : mutable SurfData from ChFiDS)
|
||||
is protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean is protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
SimulSurf(me : in out;
|
||||
Data : out SurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
---Methods for computation
|
||||
--------------------------
|
||||
|
||||
PerformFirstSection(me ;
|
||||
S : Spine from ChFiDS;
|
||||
HGuide : HElSpine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1,S2 : in out HSurface from BRepAdaptor;
|
||||
I1,I2 : TopolTool from Adaptor3d;
|
||||
Par : Real from Standard;
|
||||
SolDep : in out Vector from math;
|
||||
Pos1,Pos2 : out State from TopAbs)
|
||||
returns Boolean from Standard
|
||||
is protected;
|
||||
|
||||
PerformSurf(me : in out;
|
||||
SeqData : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro : Boolean from Standard;
|
||||
Forward : Boolean from Standard;
|
||||
RecOnS1,RecOnS2 : Boolean from Standard;
|
||||
Soldep : Vector from math;
|
||||
Intf,Intl : in out Boolean from Standard)
|
||||
returns Boolean
|
||||
is protected;
|
||||
---Purpose: Method calculates the elements of construction of the
|
||||
-- fillet (constant or evolutive).
|
||||
|
||||
PerformSurf(me : in out;
|
||||
SeqData : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
PerformSurf(me : in out;
|
||||
SeqData : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP,RecS,RecRst : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
PerformSurf(me : in out;
|
||||
Data : out SequenceOfSurfData from ChFiDS;
|
||||
Guide : HElSpine from ChFiDS;
|
||||
Spine : Spine from ChFiDS;
|
||||
Choix : Integer from Standard;
|
||||
S1 : HSurface from BRepAdaptor;
|
||||
I1 : TopolTool from Adaptor3d;
|
||||
PC1 : HCurve2d from BRepAdaptor;
|
||||
Sref1 : HSurface from BRepAdaptor;
|
||||
PCref1 : HCurve2d from BRepAdaptor;
|
||||
Decroch1 : out Boolean from Standard;
|
||||
Or1 : Orientation from TopAbs;
|
||||
S2 : HSurface from BRepAdaptor;
|
||||
I2 : TopolTool from Adaptor3d;
|
||||
PC2 : HCurve2d from BRepAdaptor;
|
||||
Sref2 : HSurface from BRepAdaptor;
|
||||
PCref2 : HCurve2d from BRepAdaptor;
|
||||
Decroch2 : out Boolean from Standard;
|
||||
Or2 : Orientation from TopAbs;
|
||||
MaxStep : Real from Standard;
|
||||
Fleche : Real from Standard;
|
||||
TolGuide : Real from Standard;
|
||||
First,Last : in out Real from Standard;
|
||||
Inside,Appro,Forward : Boolean from Standard;
|
||||
RecP1,RecRst1 : Boolean from Standard;
|
||||
RecP2,RecRst2 : Boolean from Standard;
|
||||
Soldep : Vector from math)
|
||||
is redefined protected;
|
||||
|
||||
SplitSurf(me : in out;
|
||||
SeqData : in out SequenceOfSurfData from ChFiDS;
|
||||
line : Line from BRepBlend)
|
||||
is protected;
|
||||
---Purpose: Method to split an singular SurfData in several non
|
||||
-- singular SurfData..
|
||||
|
||||
PerformTwoCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is protected;
|
||||
|
||||
PerformThreeCorner(me : in out ;
|
||||
Index : Integer from Standard)
|
||||
is protected;
|
||||
|
||||
ExtentOneCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
S : Stripe from ChFiDS)
|
||||
is protected;
|
||||
|
||||
ExtentTwoCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is protected;
|
||||
|
||||
ExtentThreeCorner(me : in out;
|
||||
V : Vertex from TopoDS;
|
||||
LS : ListOfStripe from ChFiDS)
|
||||
is protected;
|
||||
|
||||
SetRegul(me : in out) is protected;
|
||||
|
||||
fields
|
||||
|
||||
myShape : SectionShape from BlendFunc;
|
||||
|
||||
end FilBuilder;
|
2011
src/ChFi3d/ChFi3d_FilBuilder.cxx
Executable file
2011
src/ChFi3d/ChFi3d_FilBuilder.cxx
Executable file
File diff suppressed because it is too large
Load Diff
947
src/ChFi3d/ChFi3d_FilBuilder_C2.cxx
Executable file
947
src/ChFi3d/ChFi3d_FilBuilder_C2.cxx
Executable file
@@ -0,0 +1,947 @@
|
||||
// File: ChFi3d_Builder_5.cxx
|
||||
// Created: Tue Mar 29 16:13:48 1994
|
||||
// Author: Isabelle GRIGNON
|
||||
// Copyright: OPEN CASCADE 1994
|
||||
|
||||
#include <ChFi3d_FilBuilder.jxx>
|
||||
|
||||
#include <ChFi3d.hxx>
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
#include <math_Vector.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Law_Linear.hxx>
|
||||
#include <BRepBlend_CSCircular.hxx>
|
||||
#include <BRepBlend_Line.hxx>
|
||||
#include <Geom2dConvert.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_HCurveOnSurface.hxx>
|
||||
#include <BRepLProp_CLProps.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve2d.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_HCurve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepTopAdaptor_TopolTool.hxx>
|
||||
#include <GeomFill_ConstrainedFilling.hxx>
|
||||
#include <GeomFill_SimpleBound.hxx>
|
||||
|
||||
#include <IntSurf_LineOn2S.hxx>
|
||||
#include <IntSurf_Transition.hxx>
|
||||
#include <IntSurf_TypeTrans.hxx>
|
||||
#include <IntCurveSurface_HInter.hxx>
|
||||
#include <IntCurveSurface_IntersectionPoint.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <TopOpeBRepDS_ListOfInterference.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopOpeBRepDS_HDataStructure.hxx>
|
||||
#include <ChFiDS_Regul.hxx>
|
||||
#include <ChFiDS_State.hxx>
|
||||
#include <ChFiDS_SequenceOfSurfData.hxx>
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <ChFiDS_FaceInterference.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_Spine.hxx>
|
||||
#include <ChFiDS_FilSpine.hxx>
|
||||
#include <ChFiDS_HData.hxx>
|
||||
#include <ChFiDS_CommonPoint.hxx>
|
||||
|
||||
#include <ChFiKPart_ComputeData.hxx>
|
||||
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
#endif
|
||||
#ifdef DEB
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
|
||||
extern Standard_Boolean ChFi3d_GetcontextFORCEFILLING();
|
||||
#include <OSD_Chronometer.hxx>
|
||||
|
||||
extern Standard_Real t_t2cornerinit ,t_perf2cornerbyinter,t_chfikpartcompdata,
|
||||
t_cheminement,t_remplissage,t_t2cornerDS;
|
||||
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
|
||||
extern void ChFi3d_ResultChron(OSD_Chronometer & ch,Standard_Real& time);
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : ToricRotule
|
||||
//purpose : Teste si on est dans un cas particulier de rotule torique.
|
||||
// Il faut trois plans avec deux conges incidents constants
|
||||
// de meme rayon et la troisieme face perpendiculaire aux
|
||||
// deux autres.
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean ToricRotule(const BRepAdaptor_Surface& fac,
|
||||
const BRepAdaptor_Surface& s1,
|
||||
const BRepAdaptor_Surface& s2,
|
||||
const Handle(ChFiDS_Stripe)& c1,
|
||||
const Handle(ChFiDS_Stripe)& c2)
|
||||
|
||||
{
|
||||
Standard_Real tolesp = 1.e-7;
|
||||
|
||||
Handle(ChFiDS_FilSpine) sp1=Handle(ChFiDS_FilSpine)::DownCast(c1->Spine());
|
||||
Handle(ChFiDS_FilSpine) sp2=Handle(ChFiDS_FilSpine)::DownCast(c2->Spine());
|
||||
if(sp1.IsNull() || sp2.IsNull()) return Standard_False;
|
||||
if (!sp1->IsConstant() || !sp2->IsConstant())
|
||||
return Standard_False;
|
||||
if ((fac.GetType() != GeomAbs_Plane) ||
|
||||
(s1.GetType() != GeomAbs_Plane) ||
|
||||
(s2.GetType() != GeomAbs_Plane)) return Standard_False;
|
||||
gp_Dir df = fac.Plane().Position().Direction();
|
||||
gp_Dir ds1 = s1.Plane().Position().Direction();
|
||||
gp_Dir ds2 = s2.Plane().Position().Direction();
|
||||
if ( Abs(df.Dot(ds1)) >= tolesp || Abs(df.Dot(ds2)) >= tolesp )
|
||||
return Standard_False;
|
||||
Standard_Real r1 = sp1->Radius();
|
||||
Standard_Real r2 = sp2->Radius();
|
||||
if(Abs(r1 - r2) >= tolesp) return Standard_False;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
static void RemoveSD(Handle(ChFiDS_Stripe)& Stripe,
|
||||
const Standard_Integer num1,
|
||||
const Standard_Integer num2 )
|
||||
{
|
||||
ChFiDS_SequenceOfSurfData& Seq =
|
||||
Stripe->ChangeSetOfSurfData()->ChangeSequence();
|
||||
if(Seq.IsEmpty()) return;
|
||||
if (num1==num2)
|
||||
Seq.Remove(num1);
|
||||
else
|
||||
Seq.Remove(num1,num2);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformTwoCorner
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
|
||||
{
|
||||
#ifdef DEB
|
||||
OSD_Chronometer ch;
|
||||
ChFi3d_InitChron(ch); // init perf initialisation
|
||||
#endif
|
||||
|
||||
done = 0;
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
It.Initialize(myVDataMap(Index));
|
||||
Handle(ChFiDS_Stripe) st1,st2;
|
||||
Standard_Integer Sens1,Sens2;
|
||||
Standard_Integer Isd1,Isd2,i1,i2;
|
||||
Handle(ChFiDS_SurfData) sd1,sd2;
|
||||
ChFiDS_SequenceOfSurfData SeqFil1,SeqFil2;
|
||||
Handle(Geom_Surface) surf1,surf2;
|
||||
Standard_Boolean OkinterCC,Okvisavis,SameSide;
|
||||
Standard_Integer IFaCo1,IFaCo2;
|
||||
Standard_Real UIntPC1,UIntPC2;
|
||||
TopoDS_Face FaCo;
|
||||
TopoDS_Edge E1,E2,E;
|
||||
TopoDS_Vertex V1,V2;
|
||||
// gp_Pnt P1,P2;
|
||||
Standard_Integer nbsurf1,nbsurf2,deb1,fin1,deb2,fin2;
|
||||
Standard_Real parE1,parE2;
|
||||
//On extrait les informations necessaires sur les conges
|
||||
//------------------------------------------------------
|
||||
|
||||
//le premier
|
||||
//----------
|
||||
|
||||
st1 = It.Value();
|
||||
Isd1 = ChFi3d_IndexOfSurfData(Vtx,st1,Sens1);
|
||||
|
||||
|
||||
//le deuxieme
|
||||
//----------
|
||||
It.Next();
|
||||
st2 = It.Value();
|
||||
if(st2 == st1) {
|
||||
Sens2 = -1;
|
||||
Isd2 = st2->SetOfSurfData()->Length();
|
||||
}
|
||||
else{ Isd2 = ChFi3d_IndexOfSurfData(Vtx,st2,Sens2); }
|
||||
|
||||
// Si les deux aretes a arrondir sont tangentes on appelle GeomPlate
|
||||
|
||||
if (Sens1==1) E1= st1->Spine()->Edges(1);
|
||||
else E1= st1->Spine()->Edges( st1->Spine()->NbEdges());
|
||||
|
||||
if (Sens2==1) E2= st2->Spine()->Edges(1);
|
||||
else E2= st2->Spine()->Edges( st2->Spine()->NbEdges());
|
||||
|
||||
BRepAdaptor_Curve BCurv1(E1);
|
||||
BRepAdaptor_Curve BCurv2(E2);
|
||||
parE1=BRep_Tool::Parameter(Vtx,E1);
|
||||
parE2=BRep_Tool::Parameter(Vtx,E2);
|
||||
BRepLProp_CLProps CL1(BCurv1,parE1 , 1, 1.e-4);
|
||||
BRepLProp_CLProps CL2(BCurv2,parE2 , 1, 1.e-4);
|
||||
gp_Dir dir1,dir2 ;
|
||||
CL1.Tangent(dir1);
|
||||
CL2.Tangent(dir2);
|
||||
if (Sens1==-1) dir1.Reverse();
|
||||
if (Sens2==-1) dir2.Reverse();
|
||||
Standard_Real ang1;
|
||||
ang1=Abs(dir1.Angle(dir2));
|
||||
if (ang1<PI/180.) {
|
||||
PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
|
||||
OkinterCC = ChFi3d_IsInFront(DStr,st1,st2,Isd1,Isd2,Sens1,Sens2,
|
||||
UIntPC1,UIntPC2,FaCo,SameSide,
|
||||
IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
|
||||
|
||||
Standard_Boolean trouve=Standard_False;
|
||||
if (!Okvisavis) {
|
||||
|
||||
|
||||
// on ne se limite plus aux premieres ou aux dernieres surfdata
|
||||
// pour rechercher celles qui son en vis a vis
|
||||
nbsurf1=st1->SetOfSurfData()->Length();
|
||||
nbsurf2=st2->SetOfSurfData()->Length();
|
||||
deb1=1;
|
||||
deb2=1;
|
||||
fin1=1;
|
||||
fin2=1;
|
||||
if (nbsurf1!=1) {
|
||||
if (Sens1==1) {
|
||||
deb1=1;
|
||||
fin1=2;
|
||||
}
|
||||
else {
|
||||
deb1=nbsurf1-1;
|
||||
fin1=nbsurf1;
|
||||
}
|
||||
}
|
||||
if (nbsurf2!=1) {
|
||||
if (Sens2==1 ) {
|
||||
deb2=1;
|
||||
fin2=2;
|
||||
}
|
||||
else {
|
||||
deb2=nbsurf2-1;
|
||||
fin2=nbsurf2;
|
||||
}
|
||||
}
|
||||
|
||||
for (i1=deb1;i1<=fin1 &&!trouve;i1++) {
|
||||
Isd1=i1;
|
||||
for (i2=deb2;i2<=fin2 &&!trouve;i2++) {
|
||||
Isd2=i2;
|
||||
|
||||
OkinterCC = ChFi3d_IsInFront(DStr,st1,st2,Isd1,Isd2,Sens1,Sens2,
|
||||
UIntPC1,UIntPC2,FaCo,SameSide,
|
||||
IFaCo1,IFaCo2,Okvisavis,Vtx,Standard_True);
|
||||
trouve=Okvisavis;
|
||||
}
|
||||
}
|
||||
if (!trouve){
|
||||
PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (Sens1==1 && Isd1!=1) RemoveSD(st1,1,1);
|
||||
if (Sens1!=1 && Isd1!=nbsurf1) RemoveSD(st1,fin1,fin1);
|
||||
if (Sens2==1 && Isd2!=1) RemoveSD(st2,1,1);
|
||||
if (Sens2!=1 && Isd2!=nbsurf2) RemoveSD(st2,fin2,fin2);
|
||||
|
||||
}
|
||||
Isd1=ChFi3d_IndexOfSurfData(Vtx,st1,Sens1);
|
||||
Isd2=ChFi3d_IndexOfSurfData(Vtx,st2,Sens2);
|
||||
}
|
||||
// StdFail_NotDone::Raise("TwoCorner : pas de face commune");
|
||||
Standard_Integer IFaArc1 = 3-IFaCo1, IFaArc2 = 3-IFaCo2;
|
||||
SeqFil1 = st1->ChangeSetOfSurfData()->ChangeSequence();
|
||||
SeqFil2 = st2->ChangeSetOfSurfData()->ChangeSequence();
|
||||
sd1 = SeqFil1.ChangeValue(Isd1);
|
||||
surf1 = DStr.Surface(sd1->Surf()).Surface();
|
||||
sd2 = SeqFil2.ChangeValue(Isd2);
|
||||
surf2 = DStr.Surface(sd2->Surf()).Surface();
|
||||
TopAbs_Orientation OFaCo = FaCo.Orientation();
|
||||
// On analyse les concavites et on recherche la face en vis a vis
|
||||
// et l intersection eventuelle des 2 pcurves sur cette face.
|
||||
|
||||
ChFiDS_State Stat1,Stat2;
|
||||
Standard_Boolean isfirst1 = (Sens1 == 1);
|
||||
Standard_Boolean isfirst2 = (Sens2 == 1);
|
||||
Stat1 = st1->Spine()->Status(isfirst1);
|
||||
Stat2 = st2->Spine()->Status(isfirst2);
|
||||
Standard_Boolean c1biseau = (Stat1 == ChFiDS_AllSame);
|
||||
Standard_Boolean c1rotule = (Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnSame);
|
||||
|
||||
// On verifie que les conges ont bien un commonpoint
|
||||
// sur un arc commun.
|
||||
// Cet edge est le pivot du biseau ou de la rotule.
|
||||
|
||||
ChFiDS_CommonPoint& CP1 = sd1->ChangeVertex(isfirst1,IFaArc1);
|
||||
ChFiDS_CommonPoint& CP2 = sd2->ChangeVertex(isfirst2,IFaArc2);
|
||||
|
||||
Standard_Boolean resetcp1 = 0;
|
||||
Standard_Boolean resetcp2 = 0;
|
||||
|
||||
TopoDS_Edge pivot;
|
||||
Standard_Boolean yapiv = Standard_False;
|
||||
if(CP1.IsOnArc()) pivot = CP1.Arc();
|
||||
else {
|
||||
PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
if(CP1.IsOnArc()&& CP2.IsOnArc()){
|
||||
yapiv = (pivot.IsSame(CP2.Arc()));
|
||||
}
|
||||
Handle(BRepAdaptor_HCurve) Hpivot;
|
||||
#ifndef DEB
|
||||
Standard_Boolean sameparam = Standard_False;
|
||||
Standard_Real parCP1 = 0., parCP2 = 0.;
|
||||
#else
|
||||
Standard_Boolean sameparam;
|
||||
Standard_Real parCP1, parCP2;
|
||||
#endif
|
||||
if(yapiv) {
|
||||
Hpivot = new BRepAdaptor_HCurve(pivot);
|
||||
parCP1 = CP1.ParameterOnArc();
|
||||
parCP2 = CP2.ParameterOnArc();
|
||||
gp_Pnt tst1 = Hpivot->Value(parCP1);
|
||||
gp_Pnt tst2 = Hpivot->Value(parCP2);
|
||||
sameparam = tst1.Distance(tst2) <= tolesp;
|
||||
}
|
||||
Handle(BRepAdaptor_HSurface) HFaCo = new BRepAdaptor_HSurface();
|
||||
Handle(BRepAdaptor_HSurface) HFaPiv;
|
||||
Handle(BRepAdaptor_HSurface) HBRS1 = new BRepAdaptor_HSurface();
|
||||
Handle(BRepAdaptor_HSurface) HBRS2 = new BRepAdaptor_HSurface();
|
||||
|
||||
BRepAdaptor_Surface& BRS1 = HBRS1->ChangeSurface();
|
||||
BRepAdaptor_Surface& BRS2 = HBRS2->ChangeSurface();
|
||||
BRepAdaptor_Surface& BRFaCo = HFaCo->ChangeSurface();
|
||||
BRFaCo.Initialize(FaCo);
|
||||
|
||||
TopoDS_Face FF1,FF2,F,FaPiv;
|
||||
#ifndef DEB
|
||||
TopAbs_Orientation pctrans = TopAbs_FORWARD ;
|
||||
#else
|
||||
TopAbs_Orientation pctrans;
|
||||
#endif
|
||||
Handle(Geom2d_BSplineCurve) PCurveOnPiv;
|
||||
FF1 = TopoDS::Face(DStr.Shape(sd1->Index(IFaArc1)));
|
||||
FF2 = TopoDS::Face(DStr.Shape(sd2->Index(IFaArc2)));
|
||||
if (FF1.IsNull()||FF2.IsNull())
|
||||
{PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
BRS1.Initialize(FF1);
|
||||
BRS2.Initialize(FF2);
|
||||
|
||||
if(yapiv ) {
|
||||
TopTools_ListIteratorOfListOfShape Kt;
|
||||
Standard_Boolean ok1 = Standard_False, ok2 = Standard_False;
|
||||
for (Kt.Initialize(myEFMap(pivot)); Kt.More(); Kt.Next()){
|
||||
F = TopoDS::Face(Kt.Value());
|
||||
if(!ok1 && FF1.IsSame(F)){
|
||||
ok1 = Standard_True;
|
||||
}
|
||||
if(!ok2 && FF2.IsSame(F)){
|
||||
ok2 = Standard_True;
|
||||
}
|
||||
}
|
||||
if(!ok1 || !ok2){
|
||||
//On est dans un contexte merdique
|
||||
PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch ,t_t2cornerinit);//result perf initialisation
|
||||
#endif
|
||||
|
||||
//biseau
|
||||
//------
|
||||
ChFiDS_CommonPoint cp11,cp12,cp21,cp22;
|
||||
ChFiDS_FaceInterference intf11,intf12,intf21,intf22;
|
||||
|
||||
if(c1biseau){
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
|
||||
#endif
|
||||
|
||||
done = PerformTwoCornerbyInter(Index);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf PerformTwoCornerbyInter
|
||||
#endif
|
||||
|
||||
if (!done){
|
||||
PerformMoreThreeCorner(Index,2);
|
||||
done=1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(c1rotule){//on sauve.
|
||||
cp11 = sd1->Vertex(isfirst1,1);
|
||||
cp12 = sd1->Vertex(isfirst1,2);
|
||||
cp21 = sd2->Vertex(isfirst2,1);
|
||||
cp22 = sd2->Vertex(isfirst2,2);
|
||||
intf11 = sd1->InterferenceOnS1();
|
||||
intf12 = sd1->InterferenceOnS2();
|
||||
intf21 = sd2->InterferenceOnS1();
|
||||
intf22 = sd2->InterferenceOnS2();
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
|
||||
#endif
|
||||
|
||||
done = PerformTwoCornerbyInter(Index);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_perf2cornerbyinter); // result perf PerformTwoCornerbyInter
|
||||
#endif
|
||||
if (!done) {
|
||||
//on restore
|
||||
sd1->ChangeVertex(isfirst1,1) = cp11;
|
||||
sd1->ChangeVertex(isfirst1,2) = cp12;
|
||||
sd2->ChangeVertex(isfirst2,1) = cp21;
|
||||
sd2->ChangeVertex(isfirst2,2) = cp22;
|
||||
sd1->ChangeInterferenceOnS1() = intf11;
|
||||
sd1->ChangeInterferenceOnS2() = intf12;
|
||||
sd2->ChangeInterferenceOnS1() = intf21;
|
||||
sd2->ChangeInterferenceOnS2() = intf22;
|
||||
done = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!c1biseau && !done){
|
||||
//on cree une nouvelle cornerdata
|
||||
//-------------------------------
|
||||
Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
|
||||
Handle(ChFiDS_HData)& cornerset = corner->ChangeSetOfSurfData();
|
||||
cornerset = new ChFiDS_HData();
|
||||
Handle(ChFiDS_SurfData) coin = new ChFiDS_SurfData();
|
||||
cornerset->Append(coin);
|
||||
|
||||
if (SameSide) {
|
||||
if(ToricRotule(BRFaCo,BRS1,BRS2,st1,st2)){
|
||||
// Construction directe.
|
||||
// ---------------------
|
||||
|
||||
//un petit coup de NextSide, leger....
|
||||
//------------------------------------
|
||||
Standard_Integer bid;
|
||||
TopAbs_Orientation ori = OFaCo;
|
||||
TopAbs_Orientation oriS = st1->Orientation(IFaCo1);
|
||||
TopAbs_Orientation OFF1 = FF1.Orientation();
|
||||
TopAbs_Orientation oriSFF1 = st1->Orientation(IFaArc1);
|
||||
bid = 1;
|
||||
bid = ChFi3d::NextSide(ori,OFF1,oriS,oriSFF1,bid);
|
||||
TopAbs_Orientation op1,op2;
|
||||
if(yapiv) bid = ChFi3d::ConcaveSide(BRS1,BRS2,pivot,op1,op2);
|
||||
op1 = TopAbs::Reverse(op1);
|
||||
op2 = TopAbs::Reverse(op2);
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch);// init perf ChFiKPart_ComputeData
|
||||
#endif
|
||||
Standard_Real radius =
|
||||
Handle(ChFiDS_FilSpine)::DownCast(st1->Spine())->Radius();
|
||||
done = ChFiKPart_ComputeData::ComputeCorner(DStr,coin,HFaCo,HBRS1,HBRS2,
|
||||
OFaCo,ori,op1,op2,radius);
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_chfikpartcompdata);//result perf ChFiKPart_ComputeData
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
// Construction par remplissage
|
||||
// ----------------------------
|
||||
Standard_Real uPCArc1, uPCArc2;
|
||||
gp_Pnt2d p2da1,p2df1,p2da2,p2df2,p2dfac1,p2dfac2;
|
||||
gp_Vec2d v2dfac1,v2dfac2;
|
||||
Handle(GeomFill_Boundary) B1,B2,Bpiv,Bfac;
|
||||
uPCArc1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
|
||||
p2da1 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(uPCArc1);
|
||||
p2df1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(uPCArc1);
|
||||
sd1->Interference(IFaCo1).PCurveOnFace()->D1(uPCArc1,p2dfac1,v2dfac1);
|
||||
uPCArc2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
|
||||
p2da2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(uPCArc2);
|
||||
p2df2 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(uPCArc2);
|
||||
sd2->Interference(IFaCo2).PCurveOnFace()->D1(uPCArc2,p2dfac2,v2dfac2);
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch ); // init perf remplissage
|
||||
#endif
|
||||
B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolesp,2.e-4);
|
||||
B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolesp,2.e-4);
|
||||
Handle(Geom2d_Curve) PCurveOnFace;
|
||||
Bfac = ChFi3d_mkbound(HFaCo,PCurveOnFace,Sens1,p2dfac1,v2dfac1,
|
||||
Sens2,p2dfac2,v2dfac2,tolesp,2.e-4);
|
||||
GeomFill_ConstrainedFilling fil(8,20);
|
||||
if(sameparam) {
|
||||
fil.Init(Bfac,B2,B1,1);
|
||||
}
|
||||
else {
|
||||
Handle(Adaptor3d_HCurve) HPivTrim = Hpivot->ChangeCurve().
|
||||
Trim(Min(parCP1,parCP2),Max(parCP1,parCP2),tolesp);
|
||||
Bpiv = new GeomFill_SimpleBound(HPivTrim,tolesp,2.e-4);
|
||||
fil.Init(Bfac,B2,Bpiv,B1,1);
|
||||
BRepAdaptor_Curve2d pcpivot;
|
||||
gp_Vec dArc,dcf;
|
||||
gp_Pnt bidon;
|
||||
Hpivot->D1(parCP1,bidon,dArc);
|
||||
Standard_Real fb1,lb1;
|
||||
B1->Bounds(fb1,lb1);
|
||||
B1->D1(lb1,bidon,dcf);
|
||||
Standard_Boolean pivotverslebas = dArc.Dot(dcf) <= 0.;
|
||||
Standard_Boolean pcfalenvers = (parCP1 > parCP2);
|
||||
if((pivotverslebas && !pcfalenvers)||
|
||||
(!pivotverslebas && pcfalenvers)) {
|
||||
FaPiv = FF2;
|
||||
HFaPiv = HBRS2;
|
||||
resetcp2 = 1;
|
||||
}
|
||||
else {
|
||||
FaPiv = FF1;
|
||||
HFaPiv = HBRS1;
|
||||
resetcp1 = 1;
|
||||
}
|
||||
FaPiv.Orientation(TopAbs_FORWARD);
|
||||
pcpivot.Initialize(pivot,FaPiv);
|
||||
TopExp_Explorer Expl;
|
||||
for(Expl.Init(FaPiv,TopAbs_EDGE); Expl.More(); Expl.Next()){
|
||||
if(Expl.Current().IsSame(pivot)) {
|
||||
pctrans = Expl.Current().Orientation();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(pcpivot.GetType() != GeomAbs_BSplineCurve){
|
||||
Handle(Geom2d_TrimmedCurve)
|
||||
trc = new Geom2d_TrimmedCurve(pcpivot.Curve(),
|
||||
Min(parCP1,parCP2),
|
||||
Max(parCP1,parCP2));
|
||||
PCurveOnPiv = Geom2dConvert::CurveToBSplineCurve(trc);
|
||||
}
|
||||
else {
|
||||
PCurveOnPiv = Geom2dConvert::SplitBSplineCurve
|
||||
(Handle(Geom2d_BSplineCurve)::DownCast(pcpivot.Curve()),
|
||||
Min(parCP1,parCP2),Max(parCP1,parCP2),tol2d);
|
||||
}
|
||||
TColStd_Array1OfReal kk(1,PCurveOnPiv->NbKnots());
|
||||
PCurveOnPiv->Knots(kk);
|
||||
BSplCLib::Reparametrize(0.,1.,kk);
|
||||
PCurveOnPiv->SetKnots(kk);
|
||||
if(pcfalenvers) {
|
||||
PCurveOnPiv->Reverse();
|
||||
pctrans = TopAbs::Reverse(pctrans);
|
||||
}
|
||||
}
|
||||
Handle(Geom_Surface) Surfcoin = fil.Surface();
|
||||
done = CompleteData(coin,Surfcoin,
|
||||
HFaCo,PCurveOnFace,
|
||||
HFaPiv,PCurveOnPiv,OFaCo,1,
|
||||
0,0,0,0);
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_remplissage);// result perf remplissage
|
||||
#endif
|
||||
}
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf mise a jour DS
|
||||
#endif
|
||||
if (done){
|
||||
// Mise a jour des 3 CornerData et de la DS
|
||||
// ----------------------------------------
|
||||
if(resetcp1){
|
||||
gp_Pnt pjyl = CP1.Point();
|
||||
Standard_Real tolsav = CP1.Tolerance();
|
||||
CP1.Reset();
|
||||
CP1.SetPoint(pjyl);
|
||||
CP1.SetTolerance(tolsav);
|
||||
}
|
||||
else if(resetcp2){
|
||||
gp_Pnt pjyl = CP2.Point();
|
||||
Standard_Real tolsav = CP2.Tolerance();
|
||||
CP2.Reset();
|
||||
CP2.SetPoint(pjyl);
|
||||
CP2.SetTolerance(tolsav);
|
||||
}
|
||||
Standard_Real P1deb,P2deb,P1fin,P2fin;
|
||||
Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
|
||||
const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
|
||||
ChFiDS_CommonPoint& Pf2 = coin->ChangeVertexFirstOnS2();
|
||||
const ChFiDS_CommonPoint& Pl1 = coin->VertexLastOnS1();
|
||||
ChFiDS_CommonPoint& Pl2 = coin->ChangeVertexLastOnS2();
|
||||
Pf2 = CP1;
|
||||
Pl2 = CP2;
|
||||
|
||||
// le coin pour commencer,
|
||||
// -----------------------
|
||||
ChFiDS_Regul regdeb, regfin;
|
||||
If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
|
||||
If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
|
||||
Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
|
||||
if(sameparam) Il2 = If2;
|
||||
else Il2 = ChFi3d_IndexPointInDS(Pl2,DStr);
|
||||
|
||||
gp_Pnt2d pp1,pp2;
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().FirstParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().FirstParameter());
|
||||
Handle(Geom_Curve) C3d;
|
||||
Standard_Real tolreached;
|
||||
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeFirstPCurve(),P1deb,P2deb,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
Standard_Real par1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
|
||||
pp1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(par1);
|
||||
pp2 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(par1);
|
||||
Standard_Real tolr1;
|
||||
ChFi3d_ComputePCurv(C3d,pp1,pp2,st1->ChangePCurve(isfirst1),
|
||||
DStr.Surface(sd1->Surf()).Surface(),
|
||||
P1deb,P2deb,tolesp,tolr1);
|
||||
tolreached = Max(tolreached,tolr1);
|
||||
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
|
||||
Icf = DStr.AddCurve(Tcurv1);
|
||||
regdeb.SetCurve(Icf);
|
||||
regdeb.SetS1(coin->Surf(),0);
|
||||
regdeb.SetS2(sd1->Surf(),0);
|
||||
myRegul.Append(regdeb);
|
||||
corner->ChangeFirstCurve(Icf);
|
||||
corner->ChangeFirstParameters(P1deb,P2deb);
|
||||
corner->ChangeIndexFirstPointOnS1(If1);
|
||||
corner->ChangeIndexFirstPointOnS2(If2);
|
||||
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().LastParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().LastParameter());
|
||||
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeLastPCurve(),P1fin,P2fin,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
Standard_Real par2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
|
||||
pp1 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(par2);
|
||||
pp2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(par2);
|
||||
Standard_Real tolr2;
|
||||
ChFi3d_ComputePCurv(C3d,pp1,pp2,st2->ChangePCurve(isfirst2),
|
||||
DStr.Surface(sd2->Surf()).Surface(),
|
||||
P1deb,P2deb,tolesp,tolr2);
|
||||
tolreached = Max(tolreached,tolr2);
|
||||
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
|
||||
Icl = DStr.AddCurve(Tcurv2);
|
||||
regfin.SetCurve(Icl);
|
||||
regfin.SetS1(coin->Surf(),0);
|
||||
regfin.SetS2(sd2->Surf(),0);
|
||||
myRegul.Append(regfin);
|
||||
corner->ChangeLastCurve(Icl);
|
||||
corner->ChangeLastParameters(P1fin,P2fin);
|
||||
corner->ChangeIndexLastPointOnS1(Il1);
|
||||
corner->ChangeIndexLastPointOnS2(Il2);
|
||||
|
||||
coin->ChangeIndexOfS1(DStr.AddShape(FaCo));
|
||||
if(sameparam) coin->ChangeIndexOfS2(0);
|
||||
else {
|
||||
coin->ChangeIndexOfS2(DStr.AddShape(FaPiv));
|
||||
coin->ChangeInterferenceOnS2().SetTransition(pctrans);
|
||||
}
|
||||
corner->SetSolidIndex(st1->SolidIndex());
|
||||
|
||||
// puis la Stripe du debut,
|
||||
// ------------------------
|
||||
st1->SetCurve(Icf,isfirst1);
|
||||
st1->SetIndexPoint(If1,isfirst1,IFaCo1);
|
||||
st1->SetIndexPoint(If2,isfirst1,IFaArc1);
|
||||
st1->SetParameters(isfirst1,P1deb,P2deb);
|
||||
sd1->ChangeVertex(isfirst1,IFaCo1) = Pf1;
|
||||
sd1->ChangeVertex(isfirst1,IFaArc1) = Pf2;
|
||||
sd1->ChangeInterference(IFaCo1).SetParameter(par1,isfirst1);
|
||||
if (IFaCo1 == 2) st1->SetOrientation(TopAbs_REVERSED,isfirst1);
|
||||
|
||||
// puis la Stripe de la fin,
|
||||
// -------------------------
|
||||
st2->SetCurve(Icl,isfirst2);
|
||||
st2->SetIndexPoint(Il1,isfirst2,IFaCo2);
|
||||
st2->SetIndexPoint(Il2,isfirst2,IFaArc2);
|
||||
st2->SetParameters(isfirst2,P1fin,P2fin);
|
||||
sd2->ChangeVertex(isfirst2,IFaCo2) = Pl1;
|
||||
sd2->ChangeVertex(isfirst2,IFaArc2) = Pl2;
|
||||
sd2->ChangeInterference(IFaCo2).SetParameter(par2,isfirst2);
|
||||
if (IFaCo2 == 2) st2->SetOrientation(TopAbs_REVERSED,isfirst2);
|
||||
}
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf mise a jour DS
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
//ici il faut distinguer celui ondiff
|
||||
if(!OkinterCC) {
|
||||
Standard_Failure::Raise("TwoCorner : Pas d intersetion pc pc");
|
||||
}
|
||||
Handle(ChFiDS_Stripe) stsam, stdif;
|
||||
Handle(ChFiDS_SurfData) sdsam, sddif;
|
||||
#ifndef DEB
|
||||
Standard_Real uintpcsam = 0., uintpcdif = 0.;
|
||||
Standard_Integer ifacosam = 0, ifacodif = 0, ifaopsam = 0, ifaopdif = 0;
|
||||
Standard_Boolean isfirstsam = Standard_False, isfirstdif = Standard_False;
|
||||
#else
|
||||
Standard_Real uintpcsam, uintpcdif;
|
||||
Standard_Integer ifacosam, ifacodif, ifaopsam, ifaopdif;
|
||||
Standard_Boolean isfirstsam, isfirstdif;
|
||||
#endif
|
||||
if(Stat1 == ChFiDS_OnSame && Stat2 == ChFiDS_OnDiff){
|
||||
stsam = st1; sdsam = sd1; uintpcsam = UIntPC1;
|
||||
ifacosam = IFaCo1; ifaopsam = IFaArc1; isfirstsam = isfirst1;
|
||||
stdif = st2; sddif = sd2; uintpcdif = UIntPC2;
|
||||
ifacodif = IFaCo2; ifaopdif = IFaArc2; isfirstdif = isfirst2;
|
||||
}
|
||||
else if(Stat1 == ChFiDS_OnDiff && Stat2 == ChFiDS_OnSame){
|
||||
stsam = st2; sdsam = sd2; uintpcsam = UIntPC2;
|
||||
ifacosam = IFaCo2; ifaopsam = IFaArc2; isfirstsam = isfirst2;
|
||||
stdif = st1; sddif = sd1; uintpcdif = UIntPC1;
|
||||
ifacodif = IFaCo1; ifaopdif = IFaArc1; isfirstdif = isfirst1;
|
||||
}
|
||||
else {
|
||||
Standard_Failure::Raise("TwoCorner : Config inconnue");
|
||||
}
|
||||
//On verifie que la surface ondiff a un point sur arc du cote oppose
|
||||
//a la face commune et que cet arc est connexe a la face d appui
|
||||
//oppose a la face commune de la surface onsame.
|
||||
ChFiDS_CommonPoint& cpopdif = sddif->ChangeVertex(isfirstdif,ifaopdif);
|
||||
if(!cpopdif.IsOnArc()) {
|
||||
Standard_Failure::Raise
|
||||
("TwoCorner : Pas de point sur restriction sur la surface OnDiff");
|
||||
}
|
||||
const TopoDS_Edge& Arcopdif = cpopdif.Arc();
|
||||
const TopoDS_Face& Fopsam = TopoDS::Face(DStr.Shape(sdsam->Index(ifaopsam)));
|
||||
TopExp_Explorer ex;
|
||||
for(ex.Init(Fopsam,TopAbs_EDGE); ex.More(); ex.Next()){
|
||||
if(ex.Current().IsSame(Arcopdif)) {
|
||||
break;
|
||||
}
|
||||
else if(!ex.More()) {
|
||||
Standard_Failure::Raise
|
||||
("TwoCorner : Pas de face commune pour boucler le contour");
|
||||
}
|
||||
}
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch ); // init perf remplissage
|
||||
#endif
|
||||
Handle(GeomFill_Boundary) Bsam,Bdif,Bfac;
|
||||
gp_Pnt2d ppopsam =
|
||||
sdsam->Interference(ifaopsam).PCurveOnSurf()->Value(uintpcsam);
|
||||
gp_Pnt2d ppcosam =
|
||||
sdsam->Interference(ifacosam).PCurveOnSurf()->Value(uintpcsam);
|
||||
Handle(Geom_Surface) surfsam = DStr.Surface(sdsam->Surf()).Surface();
|
||||
Handle(GeomAdaptor_HSurface) Hsurfsam = new GeomAdaptor_HSurface(surfsam);
|
||||
Handle(Geom2d_Curve) pcsurfsam;
|
||||
Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolesp,2.e-4);
|
||||
Standard_Real upcopdif = sddif->Interference(ifaopdif).Parameter(isfirstdif);
|
||||
gp_Pnt2d ppopdif =
|
||||
sddif->Interference(ifaopdif).PCurveOnSurf()->Value(upcopdif);
|
||||
gp_Pnt2d ppcodif =
|
||||
sddif->Interference(ifacodif).PCurveOnSurf()->Value(uintpcdif);
|
||||
Handle(Geom_Surface) surfdif = DStr.Surface(sddif->Surf()).Surface();
|
||||
Handle(GeomAdaptor_HSurface) Hsurfdif = new GeomAdaptor_HSurface(surfdif);
|
||||
Handle(Geom2d_Curve) pcsurfdif;
|
||||
Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolesp,2.e-4);
|
||||
gp_Pnt2d ppfacsam,ppfacdif;
|
||||
gp_Pnt PPfacsam,PPfacdif;
|
||||
gp_Vec VVfacsam,VVfacdif;
|
||||
sdsam->Interference(ifaopsam).PCurveOnFace()->D0(uintpcsam,ppfacsam);
|
||||
const Handle(Geom_Curve)& curvopsam =
|
||||
DStr.Curve(sdsam->Interference(ifaopsam).LineIndex()).Curve();
|
||||
curvopsam->D1(uintpcsam,PPfacsam,VVfacsam);
|
||||
BRepAdaptor_Curve2d PCArcFac(Arcopdif,Fopsam);
|
||||
PCArcFac.D0(cpopdif.ParameterOnArc(),ppfacdif);
|
||||
BRepAdaptor_Curve CArcFac(Arcopdif);
|
||||
CArcFac.D1(cpopdif.ParameterOnArc(),PPfacdif,VVfacdif);
|
||||
Handle(BRepAdaptor_HSurface) HBRFopsam = new BRepAdaptor_HSurface();
|
||||
BRepAdaptor_Surface& BRFopsam = HBRFopsam->ChangeSurface();
|
||||
BRFopsam.Initialize(Fopsam,Standard_False);
|
||||
Handle(Geom2d_Curve) pcFopsam = ChFi3d_BuildPCurve(HBRFopsam,
|
||||
ppfacsam,VVfacsam,
|
||||
ppfacdif,VVfacdif,1);
|
||||
Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolesp,2.e-4);
|
||||
GeomFill_ConstrainedFilling fil(8,20);
|
||||
fil.Init(Bsam,Bdif,Bfac,1);
|
||||
#if 0
|
||||
for(Standard_Integer ib = 0; ib < 4; ib++){
|
||||
if(ib == 2) continue;
|
||||
fil.CheckCoonsAlgPatch(ib);
|
||||
fil.CheckTgteField(ib);
|
||||
fil.CheckApprox(ib);
|
||||
fil.CheckResult(ib);
|
||||
}
|
||||
#endif
|
||||
Handle(Geom_Surface) Surfcoin = fil.Surface();
|
||||
TopAbs_Orientation Osurfsam = sdsam->Orientation();
|
||||
Handle(Geom2d_Curve) pcnul;
|
||||
done = CompleteData(coin,Surfcoin,
|
||||
Hsurfsam,pcsurfsam,
|
||||
HBRFopsam,pcnul,Osurfsam,1,
|
||||
0,0,0,0);
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_remplissage);// result perf remplissage
|
||||
#endif
|
||||
if(!done) Standard_Failure::Raise("concavites inverses : echec");
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf mise a jour DS
|
||||
#endif
|
||||
// Mise a jour des 3 CornerData et de la DS
|
||||
// ----------------------------------------
|
||||
// le coin pour commencer,
|
||||
// -----------------------
|
||||
Standard_Real P1deb,P2deb,P1fin,P2fin;
|
||||
Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
|
||||
const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
|
||||
ChFiDS_CommonPoint& Pf2 = coin->ChangeVertexFirstOnS2();
|
||||
const ChFiDS_CommonPoint& Pl1 = coin->VertexLastOnS1();
|
||||
ChFiDS_CommonPoint& Pl2 = coin->ChangeVertexLastOnS2();
|
||||
Pf2 = Pl2 = cpopdif;
|
||||
|
||||
ChFiDS_Regul regdeb, regfin;
|
||||
If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
|
||||
If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
|
||||
Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
|
||||
Il2 = If2;
|
||||
|
||||
gp_Pnt2d pp1,pp2;
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().FirstParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().FirstParameter());
|
||||
Handle(Geom_Curve) C3d;
|
||||
Standard_Real tolreached;
|
||||
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeFirstPCurve(),P1deb,P2deb,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
Standard_Real tolr1;
|
||||
Handle(GeomAdaptor_HCurve) HC3d = new GeomAdaptor_HCurve(C3d);
|
||||
ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolesp,tolr1);
|
||||
tolreached = Max(tolreached,tolr1);
|
||||
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
|
||||
Icf = DStr.AddCurve(Tcurv1);
|
||||
// ici petite veru pour mettre la pcurve on face dans la DS
|
||||
TopAbs_Orientation OpcFopsam = sdsam->Interference(ifaopsam).Transition();
|
||||
Standard_Integer IFopsam = sdsam->Index(ifaopsam);
|
||||
if(isfirstsam) OpcFopsam = TopAbs::Reverse(OpcFopsam);
|
||||
Handle(TopOpeBRepDS_SurfaceCurveInterference)
|
||||
interf = ChFi3d_FilCurveInDS(Icf,IFopsam,pcFopsam,OpcFopsam);
|
||||
DStr.ChangeShapeInterferences(IFopsam).Append(interf);
|
||||
|
||||
regdeb.SetCurve(Icf);
|
||||
regdeb.SetS1(coin->Surf(),0);
|
||||
regdeb.SetS2(IFopsam,1);
|
||||
myRegul.Append(regdeb);
|
||||
corner->ChangeFirstCurve(Icf);
|
||||
corner->ChangeFirstParameters(P1deb,P2deb);
|
||||
corner->ChangeIndexFirstPointOnS1(If1);
|
||||
corner->ChangeIndexFirstPointOnS2(If2);
|
||||
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().LastParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().LastParameter());
|
||||
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeLastPCurve(),P1fin,P2fin,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
Standard_Real tolr2;
|
||||
HC3d->ChangeCurve().Load(C3d);
|
||||
ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolesp,tolr2);
|
||||
tolreached = Max(tolreached,tolr2);
|
||||
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
|
||||
Icl = DStr.AddCurve(Tcurv2);
|
||||
regfin.SetCurve(Icl);
|
||||
regfin.SetS1(coin->Surf(),0);
|
||||
regfin.SetS2(sddif->Surf(),0);
|
||||
myRegul.Append(regfin);
|
||||
corner->ChangeLastCurve(Icl);
|
||||
corner->ChangeLastParameters(P1fin,P2fin);
|
||||
corner->ChangeIndexLastPointOnS1(Il1);
|
||||
corner->ChangeIndexLastPointOnS2(Il2);
|
||||
|
||||
coin->ChangeIndexOfS1(-sdsam->Surf());
|
||||
coin->ChangeIndexOfS2(0);
|
||||
|
||||
corner->SetSolidIndex(stsam->SolidIndex());
|
||||
|
||||
// puis la Stripe OnSame
|
||||
// ---------------------
|
||||
const ChFiDS_FaceInterference& intcoin1 = coin->InterferenceOnS1();
|
||||
stsam->SetCurve(intcoin1.LineIndex(),isfirstsam);
|
||||
stsam->InDS(isfirstsam); // filDS fait deja le boulot depuis le coin.
|
||||
stsam->ChangePCurve(isfirstsam) = coin->InterferenceOnS1().PCurveOnFace();
|
||||
stsam->SetIndexPoint(If1,isfirstsam,ifaopsam);
|
||||
stsam->SetIndexPoint(Il1,isfirstsam,ifacosam);
|
||||
stsam->SetParameters(isfirstsam,
|
||||
intcoin1.FirstParameter(),
|
||||
intcoin1.LastParameter());
|
||||
sdsam->ChangeVertex(isfirstsam,ifaopsam) = Pf1;
|
||||
sdsam->ChangeVertex(isfirstsam,ifacosam) = Pl1;
|
||||
sdsam->ChangeInterferenceOnS1().SetParameter(uintpcsam,isfirstsam);
|
||||
sdsam->ChangeInterferenceOnS2().SetParameter(uintpcsam,isfirstsam);
|
||||
if (ifaopsam == 2) stsam->SetOrientation(TopAbs_REVERSED,isfirstsam);
|
||||
|
||||
// puis la Stripe OnDiff
|
||||
// ---------------------
|
||||
stdif->SetCurve(Icl,isfirstdif);
|
||||
stdif->ChangePCurve(isfirstdif) = pcsurfdif;
|
||||
stdif->SetIndexPoint(Il2,isfirstdif,ifaopdif);
|
||||
stdif->SetIndexPoint(Il1,isfirstdif,ifacodif);
|
||||
stdif->SetParameters(isfirstdif,P1fin,P2fin);
|
||||
sddif->ChangeVertex(isfirstdif,ifaopdif) = Pl2;
|
||||
sddif->ChangeVertex(isfirstdif,ifacodif) = Pl1;
|
||||
sddif->ChangeInterference(ifacodif).SetParameter(uintpcdif,isfirstdif);
|
||||
if (ifaopdif == 1) stdif->SetOrientation(TopAbs_REVERSED,isfirstdif);
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_t2cornerDS);// result perf mise a jour DS
|
||||
#endif
|
||||
}
|
||||
if(!myEVIMap.IsBound(Vtx)){
|
||||
TColStd_ListOfInteger li;
|
||||
myEVIMap.Bind(Vtx,li);
|
||||
}
|
||||
myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
|
||||
myListStripe.Append(corner);
|
||||
}
|
||||
}
|
||||
|
914
src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
Executable file
914
src/ChFi3d/ChFi3d_FilBuilder_C3.cxx
Executable file
@@ -0,0 +1,914 @@
|
||||
// File: ChFi3d_FilBuilder_C3.cxx
|
||||
// Created: Wed Apr 26 09:57:13 1995
|
||||
// Author: Modelistation
|
||||
// <model@phylox>
|
||||
|
||||
|
||||
#include <ChFi3d_FilBuilder.jxx>
|
||||
#include <ChFi3d_Builder_0.hxx>
|
||||
#include <ChFi3d.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
|
||||
#include <math_Vector.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
|
||||
#include <IntAna_QuadQuadGeo.hxx>
|
||||
#include <IntCurveSurface_IntersectionPoint.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_TopolTool.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_HCurve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepTopAdaptor_TopolTool.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
|
||||
#include <ChFiDS_SurfData.hxx>
|
||||
#include <ChFiDS_CommonPoint.hxx>
|
||||
#include <ChFiDS_FaceInterference.hxx>
|
||||
#include <ChFiDS_Spine.hxx>
|
||||
#include <ChFiDS_SequenceOfSurfData.hxx>
|
||||
#include <ChFiDS_Stripe.hxx>
|
||||
#include <ChFiDS_HData.hxx>
|
||||
#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
|
||||
#include <ChFiDS_Regul.hxx>
|
||||
|
||||
#include <TopOpeBRepDS_HDataStructure.hxx>
|
||||
#include <TopOpeBRepDS_DataStructure.hxx>
|
||||
#include <TopOpeBRepDS_Curve.hxx>
|
||||
#include <TopOpeBRepDS_Surface.hxx>
|
||||
|
||||
#include <ChFiKPart_ComputeData.hxx>
|
||||
#include <BRepBlend_Line.hxx>
|
||||
#include <BRepBlend_ConstRad.hxx>
|
||||
#include <BRepBlend_ConstRadInv.hxx>
|
||||
#include <BRepBlend_EvolRad.hxx>
|
||||
#include <BRepBlend_EvolRadInv.hxx>
|
||||
#include <Law_S.hxx>
|
||||
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
#endif
|
||||
#ifdef DEB
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
|
||||
extern Standard_Boolean ChFi3d_GetcontextSPINEBEZIER();
|
||||
extern Standard_Boolean ChFi3d_GetcontextSPINECIRCLE();
|
||||
extern Standard_Boolean ChFi3d_GetcontextSPINECE();
|
||||
extern Standard_Boolean ChFi3d_GetcontextFORCEFILLING();
|
||||
#include <OSD_Chronometer.hxx>
|
||||
|
||||
extern Standard_Real t_t3cornerinit ,t_spherique,t_torique,
|
||||
t_notfilling,t_filling,t_t3cornerDS;
|
||||
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
|
||||
extern void ChFi3d_ResultChron(OSD_Chronometer & ch,Standard_Real& time);
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : SearchPivot
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer SearchPivot(Standard_Integer* s,
|
||||
Standard_Real u[3][3],
|
||||
const Standard_Real t)
|
||||
{
|
||||
Standard_Boolean bondeb,bonfin;
|
||||
for(Standard_Integer i = 0; i <= 2; i++){
|
||||
if(s[(i+1)%3] == 1){bondeb = (u[(i+1)%3][i]-u[(i+1)%3][(i+2)%3] >= -t);}
|
||||
else {bondeb = (u[(i+1)%3][i]-u[(i+1)%3][(i+2)%3] <= t);}
|
||||
if(s[(i+2)%3] == 1){bonfin = (u[(i+2)%3][i]-u[(i+2)%3][(i+1)%3] >= -t);}
|
||||
else {bonfin = (u[(i+2)%3][i]-u[(i+2)%3][(i+1)%3] <= t);}
|
||||
if (bondeb && bonfin){ return i; }
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SearchFD
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean SearchFD(TopOpeBRepDS_DataStructure& DStr,
|
||||
const Handle(ChFiDS_Stripe)& cd1,
|
||||
const Handle(ChFiDS_Stripe)& cd2,
|
||||
const Standard_Integer sens1,
|
||||
const Standard_Integer sens2,
|
||||
Standard_Integer& i1,
|
||||
Standard_Integer& i2,
|
||||
Standard_Real& p1,
|
||||
Standard_Real& p2,
|
||||
const Standard_Integer ind1,
|
||||
const Standard_Integer ind2,
|
||||
TopoDS_Face& face,
|
||||
Standard_Boolean& sameside,
|
||||
Standard_Integer& jf1,
|
||||
Standard_Integer& jf2)
|
||||
{
|
||||
Standard_Boolean found = Standard_False;
|
||||
Standard_Integer id1 = ind1, id2 = ind2;
|
||||
Standard_Integer if1 = ind1, if2 = ind2;
|
||||
Standard_Integer l1 = cd1->SetOfSurfData()->Length();
|
||||
Standard_Integer l2 = cd2->SetOfSurfData()->Length();
|
||||
Standard_Integer i;
|
||||
Standard_Boolean fini1 = Standard_False, fini2 = Standard_False;
|
||||
Standard_Boolean visavis;
|
||||
TopoDS_Vertex Vtx;
|
||||
while( !found ){
|
||||
for(i = id1; (i*sens1) <= (if1*sens1) && !found && !fini2; i = i+sens1 ){
|
||||
if(ChFi3d_IsInFront(DStr,cd1,cd2,i,if2,sens1,sens2,p1,p2,face,sameside,jf1,jf2,visavis,Vtx,Standard_False,0)){
|
||||
i1 = i;
|
||||
i2 = if2;
|
||||
found = Standard_True;
|
||||
}
|
||||
}
|
||||
if(!fini1){
|
||||
if1 = if1 + sens1;
|
||||
if(if1 < 1 || if1 > l1){ if1 = if1 - sens1; fini1 = Standard_True; }
|
||||
}
|
||||
|
||||
for(i = id2; (i*sens2) <= (if2*sens2) && !found && !fini1; i = i+sens2 ){
|
||||
if(ChFi3d_IsInFront(DStr,cd1,cd2,if1,i,sens1,sens2,p1,p2,face,sameside,jf1,jf2,visavis,Vtx,Standard_False,0)){
|
||||
i1 = if1;
|
||||
i2 = i;
|
||||
found = Standard_True;
|
||||
}
|
||||
}
|
||||
if(!fini2){
|
||||
if2 = if2 + sens2;
|
||||
if(if2 < 1 || if2 > l2){ if2 = if2 - sens2; fini2 = Standard_True; }
|
||||
}
|
||||
if(fini1 && fini2) break;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ToricCorner
|
||||
//purpose : Teste si on est dans le cas pariculier d un coin torique
|
||||
// (ou spherique limite par des isos).
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean ToricCorner(const TopoDS_Face& F,
|
||||
const Standard_Real rd,
|
||||
const Standard_Real rf,
|
||||
const gp_Vec& v)
|
||||
{
|
||||
if(Abs(rd-rf) > Precision::Confusion()){ return Standard_False; }
|
||||
BRepAdaptor_Surface bs(F);
|
||||
if(bs.GetType() != GeomAbs_Plane){ return Standard_False; }
|
||||
Standard_Real scal1 = Abs(bs.Plane().Position().XDirection().Dot(v));
|
||||
Standard_Real scal2 = Abs(bs.Plane().Position().YDirection().Dot(v));
|
||||
return (scal1 <= Precision::Confusion() &&
|
||||
scal2 <= Precision::Confusion());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformThreeCorner
|
||||
//purpose : Calcul du conge sur un sommet avec trois aretes
|
||||
// incidentes portant chacune un conge.
|
||||
//=======================================================================
|
||||
|
||||
void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
|
||||
{
|
||||
|
||||
#ifdef DEB
|
||||
OSD_Chronometer ch;
|
||||
ChFi3d_InitChron(ch); // init perf initialisation
|
||||
#endif
|
||||
|
||||
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
|
||||
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Jndex);
|
||||
ChFiDS_ListIteratorOfListOfStripe It;
|
||||
Standard_Integer Index[3],pivot,deb,fin,ii,jj,kk;
|
||||
//Standard_Real R = 0.;
|
||||
Standard_Boolean pivdif = Standard_True;
|
||||
Standard_Boolean c1pointu = Standard_False;
|
||||
Standard_Boolean c1toric = Standard_False;
|
||||
Standard_Boolean c1spheric = Standard_False;
|
||||
Handle(ChFiDS_Stripe) CD[3];
|
||||
TopoDS_Face face[3];
|
||||
Standard_Integer jf[3][3];
|
||||
Standard_Boolean sameside[3], oksea[3];
|
||||
for(Standard_Integer g = 0; g <= 2; g++){oksea[g] = Standard_False;}
|
||||
Standard_Integer i[3][3];
|
||||
Standard_Integer sens[3];
|
||||
Standard_Real p[3][3];
|
||||
|
||||
Standard_Boolean filling = 0;
|
||||
|
||||
for (It.Initialize(myVDataMap(Jndex)),ii=0;It.More() && ii<3;It.Next(),ii++){
|
||||
Index[ii] = ChFi3d_IndexOfSurfData(Vtx,It.Value(),sens[ii]);
|
||||
CD[ii] = It.Value();
|
||||
}
|
||||
// On verifie que l une des CD ne figure pas deux fois, au quel cas
|
||||
// il faut modifier le retour de IndexOfSurfData qui prend la
|
||||
// premiere des solutions.
|
||||
if(CD[0] == CD[1]){
|
||||
Index[1] = CD[1]->SetOfSurfData()->Length();
|
||||
sens[1] = -1;
|
||||
}
|
||||
else if(CD[1] == CD[2]){
|
||||
Index[2] = CD[2]->SetOfSurfData()->Length();
|
||||
sens[2] = -1;
|
||||
}
|
||||
else if(CD[0] == CD[2]){
|
||||
Index[2] = CD[2]->SetOfSurfData()->Length();
|
||||
sens[2] = -1;
|
||||
}
|
||||
oksea[2] = SearchFD(DStr,CD[0],CD[1],sens[0],sens[1],i[0][1],i[1][0],
|
||||
p[0][1],p[1][0],Index[0],Index[1],face[2],sameside[2],
|
||||
jf[0][1],jf[1][0]);
|
||||
oksea[1] = SearchFD(DStr,CD[0],CD[2],sens[0],sens[2],i[0][2],i[2][0],
|
||||
p[0][2],p[2][0],Index[0],Index[2],face[1],sameside[1],
|
||||
jf[0][2],jf[2][0]);
|
||||
oksea[0] = SearchFD(DStr,CD[1],CD[2],sens[1],sens[2],i[1][2],i[2][1],
|
||||
p[1][2],p[2][1],Index[1],Index[2],face[0],sameside[0],
|
||||
jf[1][2],jf[2][1]);
|
||||
//
|
||||
// Analyse des concavites des 3 conges :
|
||||
// - 2 concavites identiques et 1 inverse.
|
||||
// - 3 concavites identiques
|
||||
//
|
||||
if(oksea[2] && oksea[1] && !sameside[2] && !sameside[1])
|
||||
{ pivot = 0; deb = 1; fin = 2;}
|
||||
else if(oksea[2] && oksea[0] && !sameside[2] && !sameside[0])
|
||||
{ pivot = 1; deb = 2; fin = 0;}
|
||||
else if(oksea[1] && oksea[0] && !sameside[1] && !sameside[0])
|
||||
{ pivot = 2; deb = 0; fin = 1;}
|
||||
else if(oksea[0] && oksea[1] && oksea[2]){
|
||||
// 3 concavites identiques.
|
||||
pivot = SearchPivot(sens,p,tol2d);
|
||||
if(pivot < 0){
|
||||
#ifdef DEB
|
||||
cout<<"pivot non trouve, on appelle plate"<<endl;
|
||||
#endif
|
||||
PerformMoreThreeCorner(Jndex, 3);
|
||||
return;
|
||||
}
|
||||
else{deb = (pivot+1)%3 ; fin = (pivot+2)%3;}
|
||||
pivdif = Standard_False;
|
||||
if(Abs(p[0][1]-p[0][2]) <= tol2d &&
|
||||
Abs(p[1][0]-p[1][2]) <= tol2d &&
|
||||
Abs(p[2][0]-p[2][1]) <= tol2d){
|
||||
c1pointu = Standard_True;
|
||||
}
|
||||
}
|
||||
else {
|
||||
PerformMoreThreeCorner(Jndex, 3);
|
||||
return;
|
||||
}
|
||||
Standard_Integer ifacdeb, ifacfin;
|
||||
ifacdeb = CD[deb]->ChangeSetOfSurfData()->Value(i[deb][pivot])->Index(3-jf[deb][pivot]);
|
||||
ifacfin = CD[fin]->ChangeSetOfSurfData()->Value(i[fin][pivot])->Index(3-jf[fin][pivot]);
|
||||
if(ifacfin != ifacdeb){
|
||||
#ifdef DEB
|
||||
cout<<"plusieurs faces d'appui, on appelle plate"<<endl;
|
||||
#endif
|
||||
PerformMoreThreeCorner(Jndex, 3);
|
||||
return;
|
||||
}
|
||||
if(i[pivot][deb] != i[pivot][fin]){
|
||||
#ifdef DEB
|
||||
cout<<"changement de surfdata sur le pivot, on appelle plate"<<endl;
|
||||
#endif
|
||||
PerformMoreThreeCorner(Jndex, 3);
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real Rdeb,Rfin,Rdp,Rfp;
|
||||
gp_Pnt Pdeb,Pfin,Pdp,Pfp;
|
||||
gp_Vec Vdeb,Vfin,Vdp,Vfp;
|
||||
if(c1pointu){
|
||||
gp_Pnt pbid;
|
||||
gp_Vec qv[3];
|
||||
Standard_Real qr[3];
|
||||
for(ii = 0; ii<=2; ii++){
|
||||
jj = (ii+1)%3 ; kk = (ii+2)%3;
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[jj],i[jj][ii],p[jj][ii],1,
|
||||
sens[jj],pbid,qv[jj],qr[jj]);
|
||||
}
|
||||
for(ii = 0; ii<=2 && !c1toric; ii++){
|
||||
jj = (ii+1)%3 ; kk = (ii+2)%3;
|
||||
if(ToricCorner(face[ii],qr[jj],qr[kk],qv[ii])){
|
||||
c1toric = Standard_True;
|
||||
pivot = ii; deb = jj; fin = kk;
|
||||
}
|
||||
}
|
||||
if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolesp && Abs(qr[0]-qr[2])<tolesp);
|
||||
}
|
||||
|
||||
// Autrefois pour eviter les bouclages on mettait toujours les
|
||||
// points a l interieur, ca pouvait gener la construction de la
|
||||
// ligne guide du coin qui aujourd hui est un cercle.
|
||||
// Standard_Integer jjjd = jf[deb][fin], jjjf = jf[fin][deb];
|
||||
// if (pivdif) jjjd = jf[deb][pivot], jjjf = jf[fin][pivot];
|
||||
Standard_Integer jjjd = jf[deb][pivot], jjjf = jf[fin][pivot];
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[deb],i[deb][pivot],p[deb][pivot],
|
||||
jjjd,sens[deb],Pdeb,Vdeb,Rdeb);
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[fin],i[fin][pivot],p[fin][pivot],
|
||||
jjjf,sens[fin],Pfin,Vfin,Rfin);
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[pivot],i[pivot][deb],p[pivot][deb],
|
||||
0,sens[pivot],Pdp,Vdp,Rdp);
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[pivot],i[pivot][fin],p[pivot][fin],
|
||||
0,sens[pivot],Pfp,Vfp,Rfp);
|
||||
//dans le cas allsame on controle que les points sur la face ne
|
||||
//sont pas trop pres ce qui risque de faire foirer le cheminement.
|
||||
if(!pivdif) {
|
||||
gp_Pnt ptestdeb,ptestfin; gp_Vec bidvec; Standard_Real bidr;
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[deb],i[deb][pivot],p[deb][pivot],
|
||||
jf[deb][fin],sens[deb],ptestdeb,bidvec,bidr);
|
||||
ChFi3d_ExtrSpineCarac(DStr,CD[fin],i[fin][pivot],p[fin][pivot],
|
||||
jf[fin][deb],sens[fin],ptestfin,bidvec,bidr);
|
||||
Standard_Real distest = ptestdeb.Distance(ptestfin);
|
||||
if(distest < (Rdp+Rfp)*0.05) filling = 1;
|
||||
if(distest < (Rdp+Rfp)*0.005) c1pointu = 1;
|
||||
}
|
||||
|
||||
if(!c1pointu){
|
||||
if (!pivdif) c1pointu = (Abs(p[deb][pivot]-p[deb][fin]) <=tol2d &&
|
||||
Abs(p[fin][pivot]-p[fin][deb]) <=tol2d);
|
||||
if(Abs(p[pivot][deb] - p[pivot][fin]) <= tol2d)
|
||||
c1toric = ToricCorner(face[pivot],Rdeb,Rfin,Vdp);
|
||||
}
|
||||
// on a le pivot, le CD deb et le CD fin (enfin on espere !?!) :
|
||||
// -------------------------------------------------------------
|
||||
// les criteres determinant si le coin est un tore ou une sphere
|
||||
// sont uniquement fondes sur la configuration des sections en
|
||||
// bout et la nature des faces, il faudra faire des tests pour
|
||||
// determiner si une analyse plus subtile des conges incidents
|
||||
// n est pas necessaire pour assurer la tangence entre ceux-ci
|
||||
// et le coin (en particulier dans les cas a rayon variable).
|
||||
|
||||
|
||||
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fddeb = CD[deb]->ChangeSetOfSurfData()->ChangeValue(i[deb][pivot]);
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fdfin = CD[fin]->ChangeSetOfSurfData()->ChangeValue(i[fin][pivot]);
|
||||
Handle(ChFiDS_SurfData)&
|
||||
fdpiv = CD[pivot]->ChangeSetOfSurfData()->ChangeValue(i[pivot][deb]);
|
||||
|
||||
|
||||
// On construit les HSurfaces et autres outils qui vont bien.
|
||||
// ----------------------------------------------------------
|
||||
|
||||
TopAbs_Orientation OFac = face[pivot].Orientation();
|
||||
Handle(BRepAdaptor_HSurface) Fac = new BRepAdaptor_HSurface(face[pivot]);
|
||||
gp_Pnt2d ppp1,ppp2;
|
||||
const ChFiDS_FaceInterference& bid1 = CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->InterferenceOnS1();
|
||||
ppp1 = bid1.PCurveOnSurf()->Value(bid1.FirstParameter());
|
||||
const ChFiDS_FaceInterference& bid2 = CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->InterferenceOnS2();
|
||||
ppp2 = bid2.PCurveOnSurf()->Value(bid2.LastParameter());
|
||||
Standard_Real uu1 = ppp1.X(), uu2 = ppp2.X(), vv1 = ppp1.Y(), vv2 = ppp2.Y();
|
||||
GeomAdaptor_Surface
|
||||
gasurf((DStr.Surface(CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->Surf())).Surface(),
|
||||
uu1, uu2, vv1, vv2);
|
||||
GeomAbs_SurfaceType styp = gasurf.GetType();
|
||||
if(styp == GeomAbs_Cylinder){
|
||||
Standard_Real h = vv2 - vv1;
|
||||
vv1 -= 0.5*h;
|
||||
vv2 += 0.5*h;
|
||||
gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->Surf())).Surface(),
|
||||
uu1, uu2, vv1, vv2);
|
||||
}
|
||||
else if(styp == GeomAbs_Torus){
|
||||
Standard_Real h = uu2 - uu1;
|
||||
uu1 -= 0.1*h;
|
||||
uu2 += 0.1*h;
|
||||
gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->Surf())).Surface(),
|
||||
uu1, uu2, vv1, vv2);
|
||||
}
|
||||
else if(styp == GeomAbs_BezierSurface || styp == GeomAbs_BSplineSurface){
|
||||
gasurf.Load((DStr.Surface(CD[pivot]->SetOfSurfData()->
|
||||
Value(i[pivot][deb])->Surf())).Surface());
|
||||
}
|
||||
|
||||
Handle(GeomAdaptor_HSurface) Surf = new GeomAdaptor_HSurface(gasurf);
|
||||
// Handle(BRepTopAdaptor_TopolTool) IFac = new BRepTopAdaptor_TopolTool(Fac);
|
||||
// Essai de ne pas classifier sur la face pour les cas de conges rentrants
|
||||
// qui debordent naturellement.
|
||||
Handle(GeomAdaptor_HSurface)
|
||||
bidsurf = new GeomAdaptor_HSurface(Fac->ChangeSurface().Surface());
|
||||
Handle(Adaptor3d_TopolTool)
|
||||
IFac = new Adaptor3d_TopolTool(bidsurf);
|
||||
// fin de l essai.
|
||||
Handle(Adaptor3d_TopolTool) ISurf = new Adaptor3d_TopolTool(Surf);
|
||||
Handle(ChFiDS_Stripe) corner = new ChFiDS_Stripe();
|
||||
Handle(ChFiDS_HData)& cornerset = corner->ChangeSetOfSurfData();
|
||||
cornerset = new ChFiDS_HData();
|
||||
Handle(ChFiDS_SurfData) coin = new ChFiDS_SurfData();
|
||||
cornerset->Append(coin);
|
||||
TopAbs_Orientation o1,o2,os1,os2,oo1,oo2;
|
||||
Standard_Integer choix = CD[deb]->Choix();
|
||||
o1 = face[pivot].Orientation();
|
||||
o2 = fdpiv->Orientation();
|
||||
oo1 = o1; oo2 = o2;
|
||||
os1 = CD[deb]->OrientationOnFace1();
|
||||
os2 = CD[deb]->OrientationOnFace2();
|
||||
if(jf[deb][fin] == 1){
|
||||
choix = ChFi3d::NextSide(o1,o2,os1,os2,choix);
|
||||
if(sens[deb] == 1){
|
||||
if(choix%2 == 1) choix++;
|
||||
else choix--;
|
||||
}
|
||||
}
|
||||
else {
|
||||
choix = ChFi3d::NextSide(o2,o1,os1,os2,-choix);
|
||||
if(sens[deb] == -1){
|
||||
if(choix%2 == 1) choix++;
|
||||
else choix--;
|
||||
}
|
||||
}
|
||||
|
||||
gp_Pnt2d pfac1,pfac2,psurf1,psurf2;
|
||||
gp_Vec2d vfac1,vfac2;
|
||||
CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
|
||||
Interference(jf[deb][fin]).PCurveOnFace()->D1(p[deb][pivot],pfac1,vfac1);
|
||||
CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
|
||||
Interference(jf[fin][deb]).PCurveOnFace()->D1(p[fin][pivot],pfac2,vfac2);
|
||||
psurf1 = CD[pivot]->SetOfSurfData()->Value(i[pivot][deb])->
|
||||
Interference(jf[pivot][deb]).PCurveOnSurf()->Value(p[pivot][deb]);
|
||||
psurf2 = CD[pivot]->SetOfSurfData()->Value(i[pivot][fin])->
|
||||
Interference(jf[pivot][fin]).PCurveOnSurf()->Value(p[pivot][fin]);
|
||||
|
||||
done = Standard_False;
|
||||
#ifdef DEB
|
||||
if(ChFi3d_GetcontextFORCEFILLING()) c1spheric = c1toric = 0;
|
||||
#endif
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_t3cornerinit); // result perf initialisations
|
||||
#endif
|
||||
|
||||
if (c1toric){
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf cas torique
|
||||
#endif
|
||||
|
||||
// Construction directe.
|
||||
// ---------------------
|
||||
done = ChFiKPart_ComputeData::ComputeCorner
|
||||
(DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_torique); // result perf cas torique
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(c1spheric){
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); //init perf cas spherique
|
||||
#endif
|
||||
|
||||
done = ChFiKPart_ComputeData::ComputeCorner
|
||||
(DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdp,pfac1,psurf1,psurf2);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_spherique);// result perf cas spherique
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(c1pointu){
|
||||
filling = 1;
|
||||
}
|
||||
if(!done){
|
||||
if(!filling) {
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch);// init perf not filling
|
||||
#endif
|
||||
|
||||
//on se calcule une ligne guide,
|
||||
//------------------------------
|
||||
//Problemes nombreux de bouclages et demi-tours lies
|
||||
//a la courbure de la ligne guide !!!!!!
|
||||
//POUR L INSTANT CERCLE.
|
||||
//Si un jour on change de nature de ligne guide il faudra
|
||||
//remettre les points Pdeb et Pfin a l interieur (voir le
|
||||
//commentaire a ce sujet a la ligne du calcul de Pdeb et Pfin).
|
||||
|
||||
Standard_Real radpondere = (Rdp+Rfp)/2.;
|
||||
Standard_Real locfleche = fleche;
|
||||
|
||||
Standard_Real WFirst,WLast;
|
||||
Handle(Geom_Curve) spinecoin = ChFi3d_CircularSpine(WFirst,WLast,
|
||||
Pdeb,Vdeb,
|
||||
Pfin,Vfin,radpondere);
|
||||
if(spinecoin.IsNull()){
|
||||
// On est dans un cas pourri ou l intersection des plans
|
||||
// de section se fait en dehors du secteur.
|
||||
spinecoin = ChFi3d_Spine(Pdeb,Vdeb,
|
||||
Pfin,Vfin,radpondere);
|
||||
WFirst = 0.; WLast = 1.;
|
||||
}
|
||||
else locfleche = radpondere * (WLast - WFirst) * fleche;
|
||||
Standard_Real pasmax = (WLast-WFirst)*0.05;
|
||||
Handle(ChFiDS_HElSpine) cornerspine = new ChFiDS_HElSpine();
|
||||
cornerspine->ChangeCurve().SetCurve(spinecoin);
|
||||
cornerspine->ChangeCurve().FirstParameter(WFirst - pasmax);
|
||||
cornerspine->ChangeCurve().LastParameter(WLast + pasmax);
|
||||
// Juste pour leurrer le Compute data qui ne doit pas
|
||||
// en avoir besoin dans ce cas precis ...
|
||||
Handle(ChFiDS_Spine) NullSpine;
|
||||
// On calcule le conge : - de deb vers fin
|
||||
// - de la face vers la surface
|
||||
//
|
||||
math_Vector Soldep(1,4);
|
||||
Soldep(1) = pfac1.X();
|
||||
Soldep(2) = pfac1.Y();
|
||||
Soldep(3) = psurf1.X();
|
||||
Soldep(4) = psurf1.Y();
|
||||
|
||||
Standard_Boolean Gd1,Gd2,Gf1,Gf2;
|
||||
Handle(BRepBlend_Line) lin;
|
||||
Standard_Real ffi = WFirst, lla = WLast + pasmax;
|
||||
|
||||
if (Abs(Rdeb-Rfin)<=tolesp){
|
||||
|
||||
BRepBlend_ConstRad func(Fac,Surf,cornerspine);
|
||||
BRepBlend_ConstRadInv finv(Fac,Surf,cornerspine);
|
||||
func.Set(Rdeb,choix);
|
||||
func.Set(myShape);
|
||||
finv.Set(Rdeb,choix);
|
||||
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
|
||||
|
||||
Standard_Boolean intf = 3, intl = 3;
|
||||
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
|
||||
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
|
||||
0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
|
||||
#ifdef DEB
|
||||
if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
|
||||
#endif
|
||||
if(done && Gf2){
|
||||
done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
|
||||
filling = !done;
|
||||
}
|
||||
else filling = 1;
|
||||
}
|
||||
else{
|
||||
Handle(Law_S) law = new Law_S();
|
||||
law->Set(WFirst,Rdeb,WLast,Rfin);
|
||||
BRepBlend_EvolRad func(Fac,Surf,cornerspine,law);
|
||||
BRepBlend_EvolRadInv finv(Fac,Surf,cornerspine,law);
|
||||
func.Set(choix);
|
||||
func.Set(myShape);
|
||||
finv.Set(choix);
|
||||
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
|
||||
Standard_Boolean intf = 3, intl = 3;
|
||||
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
|
||||
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
|
||||
0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
|
||||
#ifdef DEB
|
||||
if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
|
||||
#endif
|
||||
if(done && Gf2){
|
||||
done = CompleteData(coin,func,lin,Fac,Surf,OFac,Gd1,0,Gf1,0);
|
||||
filling = !done;
|
||||
}
|
||||
else filling = 1;
|
||||
}
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_notfilling);// result perf not filling
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if(filling) {
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch); // init perf filling
|
||||
#endif
|
||||
|
||||
// le contour a remplir est constitue de droites uv sur deb et fin
|
||||
// de deux pcurves (une seule si c1pointu) calculees comme on peut
|
||||
// sur piv et la face opposee.
|
||||
Handle(GeomFill_Boundary) Bdeb,Bfin,Bpiv,Bfac;
|
||||
Handle(Geom2d_Curve) PCurveOnFace;
|
||||
if(!c1pointu)
|
||||
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],pfac1,vfac1,
|
||||
sens[fin],pfac2,vfac2,tolesp,2.e-4);
|
||||
Standard_Integer kkk;
|
||||
gp_Pnt ppbid;
|
||||
gp_Vec vp1,vp2;
|
||||
kkk = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
|
||||
Interference(jf[deb][pivot]).LineIndex();
|
||||
DStr.Curve(kkk).Curve()->D1(p[deb][pivot],ppbid,vp1);
|
||||
kkk = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
|
||||
Interference(jf[fin][pivot]).LineIndex();
|
||||
DStr.Curve(kkk).Curve()->D1(p[fin][pivot],ppbid,vp2);
|
||||
Handle(Geom2d_Curve) PCurveOnPiv;
|
||||
// Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],psurf1,vp1,
|
||||
// sens[fin],psurf2,vp2,tolesp,2.e-4);
|
||||
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolesp,2.e-4,0);
|
||||
Standard_Real pardeb2 = p[deb][pivot];
|
||||
Standard_Real parfin2 = p[fin][pivot];
|
||||
if(c1pointu){
|
||||
pardeb2 = p[deb][fin];
|
||||
parfin2 = p[fin][deb];
|
||||
}
|
||||
gp_Pnt2d pdeb1 = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
|
||||
Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
|
||||
gp_Pnt2d pdeb2 = CD[deb]->SetOfSurfData()->Value(i[deb][pivot])->
|
||||
Interference(jf[deb][fin]).PCurveOnSurf()->Value(pardeb2);
|
||||
gp_Pnt2d pfin1 = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
|
||||
Interference(jf[fin][pivot]).PCurveOnSurf()->Value(p[fin][pivot]);
|
||||
gp_Pnt2d pfin2 = CD[fin]->SetOfSurfData()->Value(i[fin][pivot])->
|
||||
Interference(jf[fin][deb]).PCurveOnSurf()->Value(parfin2);
|
||||
Handle(Geom_Surface) sdeb =
|
||||
DStr.Surface(CD[deb]->SetOfSurfData()->
|
||||
Value(i[deb][pivot])->Surf()).Surface();
|
||||
Handle(Geom_Surface) sfin =
|
||||
DStr.Surface(CD[fin]->SetOfSurfData()->
|
||||
Value(i[fin][pivot])->Surf()).Surface();
|
||||
|
||||
Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolesp,2.e-4);
|
||||
Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolesp,2.e-4);
|
||||
|
||||
GeomFill_ConstrainedFilling fil(11,20);
|
||||
if(c1pointu) fil.Init(Bpiv,Bfin,Bdeb,1);
|
||||
else fil.Init(Bpiv,Bfin,Bfac,Bdeb,1);
|
||||
|
||||
Handle(Geom_Surface) Surfcoin = fil.Surface();
|
||||
Surfcoin->VReverse(); // on se ramene au sens face surf;
|
||||
done = CompleteData(coin,Surfcoin,
|
||||
Fac,PCurveOnFace,
|
||||
Surf,PCurveOnPiv,fdpiv->Orientation(),0,
|
||||
0,0,0,0);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_filling);// result perf filling
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
Standard_Real P1deb,P2deb,P1fin,P2fin;
|
||||
if(!c1pointu){
|
||||
p[deb][fin] = p[deb][pivot];
|
||||
p[fin][deb] = p[fin][pivot];
|
||||
}
|
||||
|
||||
if (done){
|
||||
// Mise a jour des 4 Stripes et de la DS
|
||||
// -------------------------------------
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_InitChron(ch);// init perf mise a jour DS
|
||||
#endif
|
||||
|
||||
gp_Pnt2d pp1,pp2;
|
||||
Standard_Real parpp1,parpp2;
|
||||
Standard_Integer If1,If2,Il1,Il2,Icf,Icl;
|
||||
const ChFiDS_CommonPoint& Pf1 = coin->VertexFirstOnS1();
|
||||
const ChFiDS_CommonPoint& Pf2 = coin->VertexFirstOnS2();
|
||||
ChFiDS_CommonPoint& Pl1 = coin->ChangeVertexLastOnS1();
|
||||
if(c1pointu) Pl1 = coin->ChangeVertexFirstOnS1();
|
||||
const ChFiDS_CommonPoint& Pl2 = coin->VertexLastOnS2();
|
||||
|
||||
Bnd_Box bf1,bl1,bf2,bl2;
|
||||
Bnd_Box *pbf1 = &bf1,*pbl1 = &bl1,*pbf2 = &bf2,*pbl2 = &bl2;
|
||||
if(c1pointu) pbl1 = pbf1;
|
||||
pbf1->Add(Pf1.Point());pbf2->Add(Pf2.Point());
|
||||
pbl1->Add(Pl1.Point());pbl2->Add(Pl2.Point());
|
||||
|
||||
// le coin pour commencer,
|
||||
// -----------------------
|
||||
ChFiDS_Regul regdeb, regfin;
|
||||
If1 = ChFi3d_IndexPointInDS(Pf1,DStr);
|
||||
If2 = ChFi3d_IndexPointInDS(Pf2,DStr);
|
||||
if(c1pointu) Il1 = If1;
|
||||
else Il1 = ChFi3d_IndexPointInDS(Pl1,DStr);
|
||||
Il2 = ChFi3d_IndexPointInDS(Pl2,DStr);
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().FirstParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().FirstParameter());
|
||||
if(c1pointu) coin->ChangeIndexOfS1(0);
|
||||
else coin->ChangeIndexOfS1(DStr.AddShape(face[pivot]));
|
||||
coin->ChangeIndexOfS2(-fdpiv->Surf());
|
||||
|
||||
Handle(Geom_Curve) C3d;
|
||||
Standard_Real tolreached;
|
||||
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeFirstPCurve(),P1deb,P2deb,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
|
||||
Icf = DStr.AddCurve(Tcurv1);
|
||||
regdeb.SetCurve(Icf);
|
||||
regdeb.SetS1(coin->Surf(),0);
|
||||
regdeb.SetS2(fddeb->Surf(),0);
|
||||
myRegul.Append(regdeb);
|
||||
corner->ChangeFirstCurve(Icf);
|
||||
corner->ChangeFirstParameters(P1deb,P2deb);
|
||||
corner->ChangeIndexFirstPointOnS1(If1);
|
||||
corner->ChangeIndexFirstPointOnS2(If2);
|
||||
ChFi3d_EnlargeBox(DStr,corner,coin,*pbf1,*pbf2,1);
|
||||
|
||||
pp1 = coin->InterferenceOnS1().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS1().LastParameter());
|
||||
pp2 = coin->InterferenceOnS2().PCurveOnSurf()->
|
||||
Value(coin->InterferenceOnS2().LastParameter());
|
||||
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
|
||||
DStr.Surface(coin->Surf()).Surface(),C3d,
|
||||
corner->ChangeLastPCurve(),P1fin,P2fin,
|
||||
tolesp,tol2d,tolreached,0);
|
||||
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
|
||||
Icl = DStr.AddCurve(Tcurv2);
|
||||
regfin.SetCurve(Icl);
|
||||
regfin.SetS1(coin->Surf(),0);
|
||||
regfin.SetS2(fdfin->Surf(),0);
|
||||
myRegul.Append(regfin);
|
||||
corner->ChangeLastCurve(Icl);
|
||||
corner->ChangeLastParameters(P1fin,P2fin);
|
||||
corner->ChangeIndexLastPointOnS1(Il1);
|
||||
corner->ChangeIndexLastPointOnS2(Il2);
|
||||
ChFi3d_EnlargeBox(DStr,corner,coin,*pbl1,*pbl2,0);
|
||||
|
||||
// puis la CornerData du debut,
|
||||
// ----------------------------
|
||||
Standard_Boolean isfirst = (sens[deb] == 1), rev = (jf[deb][fin] == 2);
|
||||
Standard_Integer isurf1 = 1, isurf2 = 2;
|
||||
parpp1 = p[deb][fin]; parpp2 = p[deb][pivot];
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
parpp1 = p[deb][pivot]; parpp2 = p[deb][fin];
|
||||
CD[deb]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
pp1 = fddeb->InterferenceOnS1().PCurveOnSurf()->Value(parpp1);
|
||||
pp2 = fddeb->InterferenceOnS2().PCurveOnSurf()->Value(parpp2);
|
||||
CD[deb]->SetCurve(Icf,isfirst);
|
||||
CD[deb]->SetIndexPoint(If1,isfirst,isurf1);
|
||||
CD[deb]->SetIndexPoint(If2,isfirst,isurf2);
|
||||
CD[deb]->SetParameters(isfirst,P1deb,P2deb);
|
||||
fddeb->ChangeVertex(isfirst,isurf1) = Pf1;
|
||||
fddeb->ChangeVertex(isfirst,isurf2) = Pf2;
|
||||
fddeb->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
|
||||
fddeb->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
|
||||
TopOpeBRepDS_Curve& tcdeb = DStr.ChangeCurve(Icf);
|
||||
Handle(Geom_Curve) crefdeb = tcdeb.Curve();
|
||||
Standard_Real tolrdeb;
|
||||
ChFi3d_ComputePCurv(crefdeb,pp1,pp2,CD[deb]->ChangePCurve(isfirst),
|
||||
DStr.Surface(fddeb->Surf()).Surface(),
|
||||
P1deb,P2deb,tolesp,tolrdeb,rev);
|
||||
tcdeb.Tolerance(Max(tolrdeb,tcdeb.Tolerance()));
|
||||
if(rev) ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf2,*pbf1,isfirst);
|
||||
else ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf1,*pbf2,isfirst);
|
||||
|
||||
// puis la CornerData de la fin,
|
||||
// -----------------------------
|
||||
isfirst = (sens[fin] == 1); rev = (jf[fin][deb] == 2);
|
||||
isurf1 = 1; isurf2 = 2;
|
||||
parpp1 = p[fin][deb]; parpp2 = p[fin][pivot];
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
parpp1 = p[fin][pivot]; parpp2 = p[fin][deb];
|
||||
CD[fin]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
pp1 = fdfin->InterferenceOnS1().PCurveOnSurf()->Value(parpp1);
|
||||
pp2 = fdfin->InterferenceOnS2().PCurveOnSurf()->Value(parpp2);
|
||||
CD[fin]->SetCurve(Icl,isfirst);
|
||||
CD[fin]->SetIndexPoint(Il1,isfirst,isurf1);
|
||||
CD[fin]->SetIndexPoint(Il2,isfirst,isurf2);
|
||||
CD[fin]->SetParameters(isfirst,P1fin,P2fin);
|
||||
fdfin->ChangeVertex(isfirst,isurf1) = Pl1;
|
||||
fdfin->ChangeVertex(isfirst,isurf2) = Pl2;
|
||||
fdfin->ChangeInterferenceOnS1().SetParameter(parpp1,isfirst);
|
||||
fdfin->ChangeInterferenceOnS2().SetParameter(parpp2,isfirst);
|
||||
TopOpeBRepDS_Curve& tcfin = DStr.ChangeCurve(Icl);
|
||||
Handle(Geom_Curve) creffin = tcfin.Curve();
|
||||
Standard_Real tolrfin;
|
||||
ChFi3d_ComputePCurv(creffin,pp1,pp2,CD[fin]->ChangePCurve(isfirst),
|
||||
DStr.Surface(fdfin->Surf()).Surface(),
|
||||
P1fin,P2fin,tolesp,tolrfin,rev);
|
||||
tcfin.Tolerance(Max(tolrfin,tcfin.Tolerance()));
|
||||
if(rev) ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl2,*pbl1,isfirst);
|
||||
else ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl1,*pbl2,isfirst);
|
||||
|
||||
// et enfin le pivot.
|
||||
// ------------------
|
||||
ChFiDS_FaceInterference& fi = coin->ChangeInterferenceOnS2();
|
||||
isfirst = (sens[pivot] == 1); rev = (jf[pivot][deb] == 2);
|
||||
isurf1 = 1; isurf2 = 2;
|
||||
if (rev) {
|
||||
isurf1 = 2; isurf2 = 1;
|
||||
CD[pivot]->SetOrientation(TopAbs_REVERSED,isfirst);
|
||||
}
|
||||
Standard_Integer ICcoinpiv = fi.LineIndex();
|
||||
TopOpeBRepDS_Curve& TCcoinpiv = DStr.ChangeCurve(ICcoinpiv);
|
||||
CD[pivot]->SetCurve(ICcoinpiv,isfirst);
|
||||
Handle(Geom_Curve) Ccoinpiv = DStr.Curve(ICcoinpiv).Curve();
|
||||
Handle(Geom2d_Curve)& C2dOnPiv = fi.ChangePCurveOnFace();
|
||||
Handle(Geom_Surface) Spiv = DStr.Surface(fdpiv->Surf()).Surface();
|
||||
Standard_Real tolr;
|
||||
ChFi3d_SameParameter(Ccoinpiv,C2dOnPiv,Spiv,
|
||||
fi.FirstParameter(),fi.LastParameter(),
|
||||
tolesp,tolr);
|
||||
TCcoinpiv.Tolerance(Max(TCcoinpiv.Tolerance(),tolr));
|
||||
CD[pivot]->ChangePCurve(isfirst) = C2dOnPiv;
|
||||
CD[pivot]->SetIndexPoint(If2,isfirst,isurf1);
|
||||
CD[pivot]->SetIndexPoint(Il2,isfirst,isurf2);
|
||||
CD[pivot]->SetParameters(isfirst,fi.FirstParameter(),fi.LastParameter());
|
||||
fdpiv->ChangeVertex(isfirst,isurf1) = Pf2;
|
||||
fdpiv->ChangeVertex(isfirst,isurf2) = Pl2;
|
||||
fdpiv->ChangeInterference(isurf1).SetParameter(p[pivot][deb],isfirst);
|
||||
fdpiv->ChangeInterference(isurf2).SetParameter(p[pivot][fin],isfirst);
|
||||
CD[pivot]->InDS(isfirst); // filDS fait deja le boulot depuis le coin.
|
||||
if(rev) ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbl2,*pbf2,isfirst);
|
||||
else ChFi3d_EnlargeBox(DStr,CD[pivot],fdpiv,*pbf2,*pbl2,isfirst);
|
||||
|
||||
//Pour finir on recale les tolerances des points.
|
||||
ChFi3d_SetPointTolerance(DStr,*pbf1,If1);
|
||||
ChFi3d_SetPointTolerance(DStr,*pbf2,If2);
|
||||
ChFi3d_SetPointTolerance(DStr,*pbl1,Il1);
|
||||
ChFi3d_SetPointTolerance(DStr,*pbl2,Il2);
|
||||
}
|
||||
|
||||
//On tronque les corners data et met a jour les index.
|
||||
//----------------------------------------------------
|
||||
|
||||
if(i[deb][pivot] < Index[deb]){
|
||||
CD[deb]->ChangeSetOfSurfData()->Remove(i[deb][pivot]+1,Index[deb]);
|
||||
Index[deb] = i[deb][pivot];
|
||||
}
|
||||
else if(i[deb][pivot] > Index[deb]) {
|
||||
CD[deb]->ChangeSetOfSurfData()->Remove(Index[deb],i[deb][pivot]-1);
|
||||
i[deb][pivot] = Index[deb];
|
||||
}
|
||||
if(i[fin][pivot] < Index[fin]) {
|
||||
CD[fin]->ChangeSetOfSurfData()->Remove(i[fin][pivot]+1,Index[fin]);
|
||||
Index[fin] = i[fin][pivot];
|
||||
}
|
||||
else if(i[fin][pivot] > Index[fin]) {
|
||||
CD[fin]->ChangeSetOfSurfData()->Remove(Index[fin],i[fin][pivot]-1);
|
||||
i[fin][pivot] = Index[fin];
|
||||
}
|
||||
// il faudra ici tenir compte des coins mutants.
|
||||
if(i[pivot][deb] < Index[pivot]) {
|
||||
CD[pivot]->ChangeSetOfSurfData()->Remove(i[pivot][deb]+1,Index[pivot]);
|
||||
Index[pivot] = i[pivot][deb];
|
||||
}
|
||||
else if(i[pivot][deb] > Index[pivot]) {
|
||||
CD[pivot]->ChangeSetOfSurfData()->Remove(Index[pivot],i[pivot][deb]-1);
|
||||
i[pivot][deb] = Index[pivot];
|
||||
}
|
||||
if(!myEVIMap.IsBound(Vtx)){
|
||||
TColStd_ListOfInteger li;
|
||||
myEVIMap.Bind(Vtx,li);
|
||||
}
|
||||
myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
|
||||
corner->SetSolidIndex(CD[pivot]->SolidIndex());
|
||||
myListStripe.Append(corner);
|
||||
|
||||
#ifdef DEB
|
||||
ChFi3d_ResultChron(ch , t_t3cornerDS);// result perf mise a jour DS
|
||||
#endif
|
||||
}
|
44
src/ChFi3d/ChFi3d_SearchSing.cdl
Executable file
44
src/ChFi3d/ChFi3d_SearchSing.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: ChFi3d_SearchSing.cdl
|
||||
-- Created: Fri Mar 28 11:11:47 1997
|
||||
-- Author: Philippe MANGIN
|
||||
-- <pmn@sgi29>
|
||||
---Copyright: Matra Datavision 1997
|
||||
|
||||
|
||||
private class SearchSing from ChFi3d inherits FunctionWithDerivative from math
|
||||
|
||||
---Purpose: F(t) = (C1(t) - C2(t)).(C1'(t) - C2'(t));
|
||||
|
||||
uses Curve from Geom
|
||||
|
||||
is
|
||||
Create(C1, C2 : Curve from Geom)
|
||||
returns SearchSing from ChFi3d;
|
||||
|
||||
Value(me: in out; X: Real; F: out Real)
|
||||
---Purpose: computes the value of the function <F> for the
|
||||
-- variable <X>.
|
||||
-- returns True if the computation was done successfully,
|
||||
-- False otherwise.
|
||||
returns Boolean;
|
||||
|
||||
Derivative(me: in out; X: Real; D: out Real)
|
||||
---Purpose: computes the derivative <D> of the function
|
||||
-- for the variable <X>.
|
||||
-- Returns True if the calculation were successfully done,
|
||||
-- False otherwise.
|
||||
|
||||
returns Boolean;
|
||||
|
||||
Values(me: in out; X: Real; F, D: out Real)
|
||||
---Purpose: computes the value <F> and the derivative <D> of the
|
||||
-- function for the variable <X>.
|
||||
-- Returns True if the calculation were successfully done,
|
||||
-- False otherwise.
|
||||
|
||||
returns Boolean;
|
||||
|
||||
fields
|
||||
myC1 : Curve from Geom;
|
||||
myC2 : Curve from Geom;
|
||||
end SearchSing;
|
59
src/ChFi3d/ChFi3d_SearchSing.cxx
Executable file
59
src/ChFi3d/ChFi3d_SearchSing.cxx
Executable file
@@ -0,0 +1,59 @@
|
||||
// File: ChFi3d_SearchSing.cxx
|
||||
// Created: Fri Mar 28 15:37:38 1997
|
||||
// Author: Philippe MANGIN
|
||||
// <pmn@sgi29>
|
||||
|
||||
|
||||
#include <ChFi3d_SearchSing.ixx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
ChFi3d_SearchSing::ChFi3d_SearchSing(const Handle(Geom_Curve)& C1,
|
||||
const Handle(Geom_Curve)& C2)
|
||||
{
|
||||
myC1 = C1;
|
||||
myC2 = C2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_Boolean ChFi3d_SearchSing::Value(const Standard_Real X,
|
||||
Standard_Real& F)
|
||||
{
|
||||
gp_Pnt P1, P2;
|
||||
gp_Vec V1, V2;
|
||||
myC1->D1(X, P1, V1);
|
||||
myC2->D1(X, P2, V2);
|
||||
gp_Vec V(P1,P2);
|
||||
F = V * (V2-V1);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Standard_Boolean ChFi3d_SearchSing::Derivative(const Standard_Real X,
|
||||
Standard_Real& D )
|
||||
{
|
||||
gp_Pnt P1, P2;
|
||||
gp_Vec V1, V2, W1, W2;
|
||||
myC1->D2(X, P1, V1, W1);
|
||||
myC2->D2(X, P2, V2, W2);
|
||||
gp_Vec V(P1,P2), VPrim;
|
||||
VPrim = V2 -V1;
|
||||
D = VPrim.SquareMagnitude() + (V * (W2-W1));
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Standard_Boolean ChFi3d_SearchSing::Values(const Standard_Real X,
|
||||
Standard_Real& F,
|
||||
Standard_Real& D )
|
||||
{
|
||||
gp_Pnt P1, P2;
|
||||
gp_Vec V1, V2, W1, W2;
|
||||
myC1->D2(X, P1, V1, W1);
|
||||
myC2->D2(X, P2, V2, W2);
|
||||
gp_Vec V(P1,P2), VPrim;
|
||||
VPrim = V2 -V1;
|
||||
F = V * VPrim;
|
||||
D = VPrim.SquareMagnitude() + (V * (W2-W1));
|
||||
return Standard_True;
|
||||
}
|
16
src/ChFi3d/FILES
Executable file
16
src/ChFi3d/FILES
Executable file
@@ -0,0 +1,16 @@
|
||||
ChFi3d_CMPLRS.edl
|
||||
ChFi3d_Builder_0.cxx
|
||||
ChFi3d_Builder_0.hxx
|
||||
ChFi3d_Builder_1.cxx
|
||||
ChFi3d_Builder_2.cxx
|
||||
ChFi3d_Builder_6.cxx
|
||||
ChFi3d_Builder_C1.cxx
|
||||
ChFi3d_Builder_C2.cxx
|
||||
ChFi3d_Builder_SpKP.cxx
|
||||
ChFi3d_Debug.cxx
|
||||
ChFi3d_FilBuilder_C2.cxx
|
||||
ChFi3d_FilBuilder_C3.cxx
|
||||
ChFi3d_ChBuilder_C2.cxx
|
||||
ChFi3d_ChBuilder_C3.cxx
|
||||
ChFi3d_Builder_CnCrn.cxx
|
||||
ChFi3d_Builder_NotImp.cxx
|
Reference in New Issue
Block a user