1 // File: BRepFill_Generator.cxx
2 // Created: Mon Mar 7 10:01:42 1994
3 // Author: Bruno DUMORTIER
5 // Modified: Mon Feb 23 09:28:46 1998
6 // Author: Joelle CHAUVET
8 // traitement des wires ponctuels
9 // Modified: Tue Mar 10 17:08:58 1998
10 // Author: Joelle CHAUVET
12 // suite traitement des KPart, calcul d'une BezierCurve
13 // au lieu d'une extraction d'iso pour Edge3 et Edge4
14 // Modified: Mon Apr 6 15:47:44 1998
15 // Author: Joelle CHAUVET
17 // correction KPart (PRO12929)
18 // Modified: Thu Apr 30 15:24:17 1998
19 // Author: Joelle CHAUVET
22 // Modified: Fri Jul 31 15:14:19 1998
23 // Author: Joelle CHAUVET
25 // KPart semi-cone pointe en bas : calcul de Edge4
27 // ajout des methodes Generated et GeneratedShapes
28 // Modified: Mon Nov 23 12:22:04 1998
29 // Author: Joelle CHAUVET
31 // CTS21701 : orientation de l'edge dans DetectKPart
33 #include <BRepFill_Generator.ixx>
35 #include <TopoDS_Face.hxx>
36 #include <TopoDS_Wire.hxx>
37 #include <TopoDS_Edge.hxx>
38 #include <TopoDS_Vertex.hxx>
39 #include <BRep_Builder.hxx>
40 #include <TopLoc_Location.hxx>
41 #include <TopExp_Explorer.hxx>
42 #include <gp_Pnt2d.hxx>
43 #include <gp_Dir2d.hxx>
46 #include <gp_Circ.hxx>
48 #include <GeomAbs_Shape.hxx>
49 #include <GeomAdaptor_Curve.hxx>
50 #include <Geom_Circle.hxx>
51 #include <Geom_Line.hxx>
52 #include <Geom_Curve.hxx>
53 #include <Geom_BezierCurve.hxx>
54 #include <Geom_TrimmedCurve.hxx>
55 #include <Geom_Surface.hxx>
56 #include <Geom_Plane.hxx>
57 #include <Geom_CylindricalSurface.hxx>
58 #include <Geom_ConicalSurface.hxx>
59 #include <Geom_RectangularTrimmedSurface.hxx>
60 #include <Geom2d_Line.hxx>
61 #include <Geom2d_BezierCurve.hxx>
62 #include <GeomFill_Generator.hxx>
64 #include <TopTools_DataMapOfShapeShape.hxx>
65 #include <GeomFill.hxx>
66 #include <BRep_Tool.hxx>
69 #include <Precision.hxx>
70 #include <BRepLib.hxx>
72 #include <TColgp_Array1OfPnt.hxx>
73 #include <TColgp_Array1OfPnt2d.hxx>
74 #include <Geom_BSplineCurve.hxx>
76 #include <GeomConvert.hxx>
78 #include <BRepTools_WireExplorer.hxx>
79 #include <BRepTools.hxx>
83 //=======================================================================
84 //function : DetectKPart
86 //=======================================================================
88 Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
89 const TopoDS_Edge& Edge2)
92 Standard_Integer IType = 0;
94 // caracteristiques de la premiere edge
95 Standard_Real first1, last1, first2, last2, ff, ll;
98 Handle(Geom_Curve) curv1, curv;
99 GeomAdaptor_Curve AdC1;
100 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
102 // recherche de cas particulier
106 Standard_Real dist1 =0.;
114 TopExp::Vertices(Edge1,V1,V2);
115 pos1 = BRep_Tool::Pnt(V1);
118 curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
120 Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
123 if (Edge1.Orientation() == TopAbs_REVERSED) {
125 first1 = curv1->ReversedParameter(ll);
126 last1 = curv1->ReversedParameter(ff);
129 if (AdC1.GetType() == GeomAbs_Circle) {
130 // premiere section circulaire
132 pos1 = AdC1.Circle().Location();
133 dist1 = AdC1.Circle().Radius();
134 axe1 = AdC1.Circle().Axis();
136 else if (AdC1.GetType() == GeomAbs_Line) {
137 // premiere section rectiligne
139 pos1 = AdC1.Line().Location();
140 dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
141 gp_Vec vec(AdC1.Value(first1),AdC1.Value(last1));
143 axe1 = gp_Ax1(AdC1.Value(first1),dir);
146 // premiere section quelconque
153 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
155 TopExp::Vertices(Edge2,V1,V2);
156 pos = BRep_Tool::Pnt(V1);
158 // seul cas particulier avec une edge degeneree en bout : le cone
159 if (pos.IsEqual(pos1,Precision::Confusion())) {
160 // le sommet est confondu avec le centre du cercle
164 gp_Vec vec(pos1,pos);
166 axe = gp_Ax1(pos1,dir);
167 if (axe.IsParallel(axe1,Precision::Angular())) {
168 // le sommet est bien sur l'axe du cercle
172 // sommet incorrect --> pas de cas particulier
177 else if (IType != 4) { //not plane
178 // pas de cas particulier
183 curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
185 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
188 if (Edge2.Orientation() == TopAbs_REVERSED) {
190 first2 = curv->ReversedParameter(ll);
191 last2 = curv->ReversedParameter(ff);
193 GeomAdaptor_Curve AdC(curv);
195 if (IType>0 && IType<4) {
196 if (AdC.GetType() != GeomAbs_Circle) {
197 // section non circulaire --> pas de cas particulier
201 if (AdC.Circle().Axis()
202 .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
204 if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
205 // possibilite de cylindre ou de morceau de cylindre
206 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
207 Standard_Boolean Same,
208 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
209 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
214 Same = SameParametricLength
215 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
217 // cylindre ou morceau de cylindre
221 // l'intervalle de definition n'est pas correct
226 // possibilite de tronc de cone
227 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
228 Standard_Boolean Same,
229 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
230 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
235 Same = SameParametricLength
236 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
242 // l'intervalle de definition n'est pas correct
246 if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
247 // les centres sont confondus
253 if (AdC.Circle().Radius()==dist1) {
258 // rayon different --> pas de cas particulier
265 if (AdC.GetType() != GeomAbs_Line) {
266 // section non rectiligne --> pas de cas particulier
270 pos = AdC.Line().Location();
271 dist = AdC.Value(first2).Distance(AdC.Value(last2));
272 gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
274 axe = gp_Ax1(AdC.Value(first2),dir);
275 if (axe.IsParallel(axe1,Precision::Angular())) {
277 if (Abs(dist-dist1)<Precision::Confusion()) {
278 gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
279 if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
289 // longueur differente --> pas de cas particulier
294 // droite non parallele --> pas de cas particulier
299 else if (IType==-2) {
300 if (AdC.GetType() == GeomAbs_Line)
302 else if (AdC.GetType() == GeomAbs_Circle)
304 // seul cas particulier avec une edge degeneree au debut : le cone
305 pos = AdC.Circle().Location();
306 axe = AdC.Circle().Axis();
307 if (pos1.IsEqual(pos,Precision::Confusion())) {
308 // le sommet est confondu avec le centre du cercle
312 gp_Vec vec(pos1,pos);
314 axe1 = gp_Ax1(pos1,dir);
315 if (axe.IsParallel(axe1,Precision::Angular())) {
316 // le sommet est bien sur l'axe du cercle
320 // sommet incorrect --> pas de cas particulier
331 // tore et extrusion ne sont pas des cas part.
332 if (IType == 3 || IType == 5) IType = 0;
337 //=======================================================================
338 //function : CreateKPart
340 //=======================================================================
342 void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
343 const Standard_Integer IType,
344 Handle(Geom_Surface)& Surf)
346 // find the dimension
347 TopoDS_Vertex V1, V2;
350 Standard_Real a1, b1, aa =0., bb =0.;
351 TopoDS_Vertex v1f,v1l,v2f,v2l;
353 // find characteristics of the first edge
354 Handle(Geom_Curve) C1;
355 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
357 // cone avec arete degeneree au sommet
358 TopExp::Vertices(Edge1,v1f,v1l);
361 C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
362 C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
365 if (Edge1.Orientation() == TopAbs_REVERSED) {
367 aa = C1->ReversedParameter(b1);
368 bb = C1->ReversedParameter(a1);
369 TopExp::Vertices(Edge1,v1l,v1f);
372 TopExp::Vertices(Edge1,v1f,v1l);
376 // find characteristics of the second edge
377 Handle(Geom_Curve) C2;
378 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
380 // cone avec arete degeneree au sommet
381 TopExp::Vertices(Edge2,v2f,v2l);
384 C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
385 C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
386 if (Edge2.Orientation() == TopAbs_REVERSED) {
392 TopExp::Vertices(Edge2,v2l,v2f);
396 aa = a1; //C2->ReversedParameter(b1);
397 bb = b1; //C2->ReversedParameter(a1);
399 TopExp::Vertices(Edge2,v2f,v2l);
403 // create the new surface
407 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
412 TopoDS_Wire newW1, newW2;
413 BRep_Builder BW1, BW2;
418 // calculate the surface
419 Handle(Geom_Surface) surface;
420 Standard_Real V, Rad;
422 // surface cylindrique
423 gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
424 gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
425 gp_Ax3 Ac1 = c1.Position();
426 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
431 Handle(Geom_CylindricalSurface) Cyl =
432 new Geom_CylindricalSurface( Ac1, c1.Radius());
433 surface = new Geom_RectangularTrimmedSurface
434 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
438 gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
439 gp_Ax3 Ak1 = k1.Position();
441 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
442 .Dot(gp_Vec(Ak1.Direction()));
446 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
447 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
448 Rad = k2.Radius() - k1.Radius();
455 Standard_Real Ang = ATan( Rad / V);
456 Handle(Geom_ConicalSurface) Cone =
457 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
459 surface = new Geom_RectangularTrimmedSurface
460 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
462 else if (IType==-2) {
463 // surface conique avec le sommet au debut (degen1 est vrai)
464 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
465 gp_Ax3 Ak2 = k2.Position();
466 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
467 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
468 .Dot(gp_Vec(Ak2.Direction()));
469 Rad = k2.Radius(); // - k2.Radius();
474 Standard_Real Ang = ATan( Rad / V);
475 Handle(Geom_ConicalSurface) Cone =
476 new Geom_ConicalSurface( Ak2, Ang, 0.);
478 surface = new Geom_RectangularTrimmedSurface
479 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
486 gp_Lin L1, L2, aLine;
489 L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
494 L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
498 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
499 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
501 gp_Vec P1P2( P1, P2 );
502 gp_Dir D1 = aLine.Direction();
503 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
504 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
505 V = P1P2.Dot( Ax.YDirection());
507 //surface = new Geom_RectangularTrimmedSurface
508 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
511 // surface d'extrusion ?
520 //=======================================================================
521 //function : BRepFill_Generator
523 //=======================================================================
525 BRepFill_Generator::BRepFill_Generator()
530 //=======================================================================
533 //=======================================================================
535 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
537 myWires.Append( Wire);
541 //=======================================================================
544 //=======================================================================
546 void BRepFill_Generator::Perform()
551 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
554 B.MakeShell(myShell);
556 Standard_Integer Nb = myWires.Length();
558 BRepTools_WireExplorer ex1,ex2;
560 Standard_Boolean wPoint1, wPoint2, uClosed, DegenFirst, DegenLast;
562 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
564 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
565 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
567 wPoint1 = Standard_False;
569 wPoint1 = Standard_True;
570 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
571 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
573 DegenFirst = wPoint1;
575 TopoDS_Vertex V1, V2;
576 TopExp::Vertices(Wire1, V1, V2);
577 uClosed = V1.IsSame(V2);
580 wPoint2 = Standard_False;
582 wPoint2 = Standard_True;
583 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
584 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
592 TopTools_DataMapOfShapeShape Map;
594 Standard_Boolean tantque = ex1.More() && ex2.More();
598 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
600 Standard_Boolean degen1
601 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
602 Standard_Boolean degen2
603 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
606 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
607 Edge1 = TopoDS::Edge(aLocalShape);
608 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
609 // aLocalShape = ex1.Current();
610 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
611 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
612 V1f.Orientation(TopAbs_FORWARD);
614 V1l.Orientation(TopAbs_REVERSED);
619 TopoDS_Shape aLocalShape = ex1.Current();
620 Edge1 = TopoDS::Edge(aLocalShape);
621 // Edge1 = TopoDS::Edge(ex1.Current());
625 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
626 Edge2 = TopoDS::Edge(aLocalShape);
627 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
628 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
629 V2f.Orientation(TopAbs_FORWARD);
631 V2l.Orientation(TopAbs_REVERSED);
636 Edge2 = TopoDS::Edge(ex2.Current());
639 Standard_Boolean Periodic
640 = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
641 // ATTENTION : un wire non ponctuel ne doit pas
642 // contenir une edge ponctuelle
643 if (!wPoint1) ex1.Next();
644 if (!wPoint2) ex2.Next();
646 // initialisation des vertices
647 Handle(Geom_Surface) Surf;
648 Standard_Real f1=0, l1=1, f2=0, l2=1;
649 if (Edge1.Orientation() == TopAbs_REVERSED)
650 TopExp::Vertices(Edge1,V1l,V1f);
652 TopExp::Vertices(Edge1,V1f,V1l);
653 if (Edge2.Orientation() == TopAbs_REVERSED)
654 TopExp::Vertices(Edge2,V2l,V2f);
656 TopExp::Vertices(Edge2,V2f,V2l);
669 Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
670 Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
672 = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
674 // traitement des KPart
675 Standard_Integer IType = DetectKPart(Edge1,Edge2);
678 TopLoc_Location L,L1,L2;
680 Handle(Geom_Curve) C1, C2;
681 TColgp_Array1OfPnt Extremities(1,2);
684 Extremities(1) = BRep_Tool::Pnt(V1f);
685 Extremities(2) = BRep_Tool::Pnt(V1l);
686 C1 = new Geom_BezierCurve(Extremities);
689 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
692 Extremities(1) = BRep_Tool::Pnt(V2l);
693 Extremities(2) = BRep_Tool::Pnt(V2f);
694 C2 = new Geom_BezierCurve(Extremities);
697 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
700 // compute the location
701 Standard_Boolean SameLoc = Standard_False;
703 // transform and trim the curves
705 if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
706 Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
707 C1 = new Geom_TrimmedCurve(C1,f1,l1);
710 C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
712 if (!SameLoc) C1->Transform(L1.Transformation());
713 if (Edge1.Orientation() == TopAbs_REVERSED) {
717 if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
718 Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
719 C2 = new Geom_TrimmedCurve(C2,f2,l2);
722 C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
724 if (!SameLoc) C2->Transform(L2.Transformation());
725 if (Edge2.Orientation() == TopAbs_REVERSED) {
729 GeomFill_Generator Generator;
730 Generator.AddCurve( C1);
731 Generator.AddCurve( C2);
732 Generator.Perform( Precision::PConfusion());
734 Surf = Generator.Surface();
735 B.MakeFace(Face,Surf,Precision::Confusion());
739 CreateKPart(Edge1,Edge2,IType,Surf);
740 B.MakeFace(Face,Surf,Precision::Confusion());
743 // make the missing edges
744 Standard_Real first,last;
745 Surf->Bounds(f1,l1,f2,l2);
747 if ( Map.IsBound(Vf_toMap)) {
748 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
749 Edge3 = TopoDS::Edge(aLocalShape);
750 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
753 Handle(Geom_Curve) CC;
754 TColgp_Array1OfPnt Extremities(1,2);
756 // cas general : Edge3 correspond a l'iso U=f1
762 // cas particulier : il faut calculer la courbe 3d
763 Extremities(1) = BRep_Tool::Pnt(V1f);
764 Extremities(2) = BRep_Tool::Pnt(V2f);
765 CC = new Geom_BezierCurve(Extremities);
769 B.MakeEdge(Edge3,CC,Precision::Confusion());
770 V1f.Orientation(TopAbs_FORWARD);
772 V2f.Orientation(TopAbs_REVERSED);
774 B.Range(Edge3,first,last);
776 Map.Bind(Vf_toMap, Edge3);
779 Standard_Boolean CommonEdge = Standard_False;
780 if ( Map.IsBound(Vl_toMap) ) {
781 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
782 const TopoDS_Edge CommonE = TopoDS::Edge(aLocalShape);
783 // const TopoDS_Edge CommonE = TopoDS::Edge(Map(V1l).Reversed());
784 TopoDS_Vertex V1, V2;
785 TopExp::Vertices(CommonE,V1,V2);
786 CommonEdge = V1.IsSame(V1l) && V2.IsSame(V2l);
789 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
790 Edge4 = TopoDS::Edge(aLocalShape);
791 // Edge4 = TopoDS::Edge(Map(V1l).Reversed());
794 Handle(Geom_Curve) CC;
795 TColgp_Array1OfPnt Extremities(1,2);
797 // cas general : Edge4 correspond a l'iso U=l1
803 // cas particulier : il faut calculer la courbe 3d
804 Extremities(1) = BRep_Tool::Pnt(V1l);
805 Extremities(2) = BRep_Tool::Pnt(V2l);
806 CC = new Geom_BezierCurve(Extremities);
810 B.MakeEdge(Edge4,CC,Precision::Confusion());
811 V1l.Orientation(TopAbs_FORWARD);
813 V2l.Orientation(TopAbs_REVERSED);
815 B.Range(Edge4,first,last);
816 Map.Bind(Vl_toMap, Edge4);
824 if (! (degen1 && IType == 4))
827 if (! (degen2 && IType == 4))
828 B.Add(W,Edge2.Reversed());
835 // complete myMap for edge1
836 if (! (degen1 && IType == 4))
838 TopTools_ListOfShape Empty;
839 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
840 myMap(Edge1).Append(Face);
845 Standard_Real T = Precision::Confusion();
847 if (IType != 4) //not plane
849 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
851 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
853 B.Range(Edge1,Face,-l1,-f1);
857 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
859 B.Range(Edge1,Face,f1,l1);
862 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
864 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
866 B.Range(Edge2,Face,-l1,-f1);
870 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
872 B.Range(Edge2,Face,f1,l1);
879 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
880 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
885 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
888 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
895 TColgp_Array1OfPnt2d Extrem1(1,2);
896 Extrem1(1).SetCoord(l1,f2);
897 Extrem1(2).SetCoord(l1,l2);
898 TColgp_Array1OfPnt2d Extrem2(1,2);
899 Extrem2(1).SetCoord(f1,f2);
900 Extrem2(2).SetCoord(f1,l2);
902 new Geom2d_BezierCurve(Extrem1),
903 new Geom2d_BezierCurve(Extrem2),
906 else if (IType != 4) { //not plane
907 TColgp_Array1OfPnt2d Extrem2(1,2);
908 Extrem2(1).SetCoord(f1,f2);
909 Extrem2(2).SetCoord(f1,l2);
911 new Geom2d_BezierCurve(Extrem2),
913 TColgp_Array1OfPnt2d Extrem1(1,2);
914 Extrem1(1).SetCoord(l1,f2);
915 Extrem1(2).SetCoord(l1,l2);
917 new Geom2d_BezierCurve(Extrem1),
921 // Set the non parameter flag;
922 B.SameParameter(Edge1,Standard_False);
923 B.SameParameter(Edge2,Standard_False);
924 B.SameParameter(Edge3,Standard_False);
925 B.SameParameter(Edge4,Standard_False);
926 B.SameRange(Edge1,Standard_False);
927 B.SameRange(Edge2,Standard_False);
928 B.SameRange(Edge3,Standard_False);
929 B.SameRange(Edge4,Standard_False);
931 tantque = ex1.More() && ex2.More();
932 if (wPoint1) tantque = ex2.More();
933 if (wPoint2) tantque = ex1.More();
936 BRepLib::SameParameter(myShell);
938 if (uClosed && DegenFirst && DegenLast)
939 myShell.Closed(Standard_True);
943 //=======================================================================
944 //function : GeneratedShapes
946 //=======================================================================
948 const TopTools_ListOfShape&
949 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
951 if (myMap.IsBound(SSection)) {
952 return myMap(SSection);
955 static TopTools_ListOfShape Empty;
960 //=======================================================================
961 //function : Generated
963 //=================================================================== ====
965 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const