BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
Standard_Boolean& myIsDone)
{
- // Un seul contour qui est un cercle ferme
+ // The only contour which is a closed circle
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
Standard_Integer NbEdges = 0;
TopoDS_Edge E;
myMap.Clear();
myMapSpine.Clear();
//------------------------------------------------------------------
- // decoupe du spine pour les lieux bissecteurs.
+ // cut the spine for bissectors.
//------------------------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
static BRepMAT2d_Explorer Exp;
//-----------------------------------------------------
- // Calcul de la carte des lieux bissecteurs a gauche.
- // et des Liens Topologie -> elements de base de la carte.
+ // Calculate the map of bissectors to the left.
+ // and Links Topology -> base elements of the map.
//-----------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
{
if (!myCallGen) {
if (!myMapSpine.IsEmpty()) {
- // myMapSpine peut etre vide si on est passe par PerformWithBilo.
+ // myMapSpine can be empty if passed by PerformWithBilo.
TopTools_DataMapIteratorOfDataMapOfShapeShape it(myMapSpine);
for (; it.More(); it.Next()) {
if (myMap.Contains(it.Key())) {
TopoDS_Wire NewW = TopoDS::Wire(aLocalShape);
// TopoDS_Wire NewW = TopoDS::Wire(CurW.Moved(L));
B.Add(aShape,NewW);
- // mise a jour de la Map.
+ // update Map.
TopoDS_Iterator it1( CurW);
TopoDS_Iterator it2( NewW);
for ( ; it1.More(); it1.Next(), it2.Next()) {
}
myMap.Clear();
- //*****************************************
- // si myOffset = 0, on ne s'emmerde pas !!
- //*****************************************
if ( Abs(myOffset) < Precision::Confusion()) {
Compute(mySpine,myShape,myMap,Alt);
myIsDone = Standard_True;
return;
}
- //******************************
- // Calcul pour un offset non nul
- //******************************
+ //********************************
+ // Calculate for a non null offset
+ //********************************
if (KPartCircle(mySpine,Offset,Alt,myShape,myMap,myIsDone)) return;
BRep_Builder myBuilder;
myBuilder.MakeCompound(TopoDS::Compound(myShape));
//---------------------------------------------------------------------
- // MapNodeVertex : associe a chaque noeud de la carte (key1) et
- // a chaque element du profil (key2) un vertex (item).
- // MapBis : ensemble des edges ou vertex (item) generes par
- // une bisectrice sur une face ou un edge (key)des
- // tuyaux ou revol.
- // MapVerPar : Map des parametres des vertex sur les edges paralleles
- // la liste contenue dans MapVerPar (E) correspond aux
- // parametres sur E des vertex contenu dans MapBis(E);
+ // MapNodeVertex : associate to each node of the map (key1) and to
+ // each element of the profile (key2) a vertex (item).
+ // MapBis : all edges or vertices (item) generated by
+ // a bisectrice on a face or an edge (key) of revolution tubes.
+ // MapVerPar : Map of parameters of vertices on parallel edges
+ // the list contained in MapVerPar (E) corresponds to
+ // parameters on E of vertices contained in MapBis(E);
//---------------------------------------------------------------------
(RefPlane->Translated( ALT * gp_Vec(RefPlane->Axis().Direction() )));
//---------------------------------------------------------------
- // Construction des Cercles et des OffsetCurves
+ // Construction of Circles and OffsetCurves
//---------------------------------------------------------------
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
#ifdef DEB
if (AffichEdge) {
- cout << " Fin Construction des primitives geometriques"<<endl;
+ cout << " End Construction of geometric primitives "<<endl;
}
#endif
//---------------------------------------------------
- // Constructions des vertex de l offset.
+ // Construction of offset vertices.
//---------------------------------------------------
BRepFill_DataMapOfOrientedShapeListOfShape Detromp;
Handle(MAT_Arc) CurrentArc;
}
#endif
- //-----------------------------------------------------------------------
- // Recuperation des elements du spine correspondant aux basicElts separes.
- //-----------------------------------------------------------------------
+ //-------------------------------------------------------------------
+ // Return elements of the spine corresponding to separate basicElts.
+ //-------------------------------------------------------------------
S [0] = Link.GeneratingShape(CurrentArc->FirstElement());
S [1] = Link.GeneratingShape(CurrentArc->SecondElement());
BRepFill_DataMapOfShapeSequenceOfPnt MapSeqPar;
//-----------------------------------------------------------
- // Recuperation des edges paralleles sur chaque face.
- // Si pas d offset generees => saut a la bissectrice suivante.
+ // Return parallel edges on each face.
+ // If no offset generated => move to the next bissectrice.
//--------------------------------------------------------------
if (myMap.Contains(S[0]) && myMap.Contains(S[1])) {
E [0] = TopoDS::Edge(myMap.FindFromKey(S[0]).First());
else continue;
//-----------------------------------------------------------
- // Construction des vertex correspondant au noeud de la carte.
- // si ils sont sur l offset.
+ // Construction of vertices corresponding to the node of the map.
+ // if they are on the offset.
//-----------------------------------------------------------
TopoDS_Vertex VS,VE;
Handle(MAT_Node) Node1, Node2;
}
//---------------------------------------------
- // Construction des geometries.
+ // Construction of geometries.
//---------------------------------------------
BRepFill_TrimEdgeTool Trim (Bisec,
Locus.GeomElt(CurrentArc->FirstElement()),
myOffset);
//-----------------------------------------------------------
- // Construction des vertex sur les edges paralleles au spine.
+ // Construction of vertices on edges parallel to the spine.
//-----------------------------------------------------------
Trim.IntersectWith(E [0], E [1], Params);
Vertices.SetValue(1,VS);
else
- // le point n avait pas ete trouve par IntersectWith
+ // the point was not found by IntersectWith
Vertices.Prepend(VS);
}
if (EndOnEdge) {
Vertices.SetValue(Params.Length(),VE);
else
- // le point n avait pas ete trouve par IntersectWith
+ // the point was not found by IntersectWith
Vertices.Append(VE);
}
//------------------------------------------------------------
- // Mise a jour Detromp.
- // Detromp permetra de supprimer les vertex sur l offset
- // correspondant a des zones de tangences
- // dans Detromp sont ranges les vertex qui limitent
- // les portions de la bissectrices situes entre le spine et
- // l offset.
+ // Update Detromp.
+ // Detromp allows to remove vertices on the offset
+ // corresponding to tangency zones
+ // Detromp ranks the vertices that limit
+ // the parts of the bissectrices located between the spine and the
+ // offset.
//------------------------------------------------------------
if (!Detromp.IsBound(S[0])) Detromp.Bind(S[0],EmptyList);
if (!Detromp.IsBound(S[1])) Detromp.Bind(S[1],EmptyList);
UpdateDetromp (Detromp(S[0]), Detromp(S[1]), Vertices, Params,
Bisec, StartOnEdge, EndOnEdge, Trim);
//----------------------------------------------
- // Stockage des vertex sur les edges paralleles.
- // on remplit MapBis et MapVerPar.
+ // Storage of vertices on parallel edges.
+ // fill MapBis and MapVerPar.
//----------------------------------------------
if (!Vertices.IsEmpty()) {
for (k = 0; k <= 1; k++) {
}
else {
//------------------------------------------------------------
- //POUR LES CERCLES COMPLETS . la parallele peut etre contenue
- // dans la zone sans intersection avec la frontiere
- // pas d intersection
- // si myoffset est < distance des noeuds la parallele peut etre
- // valide.
+ // FOR COMPLETE CIRCLES. the parallel line can be contained
+ // in the zone without intersection with the border
+ // no intersection
+ // if myoffset is < distance of nodes the parallel can be valid.
//-------------------------------------------------------------
for (k = 0; k <= 1; k++) {
if (!MapBis.IsBound(E[k])) {
#ifdef DEB
if (AffichEdge) {
- cout << " Fin Construction des vertex sur les offsets"<<endl;
+ cout << " End Construction of vertices on offsets"<<endl;
}
#endif
//----------------------------------
- // Construction des edges paralleles.
+ // Construction of parallel edges.
//----------------------------------
TopTools_IndexedDataMapOfShapeShape MapVV;
}
else {
//-----------------
- // Cercles complets
+ // Complete circles
//-----------------
myMap(j).Append(CurrentEdge);
}
}
//----------------------------------
- // Constructions des wires offset.
+ // Construction of offset wires.
//----------------------------------
MakeWires ();
- // Mise a jour des vertex ( Construits dans le plan Z = 0) !!!
+ // Update vertices ( Constructed in the plane Z = 0) !!!
TopTools_MapOfShape MapVertex;
for ( TopExp_Explorer exp(myShape,TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
}
}
- // Constructions des courbes 3d.
+ // Construction of curves 3d.
BRepLib::BuildCurves3d(myShape);
MapVertex.Clear();
TopExp_Explorer Explo( myShape, TopAbs_EDGE );
myMapSpine.Bind(V2,V2);
Cuts.Clear();
- // Decoupe
+ // Cut
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
if (nbEdges == 2 && nbResEdges == 0)
void BRepFill_OffsetWire::MakeWires()
{
//--------------------------------------------------------
- // creation d une liste unique des edges paralelles crees.
+ // creation of a single list of created parallel edges.
//--------------------------------------------------------
TopTools_SequenceOfShape TheEdges;
TopTools_ListOfShape TheWires;
}
//--------------------------------------
- // Creation des wires paralleles.
+ // Creation of parallel wires.
//--------------------------------------
BRep_Builder B;
while(!End) {
//-------------------------------
- // Construction d un wire.
+ // Construction of a wire.
//-------------------------------
TopExp::Vertices(CE,V1,V2);
if (!CV.IsSame(V1)) CV = V1; else CV = V2;
if (!End) {
if (MVE.FindFromKey(CV).Extent() > 2) {
- //cout <<"vertex sur plus de 2 edges dans une face."<<endl;
+ //cout <<"vertex on more that 2 edges in a face."<<endl;
}
for ( itl.Initialize(MVE.FindFromKey(CV)); itl.More(); itl.Next()) {
if (itl.Value().IsSame(CE)) {
TheWires.Append(NW);
}
- // mise a jour de myShape :
- // -- si un seul wire : myShape est un Wire
- // -- si plusieurs wires : myShape est un Compound.
+ // update myShape :
+ // -- if only one wire : myShape is a Wire
+ // -- if several wires : myShape is a Compound.
if ( TheWires.Extent() == 1) {
myShape = TheWires.First();
}
//=======================================================================
//function : CutEdge
-//purpose : Decoupe d une edge aux extrema de courbures et aux points
-// d inflexion.
-// Les cercles fermes sont aussi decoupes en deux.
-// Si <Cuts> est vide l edge n est pas modifie.
-// Le premier et le dernier vertex de l edge originale
-// appartiennent respectivement a la premiere et derniere
-// portions.
+//purpose : Cut edge at the extrema of curvatures and points of inflexion.
+// So, closed circles are cut in two.
+// If <Cuts> is empty, the edge is not modified.
+// The first and the last vertex of the initial edge
+// belong to the first and the last parts respectively.
//=======================================================================
Standard_Integer CutEdge (const TopoDS_Edge& E,
const TopoDS_Face& F,
( Abs(f-l) >= PI) ) {
return 0;
//---------------------------
- // Decoupe cercle ferme.
+ // Cut closed circle.
//---------------------------
Standard_Real m = (f + l)*0.5;
// Modified by Sergey KHROMOV - Wed Mar 6 17:37:28 2002 Begin
Cuts.Append(FE.Oriented(E.Orientation()));
Cuts.Append(LE.Oriented(E.Orientation()));
//--------
- // Retour.
+ // Return.
//--------
return 2;
}
//-------------------------
- // Decoupe de la courbe.
+ // Cut curve.
//-------------------------
Cuter.Perform(CT2d);
if (ForceCut == 0) {
if (Cuter.UnModified()) {
//-----------------------------
- // edge non modifiee => retour.
+ // edge not modified => return.
//-----------------------------
return 0;
} else {
// Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End
//--------------------------------------
- // Creation des edges decoupees.
+ // Creation of cut edges.
//--------------------------------------
VF = V1;
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
const Handle(Geom_Plane)& RefPlane)
{
- // eval the Axis of the Circle.
+ // evaluate the Axis of the Circle.
Standard_Real f,l;
Handle(Geom2d_Curve) GC = BRep_Tool::CurveOnSurface(E,F,f,l);
gp_Vec2d DX;
Geom2dAdaptor_Curve AC(G2d,f,l);
if ( AC.GetType() == GeomAbs_Circle) {
- // si l offset est superieur ou egal au rayon et du cote de la
- // concavite du cercle => edge null.
+ // if the offset is greater otr equal to the radius and the side of the
+ // concavity of the circle => edge null.
gp_Circ2d C1(AC.Circle());
#ifdef DEB
Standard_Real radius =
Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.;
if (anOffset*Signe < AC.Circle().Radius()) {
- // -anOffset vient d une Etrangete adaptoresque!
+
Handle(Geom2dAdaptor_HCurve) AHC =
new Geom2dAdaptor_HCurve(G2d);
Adaptor3d_OffsetCurve Off(AHC,-anOffset);
//=======================================================================
//function : UpdateDetromp
-//purpose : Pour chaque interval sur la bissectrice defini par params
-// test si le point milieu est a une distance > offset
-// dans ce cas les vertex correspondants aux extremites de l interval
-// sont ranges dans le detrompeur.
-// => Si un meme vertex apparait deux fois dans le detrompeur la
-// frontiere de la zone de proximitee est tangente a l offset .
+//purpose : For each interval on bissectrice defined by parameters
+// test if the medium point is at a distance > offset
+// in this case vertices corresponding to the extremities of the interval
+// are ranked in the proofing.
+// => If the same vertex appears in the proofing, the
+// border of the zone of proximity is tangent to the offset .
//=======================================================================
void UpdateDetromp (TopTools_ListOfShape& Detromp1,
U1 = Bis->FirstParameter();
if (SOnE) {
- // le premier point de la bissectrice est sur l offset
+ // the first point of the bissectrice is on the offset
V1 = TopoDS::Vertex(Vertices.Value(ii));
ii++;
}
ii ++;
}
- // test point milieu entre le dernier params et la fin de la bissectrice.
+ // test medium point between the last parameter and the end of the bissectrice.
U2 = Bis->LastParameter();
if (!EOnE) {
if (!Precision::IsInfinite(U2)) {
if (!aNode->Infinite() && Abs(aNode->Distance()-Offset) < Tol) {
//------------------------------------------------
- // le Noeud donne un vertex sur l offset
+ // the Node gives a vertex on the offset
//------------------------------------------------
if (MapNodeVertex.IsBound(aNode)) {
VN = TopoDS::Vertex(MapNodeVertex(aNode));
S.Clear();
//-----------------------------------------------------------
- // Tri des deux sequences en fonction du parametre sur l edge.
+ // Parse two sequences depending on the parameter on the edge.
//-----------------------------------------------------------
while (Change) {
Change = Standard_False;
}
//----------------------------------------------------------
- // Si un vertex n est pas dans le detrompeur il est elimine.
+ // If a vertex is not in the proofing, it is eliminated.
//----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) {
for (Standard_Integer k = 1; k <= TheVer.Length(); k ++) {
}
//----------------------------------------------------------
- // Si un vertex_double apparait deux fois dans le detrompeur
- // le vertex est elimine .
- // sinon on garde une seule de ces representations.
+ // If a vertex_double appears twice in the proofing
+ // the vertex is removed.
+ // otherwise preserve only one of its representations.
//----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) {
for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
}
}
//-----------------------------------------------------------
- // Creation des edges.
- // le nombre de vertex doit etre pair les edges a creer vont
- // d un vertex d indice impair i au vertex i+1;
+ // Creation of edges.
+ // the number of vertices should be even. The created edges
+ // go from a vertex with uneven index i to vertex i+1;
//-----------------------------------------------------------
for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) {
TopoDS_Shape aLocalShape = E.EmptyCopied();
//=======================================================================
//function : DoubleOrNotInside
-//purpose : return True si V apparait 2 fois dans LV ou n est pas dedans.
+//purpose : return True if V appears twice in LV or is not inside.
//=======================================================================
Standard_Boolean DoubleOrNotInside (const TopTools_ListOfShape& LV,
Standard_Real theFleche=0;
Standard_Boolean flecheok = Standard_False;
if (Norme > Eps) {
- // Evaluation de la fleche par interpolation . Voir IntWalk_IWalking_5.gxx
+ // Evaluation of the arrow by interpolation. See IntWalk_IWalking_5.gxx
Standard_Real N1 = Vdeb.SquareMagnitude();
Standard_Real N2 = Vdelta.SquareMagnitude();
if (N1 > Eps && N2 > Eps) {