1 // Created on: 1994-03-07
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRepFill_Generator.ixx>
19 #include <TopoDS_Face.hxx>
20 #include <TopoDS_Wire.hxx>
21 #include <TopoDS_Edge.hxx>
22 #include <TopoDS_Vertex.hxx>
23 #include <BRep_Builder.hxx>
24 #include <TopLoc_Location.hxx>
25 #include <TopExp_Explorer.hxx>
26 #include <gp_Pnt2d.hxx>
27 #include <gp_Dir2d.hxx>
30 #include <gp_Circ.hxx>
32 #include <GeomAbs_Shape.hxx>
33 #include <GeomAdaptor_Curve.hxx>
34 #include <Geom_Circle.hxx>
35 #include <Geom_Line.hxx>
36 #include <Geom_Curve.hxx>
37 #include <Geom_BezierCurve.hxx>
38 #include <Geom_TrimmedCurve.hxx>
39 #include <Geom_Surface.hxx>
40 #include <Geom_Plane.hxx>
41 #include <Geom_CylindricalSurface.hxx>
42 #include <Geom_ConicalSurface.hxx>
43 #include <Geom_RectangularTrimmedSurface.hxx>
44 #include <Geom2d_Line.hxx>
45 #include <Geom2d_BezierCurve.hxx>
46 #include <GeomFill_Generator.hxx>
48 #include <TopTools_DataMapOfShapeShape.hxx>
49 #include <GeomFill.hxx>
50 #include <BRep_Tool.hxx>
53 #include <Precision.hxx>
54 #include <BRepLib.hxx>
56 #include <TColgp_Array1OfPnt.hxx>
57 #include <TColgp_Array1OfPnt2d.hxx>
58 #include <Geom_BSplineCurve.hxx>
60 #include <GeomConvert.hxx>
62 #include <BRepTools_WireExplorer.hxx>
63 #include <BRepTools.hxx>
67 //=======================================================================
68 //function : DetectKPart
70 //=======================================================================
72 Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
73 const TopoDS_Edge& Edge2)
76 Standard_Integer IType = 0;
78 // characteristics of the first edge
79 Standard_Real first1 = 0., last1 = 0., first2, last2, ff, ll;
82 Handle(Geom_Curve) curv1, curv;
83 GeomAdaptor_Curve AdC1;
84 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
86 // find the particular case
89 Standard_Real dist1 =0.;
94 TopExp::Vertices(Edge1,V1,V2);
95 pos1 = BRep_Tool::Pnt(V1);
98 curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
100 Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
103 if (Edge1.Orientation() == TopAbs_REVERSED) {
105 first1 = curv1->ReversedParameter(ll);
106 last1 = curv1->ReversedParameter(ff);
109 if (AdC1.GetType() == GeomAbs_Circle) {
110 // first circular section
112 pos1 = AdC1.Circle().Location();
113 dist1 = AdC1.Circle().Radius();
114 axe1 = AdC1.Circle().Axis();
116 else if (AdC1.GetType() == GeomAbs_Line) {
117 // first straight line section
119 pos1 = AdC1.Line().Location();
120 dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
121 gp_Vec vec(AdC1.Value(first1),AdC1.Value(last1));
123 axe1 = gp_Ax1(AdC1.Value(first1),dir);
126 // first section of any type
133 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
135 TopExp::Vertices(Edge2,V1,V2);
136 pos = BRep_Tool::Pnt(V1);
138 // the only particular case with degenerated edge at end : the cone
139 if (pos.IsEqual(pos1,Precision::Confusion())) {
140 // the top is mixed with the center of the circle
144 gp_Vec vec(pos1,pos);
146 axe = gp_Ax1(pos1,dir);
147 if (axe.IsParallel(axe1,Precision::Angular())) {
148 // the top is on the axis of the circle
152 // incorrect top --> no particular case
157 else if (IType != 4) { //not a plane
158 // no particular case
163 curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
165 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
168 if (Edge2.Orientation() == TopAbs_REVERSED) {
170 first2 = curv->ReversedParameter(ll);
171 last2 = curv->ReversedParameter(ff);
173 GeomAdaptor_Curve AdC(curv);
175 if (IType>0 && IType<4) {
176 if (AdC.GetType() != GeomAbs_Circle) {
177 // section not circular --> no particular case
181 if (AdC.Circle().Axis()
182 .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
184 if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
185 // possibility of cylinder or a piece of cylinder
186 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
187 Standard_Boolean Same,
188 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
189 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
194 Same = SameParametricLength
195 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
197 // cylinder or piece of cylinder
201 // the interval of definition is not correct
206 // possibility of cone truncation
207 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
208 Standard_Boolean Same,
209 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
210 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
215 Same = SameParametricLength
216 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
218 // truncation of cone
222 // the interval of definition is not correct
226 if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
227 // the centers are mixed
233 if (AdC.Circle().Radius()==dist1) {
238 // different radius --> no particular case
245 if (AdC.GetType() != GeomAbs_Line) {
246 // not a straight line section --> no particular case
250 pos = AdC.Line().Location();
251 dist = AdC.Value(first2).Distance(AdC.Value(last2));
252 gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
254 axe = gp_Ax1(AdC.Value(first2),dir);
255 if (axe.IsParallel(axe1,Precision::Angular())) {
256 // parallel straight line
257 if (Abs(dist-dist1)<Precision::Confusion()) {
258 gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
259 if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
269 // different length --> no particular case
274 // not parallel straight line --> no particular case
279 else if (IType==-2) {
280 if (AdC.GetType() == GeomAbs_Line)
282 else if (AdC.GetType() == GeomAbs_Circle)
284 // the only particular case with degenerated edge at the beginning the cone
285 pos = AdC.Circle().Location();
286 axe = AdC.Circle().Axis();
287 if (pos1.IsEqual(pos,Precision::Confusion())) {
288 // the top is mixed with the center of the circle
292 gp_Vec vec(pos1,pos);
294 axe1 = gp_Ax1(pos1,dir);
295 if (axe.IsParallel(axe1,Precision::Angular())) {
296 // the top is on the axis of the circle
300 // incorrect top --> no particular case
311 // torus and extrusion are not particular cases.
312 if (IType == 3 || IType == 5) IType = 0;
317 //=======================================================================
318 //function : CreateKPart
320 //=======================================================================
322 void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
323 const Standard_Integer IType,
324 Handle(Geom_Surface)& Surf)
326 // find the dimension
327 TopoDS_Vertex V1, V2;
330 Standard_Real a1, b1, aa =0., bb =0.;
331 TopoDS_Vertex v1f,v1l,v2f,v2l;
333 // find characteristics of the first edge
334 Handle(Geom_Curve) C1;
335 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
337 // cone with degenerated edge at the top
338 TopExp::Vertices(Edge1,v1f,v1l);
341 C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
342 C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
345 if (Edge1.Orientation() == TopAbs_REVERSED) {
347 aa = C1->ReversedParameter(b1);
348 bb = C1->ReversedParameter(a1);
349 TopExp::Vertices(Edge1,v1l,v1f);
352 TopExp::Vertices(Edge1,v1f,v1l);
356 // find characteristics of the second edge
357 Handle(Geom_Curve) C2;
358 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
360 // cone with degenerated edge at the top
361 TopExp::Vertices(Edge2,v2f,v2l);
364 C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
365 C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
366 if (Edge2.Orientation() == TopAbs_REVERSED) {
372 TopExp::Vertices(Edge2,v2l,v2f);
376 aa = a1; //C2->ReversedParameter(b1);
377 bb = b1; //C2->ReversedParameter(a1);
379 TopExp::Vertices(Edge2,v2f,v2l);
383 // create the new surface
386 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
388 TopoDS_Wire newW1, newW2;
389 BRep_Builder BW1, BW2;
394 // calculate the surface
395 Handle(Geom_Surface) surface;
396 Standard_Real V, Rad;
398 // cylindrical surface
399 gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
400 gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
401 gp_Ax3 Ac1 = c1.Position();
402 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
407 Handle(Geom_CylindricalSurface) Cyl =
408 new Geom_CylindricalSurface( Ac1, c1.Radius());
409 surface = new Geom_RectangularTrimmedSurface
410 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
414 gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
415 gp_Ax3 Ak1 = k1.Position();
417 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
418 .Dot(gp_Vec(Ak1.Direction()));
422 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
423 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
424 Rad = k2.Radius() - k1.Radius();
431 Standard_Real Ang = ATan( Rad / V);
432 Handle(Geom_ConicalSurface) Cone =
433 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
435 surface = new Geom_RectangularTrimmedSurface
436 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
438 else if (IType==-2) {
439 // conical surface with the top at the beginning (degen1 is true)
440 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
441 gp_Ax3 Ak2 = k2.Position();
442 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
443 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
444 .Dot(gp_Vec(Ak2.Direction()));
445 Rad = k2.Radius(); // - k2.Radius();
450 Standard_Real Ang = ATan( Rad / V);
451 Handle(Geom_ConicalSurface) Cone =
452 new Geom_ConicalSurface( Ak2, Ang, 0.);
454 surface = new Geom_RectangularTrimmedSurface
455 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
462 gp_Lin L1, L2, aLine;
465 L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
470 L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
474 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
475 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
477 gp_Vec P1P2( P1, P2 );
478 gp_Dir D1 = aLine.Direction();
479 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
480 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
481 V = P1P2.Dot( Ax.YDirection());
483 //surface = new Geom_RectangularTrimmedSurface
484 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
487 // surface of extrusion ?
496 //=======================================================================
497 //function : BRepFill_Generator
499 //=======================================================================
501 BRepFill_Generator::BRepFill_Generator()
506 //=======================================================================
509 //=======================================================================
511 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
513 myWires.Append( Wire);
517 //=======================================================================
520 //=======================================================================
522 void BRepFill_Generator::Perform()
527 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
530 B.MakeShell(myShell);
532 Standard_Integer Nb = myWires.Length();
534 BRepTools_WireExplorer ex1,ex2;
536 Standard_Boolean wPoint1, wPoint2, uClosed = Standard_False, DegenFirst = Standard_False, DegenLast = Standard_False;
538 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
540 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
541 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
543 wPoint1 = Standard_False;
545 wPoint1 = Standard_True;
546 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
547 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
549 DegenFirst = wPoint1;
551 TopoDS_Vertex V1, V2;
552 TopExp::Vertices(Wire1, V1, V2);
553 uClosed = V1.IsSame(V2);
556 wPoint2 = Standard_False;
558 wPoint2 = Standard_True;
559 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
560 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
568 TopTools_DataMapOfShapeShape Map;
570 Standard_Boolean tantque = ex1.More() && ex2.More();
574 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
576 Standard_Boolean degen1
577 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
578 Standard_Boolean degen2
579 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
582 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
583 Edge1 = TopoDS::Edge(aLocalShape);
584 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
585 // aLocalShape = ex1.Current();
586 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
587 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
588 V1f.Orientation(TopAbs_FORWARD);
590 V1l.Orientation(TopAbs_REVERSED);
595 TopoDS_Shape aLocalShape = ex1.Current();
596 Edge1 = TopoDS::Edge(aLocalShape);
597 // Edge1 = TopoDS::Edge(ex1.Current());
601 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
602 Edge2 = TopoDS::Edge(aLocalShape);
603 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
604 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
605 V2f.Orientation(TopAbs_FORWARD);
607 V2l.Orientation(TopAbs_REVERSED);
612 Edge2 = TopoDS::Edge(ex2.Current());
615 Standard_Boolean Periodic
616 = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
617 // ATTENTION : a non-punctual wire should not
618 // contain a punctual edge
619 if (!wPoint1) ex1.Next();
620 if (!wPoint2) ex2.Next();
622 // initialization of vertices
623 Handle(Geom_Surface) Surf;
624 Standard_Real f1=0, l1=1, f2=0, l2=1;
625 if (Edge1.Orientation() == TopAbs_REVERSED)
626 TopExp::Vertices(Edge1,V1l,V1f);
628 TopExp::Vertices(Edge1,V1f,V1l);
629 if (Edge2.Orientation() == TopAbs_REVERSED)
630 TopExp::Vertices(Edge2,V2l,V2f);
632 TopExp::Vertices(Edge2,V2f,V2l);
645 Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
646 Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
648 = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
650 // processing of KPart
651 Standard_Integer IType = DetectKPart(Edge1,Edge2);
654 TopLoc_Location L,L1,L2;
656 Handle(Geom_Curve) C1, C2;
657 TColgp_Array1OfPnt Extremities(1,2);
660 Extremities(1) = BRep_Tool::Pnt(V1f);
661 Extremities(2) = BRep_Tool::Pnt(V1l);
662 C1 = new Geom_BezierCurve(Extremities);
665 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
668 Extremities(1) = BRep_Tool::Pnt(V2l);
669 Extremities(2) = BRep_Tool::Pnt(V2f);
670 C2 = new Geom_BezierCurve(Extremities);
673 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
676 // compute the location
677 Standard_Boolean SameLoc = Standard_False;
679 // transform and trim the curves
681 if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
682 Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
683 C1 = new Geom_TrimmedCurve(C1,f1,l1);
686 C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
688 if (!SameLoc) C1->Transform(L1.Transformation());
689 if (Edge1.Orientation() == TopAbs_REVERSED) {
693 if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
694 Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
695 C2 = new Geom_TrimmedCurve(C2,f2,l2);
698 C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
700 if (!SameLoc) C2->Transform(L2.Transformation());
701 if (Edge2.Orientation() == TopAbs_REVERSED) {
705 GeomFill_Generator Generator;
706 Generator.AddCurve( C1);
707 Generator.AddCurve( C2);
708 Generator.Perform( Precision::PConfusion());
710 Surf = Generator.Surface();
711 B.MakeFace(Face,Surf,Precision::Confusion());
715 CreateKPart(Edge1,Edge2,IType,Surf);
716 B.MakeFace(Face,Surf,Precision::Confusion());
719 // make the missing edges
720 Standard_Real first,last;
721 Surf->Bounds(f1,l1,f2,l2);
723 if ( Map.IsBound(Vf_toMap)) {
724 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
725 Edge3 = TopoDS::Edge(aLocalShape);
726 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
729 Handle(Geom_Curve) CC;
730 TColgp_Array1OfPnt Extremities(1,2);
732 // general case : Edge3 corresponds to iso U=f1
738 // particular case : it is required to calculate the curve 3d
739 Extremities(1) = BRep_Tool::Pnt(V1f);
740 Extremities(2) = BRep_Tool::Pnt(V2f);
741 CC = new Geom_BezierCurve(Extremities);
745 B.MakeEdge(Edge3,CC,Precision::Confusion());
746 V1f.Orientation(TopAbs_FORWARD);
748 V2f.Orientation(TopAbs_REVERSED);
750 B.Range(Edge3,first,last);
752 Map.Bind(Vf_toMap, Edge3);
755 Standard_Boolean CommonEdge = Standard_False;
756 if ( Map.IsBound(Vl_toMap) ) {
757 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
758 const TopoDS_Edge CommonE = TopoDS::Edge(aLocalShape);
759 // const TopoDS_Edge CommonE = TopoDS::Edge(Map(V1l).Reversed());
760 TopoDS_Vertex V1, V2;
761 TopExp::Vertices(CommonE,V1,V2);
762 CommonEdge = V1.IsSame(V1l) && V2.IsSame(V2l);
765 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
766 Edge4 = TopoDS::Edge(aLocalShape);
767 // Edge4 = TopoDS::Edge(Map(V1l).Reversed());
770 Handle(Geom_Curve) CC;
771 TColgp_Array1OfPnt Extremities(1,2);
773 // general case : Edge4 corresponds to iso U=l1
779 // particular case : it is required to calculate the curve 3d
780 Extremities(1) = BRep_Tool::Pnt(V1l);
781 Extremities(2) = BRep_Tool::Pnt(V2l);
782 CC = new Geom_BezierCurve(Extremities);
786 B.MakeEdge(Edge4,CC,Precision::Confusion());
787 V1l.Orientation(TopAbs_FORWARD);
789 V2l.Orientation(TopAbs_REVERSED);
791 B.Range(Edge4,first,last);
792 Map.Bind(Vl_toMap, Edge4);
800 if (! (degen1 && IType == 4))
803 if (! (degen2 && IType == 4))
804 B.Add(W,Edge2.Reversed());
811 // complete myMap for edge1
812 if (! (degen1 && IType == 4))
814 TopTools_ListOfShape Empty;
815 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
816 myMap(Edge1).Append(Face);
821 Standard_Real T = Precision::Confusion();
823 if (IType != 4) //not plane
825 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
827 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
829 B.Range(Edge1,Face,-l1,-f1);
833 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
835 B.Range(Edge1,Face,f1,l1);
838 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
840 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
842 B.Range(Edge2,Face,-l1,-f1);
846 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
848 B.Range(Edge2,Face,f1,l1);
855 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
856 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
861 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
864 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
871 TColgp_Array1OfPnt2d Extrem1(1,2);
872 Extrem1(1).SetCoord(l1,f2);
873 Extrem1(2).SetCoord(l1,l2);
874 TColgp_Array1OfPnt2d Extrem2(1,2);
875 Extrem2(1).SetCoord(f1,f2);
876 Extrem2(2).SetCoord(f1,l2);
878 new Geom2d_BezierCurve(Extrem1),
879 new Geom2d_BezierCurve(Extrem2),
882 else if (IType != 4) { //not plane
883 TColgp_Array1OfPnt2d Extrem2(1,2);
884 Extrem2(1).SetCoord(f1,f2);
885 Extrem2(2).SetCoord(f1,l2);
887 new Geom2d_BezierCurve(Extrem2),
889 TColgp_Array1OfPnt2d Extrem1(1,2);
890 Extrem1(1).SetCoord(l1,f2);
891 Extrem1(2).SetCoord(l1,l2);
893 new Geom2d_BezierCurve(Extrem1),
897 // Set the non parameter flag;
898 B.SameParameter(Edge1,Standard_False);
899 B.SameParameter(Edge2,Standard_False);
900 B.SameParameter(Edge3,Standard_False);
901 B.SameParameter(Edge4,Standard_False);
902 B.SameRange(Edge1,Standard_False);
903 B.SameRange(Edge2,Standard_False);
904 B.SameRange(Edge3,Standard_False);
905 B.SameRange(Edge4,Standard_False);
907 tantque = ex1.More() && ex2.More();
908 if (wPoint1) tantque = ex2.More();
909 if (wPoint2) tantque = ex1.More();
912 BRepLib::SameParameter(myShell);
914 if (uClosed && DegenFirst && DegenLast)
915 myShell.Closed(Standard_True);
919 //=======================================================================
920 //function : GeneratedShapes
922 //=======================================================================
924 const TopTools_ListOfShape&
925 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
927 if (myMap.IsBound(SSection)) {
928 return myMap(SSection);
931 static TopTools_ListOfShape Empty;
936 //=======================================================================
937 //function : Generated
939 //=================================================================== ====
941 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const