//=======================================================================
//function : PerformPlan
-//purpose : Construit s'il existe un plan de remplissage
+//purpose : Construct a plane of filling if exists
//=======================================================================
static Standard_Boolean PerformPlan(const TopoDS_Wire& W,
if (!B)
{
- // Il faut boucher les extremites
+ // It is necessary to close the extremities
B = PerformPlan(wire1, presPln, face1);
if (B) {
B = PerformPlan(wire2, presPln, face2);
// compute origin and orientation on wires to avoid twisted results
// and update wires to have same number of edges
- // on utilise BRepFill_CompatibleWires
+ // use BRepFill_CompatibleWires
TopTools_SequenceOfShape WorkingSections;
WorkingSections.Clear();
TopTools_DataMapOfShapeListOfShape WorkingMap;
WorkingMap.Clear();
- // Calcul des sections de travail
+ // Calculate the working sections
BRepFill_CompatibleWires Georges(myWires);
Georges.Perform();
if (Georges.IsDone()) {
myWires = WorkingSections;
}
- // Calcul de la shape resultat
+ // Calculate the resulting shape
if (myWires.Length() == 2 || myIsRuled) {
// create a ruled shell
CreateRuled();
if (myIsSolid) {
- // on regarde si le premier wire est identique au dernier
+ // check if the first wire is the same as the last
Standard_Boolean vClosed = (myWires(1).IsSame(myWires(nbSects))) ;
if (vClosed) {
B.MakeSolid(solid);
B.Add(solid, shell);
- // verify the orientation the solid
+ // verify the orientation of the solid
BRepClass3d_SolidClassifier clas3d(solid);
clas3d.PerformInfinitePoint(Precision::Confusion());
if (clas3d.State() == TopAbs_IN) {
BRepTools_WireExplorer anExp;
Standard_Boolean w1Point = Standard_True;
- // on regarde si le premier wire est ponctuel
+ // check if the first wire is punctual
for(anExp.Init(TopoDS::Wire(myWires(1))); anExp.More(); anExp.Next()) {
w1Point = w1Point && (BRep_Tool::Degenerated(anExp.Current()));
}
Standard_Boolean w2Point = Standard_True;
- // on regarde si le dernier wire est ponctuel
+ // check if the last wire is punctual
for(anExp.Init(TopoDS::Wire(myWires(nbSects))); anExp.More(); anExp.Next()) {
w2Point = w2Point && (BRep_Tool::Degenerated(anExp.Current()));
}
Standard_Boolean vClosed = Standard_False;
- // on regarde si le premier wire est identique au dernier
+ // check if the first wire is the same as last
if (myWires(1).IsSame(myWires(myWires.Length()))) vClosed = Standard_True;
// find the dimension
for (i=1; i<=nbSects; i++) {
const TopoDS_Wire& wire = TopoDS::Wire(myWires(i));
if (!wire.Closed()) {
- // on regarde quand meme si les vertex sont les memes.
+ // check if the vertices are the same
TopoDS_Vertex V1, V2;
TopExp::Vertices(wire,V1,V2);
if ( !V1.IsSame(V2)) uClosed = Standard_False;
}
if ( (i==1 && w1Point) || (i==nbSects && w2Point) ) {
- // si le wire est ponctuel
+ // if the wire is punctual
anExp.Init(TopoDS::Wire(wire));
for(j=1; j<=nbEdges; j++) {
nb++;
}
}
else {
- // sinon
+ // otherwise
for(anExp.Init(TopoDS::Wire(wire)); anExp.More(); anExp.Next()) {
nb++;
shapes(nb) = anExp.Current();
Standard_Integer nbPnts = 21;
TColgp_Array2OfPnt points(1, nbPnts, 1, nbSects);
- // on concatene chaque section pour obtenir une surface totale que
- // l'on va segmenter
+ // concatenate each section to get a total surface that will be segmented
Handle(Geom_BSplineSurface) TS;
TS = TotalSurf(shapes,nbSects,nbEdges,w1Point,w2Point,vClosed);
TopoDS_Shape firstEdge;
for (i=1; i<=nbEdges; i++) {
- // segmentation de TS
+ // segmentation of TS
Handle(Geom_BSplineSurface) surface;
surface = Handle(Geom_BSplineSurface)::DownCast(TS->Copy());
Standard_Real Ui1,Ui2,V0,V1;
V1 = surface->VKnot(surface->LastVKnotIndex());
surface->Segment(Ui1,Ui2,V0,V1);
- // recuperation des vertices
+ // return vertices
edge = TopoDS::Edge(shapes(i));
TopExp::Vertices(edge,v1f,v1l);
if (edge.Orientation() == TopAbs_REVERSED)
// --- edge 1
if ( w1Point ) {
- // copie de l'edge degeneree
+ // copy the degenerated edge
TopoDS_Shape aLocalShape = shapes(1).EmptyCopied();
edge1 = TopoDS::Edge(aLocalShape);
// edge1 = TopoDS::Edge(shapes(1).EmptyCopied());
v1l.Orientation(TopAbs_REVERSED);
B.Add(edge1, v1l);
B.Range(edge1, f1, l1);
- // traitement des sections bouclantes
- // on stocke les edges de la 1ere section
+ // processing of looping sections
+ // store edges of the 1st section
if (vClosed)
vcouture(i) = edge1;
edge2 = TopoDS::Edge(vcouture(i));
else {
if ( w2Point ) {
- // copie de l'edge degeneree
+ // copy of the degenerated edge
TopoDS_Shape aLocalShape = shapes(nbSects*nbEdges).EmptyCopied();
edge2 = TopoDS::Edge(aLocalShape);
// edge2 = TopoDS::Edge(shapes(nbSects*nbEdges).EmptyCopied());
for (j=jdeb; j<=jfin; j++) {
- // cas des sections bouclantes
+ // case of looping sections
if (j==jfin && vClosed) {
section.AddCurve(BS1);
}
// read the first edge to initialise CompBS;
edge = TopoDS::Edge(shapes((j-1)*NbEdges+1));
if (BRep_Tool::Degenerated(edge)) {
- // edge degeneree : construction d'une courbe ponctuelle
+ // degenerated edge : construction of a punctual curve
TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf);
curv->LastParameter());
}
else {
- // recuperation de la courbe sur l'edge
+ // recover the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation());
curvTrim->Reverse();
}
- // transformation en BSpline reparametree sur [i-1,i]
+ // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
BSplCLib::Reparametrize(0.,1.,BSK);
curvBS->SetKnots(BSK);
- // initialisation
+ // initialization
GeomConvert_CompCurveToBSplineCurve CompBS(curvBS);
for (i=2; i<=NbEdges; i++) {
// read the edge
edge = TopoDS::Edge(shapes((j-1)*NbEdges+i));
if (BRep_Tool::Degenerated(edge)) {
- // edge degeneree : construction d'une courbe ponctuelle
+ // degenerated edge : construction of a punctual curve
TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf);
curv->LastParameter());
}
else {
- // recuperation de la courbe sur l'edge
+ // return the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation());
curvTrim->Reverse();
}
- // transformation en BSpline reparametree sur [i-1,i]
+ // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
1);
}
- // recuperation de la section finale
+ // return the final section
BS = CompBS.BSplineCurve();
section.AddCurve(BS);
- // cas des sections bouclantes
+ // case of looping sections
if (j==jdeb && vClosed) {
BS1 = BS;
}
//=======================================================================
//function : CriteriumWeight
-//purpose : returns the Weights associed to the criterium used in
+//purpose : returns the Weights associated to the criterium used in
// the optimization.
//=======================================================================
//