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
387 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
392 TopoDS_Wire newW1, newW2;
393 BRep_Builder BW1, BW2;
398 // calculate the surface
399 Handle(Geom_Surface) surface;
400 Standard_Real V, Rad;
402 // cylindrical surface
403 gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
404 gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
405 gp_Ax3 Ac1 = c1.Position();
406 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
411 Handle(Geom_CylindricalSurface) Cyl =
412 new Geom_CylindricalSurface( Ac1, c1.Radius());
413 surface = new Geom_RectangularTrimmedSurface
414 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
418 gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
419 gp_Ax3 Ak1 = k1.Position();
421 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
422 .Dot(gp_Vec(Ak1.Direction()));
426 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
427 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
428 Rad = k2.Radius() - k1.Radius();
435 Standard_Real Ang = ATan( Rad / V);
436 Handle(Geom_ConicalSurface) Cone =
437 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
439 surface = new Geom_RectangularTrimmedSurface
440 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
442 else if (IType==-2) {
443 // conical surface with the top at the beginning (degen1 is true)
444 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
445 gp_Ax3 Ak2 = k2.Position();
446 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
447 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
448 .Dot(gp_Vec(Ak2.Direction()));
449 Rad = k2.Radius(); // - k2.Radius();
454 Standard_Real Ang = ATan( Rad / V);
455 Handle(Geom_ConicalSurface) Cone =
456 new Geom_ConicalSurface( Ak2, Ang, 0.);
458 surface = new Geom_RectangularTrimmedSurface
459 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
466 gp_Lin L1, L2, aLine;
469 L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
474 L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
478 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
479 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
481 gp_Vec P1P2( P1, P2 );
482 gp_Dir D1 = aLine.Direction();
483 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
484 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
485 V = P1P2.Dot( Ax.YDirection());
487 //surface = new Geom_RectangularTrimmedSurface
488 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
491 // surface of extrusion ?
500 //=======================================================================
501 //function : BRepFill_Generator
503 //=======================================================================
505 BRepFill_Generator::BRepFill_Generator()
510 //=======================================================================
513 //=======================================================================
515 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
517 myWires.Append( Wire);
521 //=======================================================================
524 //=======================================================================
526 void BRepFill_Generator::Perform()
531 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
534 B.MakeShell(myShell);
536 Standard_Integer Nb = myWires.Length();
538 BRepTools_WireExplorer ex1,ex2;
540 Standard_Boolean wPoint1, wPoint2, uClosed = Standard_False, DegenFirst = Standard_False, DegenLast = Standard_False;
542 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
544 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
545 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
547 wPoint1 = Standard_False;
549 wPoint1 = Standard_True;
550 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
551 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
553 DegenFirst = wPoint1;
555 TopoDS_Vertex V1, V2;
556 TopExp::Vertices(Wire1, V1, V2);
557 uClosed = V1.IsSame(V2);
560 wPoint2 = Standard_False;
562 wPoint2 = Standard_True;
563 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
564 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
572 TopTools_DataMapOfShapeShape Map;
574 Standard_Boolean tantque = ex1.More() && ex2.More();
578 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
580 Standard_Boolean degen1
581 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
582 Standard_Boolean degen2
583 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
586 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
587 Edge1 = TopoDS::Edge(aLocalShape);
588 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
589 // aLocalShape = ex1.Current();
590 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
591 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
592 V1f.Orientation(TopAbs_FORWARD);
594 V1l.Orientation(TopAbs_REVERSED);
599 TopoDS_Shape aLocalShape = ex1.Current();
600 Edge1 = TopoDS::Edge(aLocalShape);
601 // Edge1 = TopoDS::Edge(ex1.Current());
605 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
606 Edge2 = TopoDS::Edge(aLocalShape);
607 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
608 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
609 V2f.Orientation(TopAbs_FORWARD);
611 V2l.Orientation(TopAbs_REVERSED);
616 Edge2 = TopoDS::Edge(ex2.Current());
619 Standard_Boolean Periodic
620 = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
621 // ATTENTION : a non-punctual wire should not
622 // contain a punctual edge
623 if (!wPoint1) ex1.Next();
624 if (!wPoint2) ex2.Next();
626 // initialization of vertices
627 Handle(Geom_Surface) Surf;
628 Standard_Real f1=0, l1=1, f2=0, l2=1;
629 if (Edge1.Orientation() == TopAbs_REVERSED)
630 TopExp::Vertices(Edge1,V1l,V1f);
632 TopExp::Vertices(Edge1,V1f,V1l);
633 if (Edge2.Orientation() == TopAbs_REVERSED)
634 TopExp::Vertices(Edge2,V2l,V2f);
636 TopExp::Vertices(Edge2,V2f,V2l);
649 Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
650 Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
652 = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
654 // processing of KPart
655 Standard_Integer IType = DetectKPart(Edge1,Edge2);
658 TopLoc_Location L,L1,L2;
660 Handle(Geom_Curve) C1, C2;
661 TColgp_Array1OfPnt Extremities(1,2);
664 Extremities(1) = BRep_Tool::Pnt(V1f);
665 Extremities(2) = BRep_Tool::Pnt(V1l);
666 C1 = new Geom_BezierCurve(Extremities);
669 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
672 Extremities(1) = BRep_Tool::Pnt(V2l);
673 Extremities(2) = BRep_Tool::Pnt(V2f);
674 C2 = new Geom_BezierCurve(Extremities);
677 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
680 // compute the location
681 Standard_Boolean SameLoc = Standard_False;
683 // transform and trim the curves
685 if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
686 Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
687 C1 = new Geom_TrimmedCurve(C1,f1,l1);
690 C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
692 if (!SameLoc) C1->Transform(L1.Transformation());
693 if (Edge1.Orientation() == TopAbs_REVERSED) {
697 if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
698 Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
699 C2 = new Geom_TrimmedCurve(C2,f2,l2);
702 C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
704 if (!SameLoc) C2->Transform(L2.Transformation());
705 if (Edge2.Orientation() == TopAbs_REVERSED) {
709 GeomFill_Generator Generator;
710 Generator.AddCurve( C1);
711 Generator.AddCurve( C2);
712 Generator.Perform( Precision::PConfusion());
714 Surf = Generator.Surface();
715 B.MakeFace(Face,Surf,Precision::Confusion());
719 CreateKPart(Edge1,Edge2,IType,Surf);
720 B.MakeFace(Face,Surf,Precision::Confusion());
723 // make the missing edges
724 Standard_Real first,last;
725 Surf->Bounds(f1,l1,f2,l2);
727 if ( Map.IsBound(Vf_toMap)) {
728 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
729 Edge3 = TopoDS::Edge(aLocalShape);
730 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
733 Handle(Geom_Curve) CC;
734 TColgp_Array1OfPnt Extremities(1,2);
736 // general case : Edge3 corresponds to iso U=f1
742 // particular case : it is required to calculate the curve 3d
743 Extremities(1) = BRep_Tool::Pnt(V1f);
744 Extremities(2) = BRep_Tool::Pnt(V2f);
745 CC = new Geom_BezierCurve(Extremities);
749 B.MakeEdge(Edge3,CC,Precision::Confusion());
750 V1f.Orientation(TopAbs_FORWARD);
752 V2f.Orientation(TopAbs_REVERSED);
754 B.Range(Edge3,first,last);
756 Map.Bind(Vf_toMap, Edge3);
759 Standard_Boolean CommonEdge = Standard_False;
760 if ( Map.IsBound(Vl_toMap) ) {
761 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
762 const TopoDS_Edge CommonE = TopoDS::Edge(aLocalShape);
763 // const TopoDS_Edge CommonE = TopoDS::Edge(Map(V1l).Reversed());
764 TopoDS_Vertex V1, V2;
765 TopExp::Vertices(CommonE,V1,V2);
766 CommonEdge = V1.IsSame(V1l) && V2.IsSame(V2l);
769 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
770 Edge4 = TopoDS::Edge(aLocalShape);
771 // Edge4 = TopoDS::Edge(Map(V1l).Reversed());
774 Handle(Geom_Curve) CC;
775 TColgp_Array1OfPnt Extremities(1,2);
777 // general case : Edge4 corresponds to iso U=l1
783 // particular case : it is required to calculate the curve 3d
784 Extremities(1) = BRep_Tool::Pnt(V1l);
785 Extremities(2) = BRep_Tool::Pnt(V2l);
786 CC = new Geom_BezierCurve(Extremities);
790 B.MakeEdge(Edge4,CC,Precision::Confusion());
791 V1l.Orientation(TopAbs_FORWARD);
793 V2l.Orientation(TopAbs_REVERSED);
795 B.Range(Edge4,first,last);
796 Map.Bind(Vl_toMap, Edge4);
804 if (! (degen1 && IType == 4))
807 if (! (degen2 && IType == 4))
808 B.Add(W,Edge2.Reversed());
815 // complete myMap for edge1
816 if (! (degen1 && IType == 4))
818 TopTools_ListOfShape Empty;
819 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
820 myMap(Edge1).Append(Face);
825 Standard_Real T = Precision::Confusion();
827 if (IType != 4) //not plane
829 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
831 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
833 B.Range(Edge1,Face,-l1,-f1);
837 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
839 B.Range(Edge1,Face,f1,l1);
842 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
844 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
846 B.Range(Edge2,Face,-l1,-f1);
850 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
852 B.Range(Edge2,Face,f1,l1);
859 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
860 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
865 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
868 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
875 TColgp_Array1OfPnt2d Extrem1(1,2);
876 Extrem1(1).SetCoord(l1,f2);
877 Extrem1(2).SetCoord(l1,l2);
878 TColgp_Array1OfPnt2d Extrem2(1,2);
879 Extrem2(1).SetCoord(f1,f2);
880 Extrem2(2).SetCoord(f1,l2);
882 new Geom2d_BezierCurve(Extrem1),
883 new Geom2d_BezierCurve(Extrem2),
886 else if (IType != 4) { //not plane
887 TColgp_Array1OfPnt2d Extrem2(1,2);
888 Extrem2(1).SetCoord(f1,f2);
889 Extrem2(2).SetCoord(f1,l2);
891 new Geom2d_BezierCurve(Extrem2),
893 TColgp_Array1OfPnt2d Extrem1(1,2);
894 Extrem1(1).SetCoord(l1,f2);
895 Extrem1(2).SetCoord(l1,l2);
897 new Geom2d_BezierCurve(Extrem1),
901 // Set the non parameter flag;
902 B.SameParameter(Edge1,Standard_False);
903 B.SameParameter(Edge2,Standard_False);
904 B.SameParameter(Edge3,Standard_False);
905 B.SameParameter(Edge4,Standard_False);
906 B.SameRange(Edge1,Standard_False);
907 B.SameRange(Edge2,Standard_False);
908 B.SameRange(Edge3,Standard_False);
909 B.SameRange(Edge4,Standard_False);
911 tantque = ex1.More() && ex2.More();
912 if (wPoint1) tantque = ex2.More();
913 if (wPoint2) tantque = ex1.More();
916 BRepLib::SameParameter(myShell);
918 if (uClosed && DegenFirst && DegenLast)
919 myShell.Closed(Standard_True);
923 //=======================================================================
924 //function : GeneratedShapes
926 //=======================================================================
928 const TopTools_ListOfShape&
929 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
931 if (myMap.IsBound(SSection)) {
932 return myMap(SSection);
935 static TopTools_ListOfShape Empty;
940 //=======================================================================
941 //function : Generated
943 //=================================================================== ====
945 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const