1 // Created on: 1994-03-07
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 #include <BRepFill_Generator.ixx>
24 #include <TopoDS_Face.hxx>
25 #include <TopoDS_Wire.hxx>
26 #include <TopoDS_Edge.hxx>
27 #include <TopoDS_Vertex.hxx>
28 #include <BRep_Builder.hxx>
29 #include <TopLoc_Location.hxx>
30 #include <TopExp_Explorer.hxx>
31 #include <gp_Pnt2d.hxx>
32 #include <gp_Dir2d.hxx>
35 #include <gp_Circ.hxx>
37 #include <GeomAbs_Shape.hxx>
38 #include <GeomAdaptor_Curve.hxx>
39 #include <Geom_Circle.hxx>
40 #include <Geom_Line.hxx>
41 #include <Geom_Curve.hxx>
42 #include <Geom_BezierCurve.hxx>
43 #include <Geom_TrimmedCurve.hxx>
44 #include <Geom_Surface.hxx>
45 #include <Geom_Plane.hxx>
46 #include <Geom_CylindricalSurface.hxx>
47 #include <Geom_ConicalSurface.hxx>
48 #include <Geom_RectangularTrimmedSurface.hxx>
49 #include <Geom2d_Line.hxx>
50 #include <Geom2d_BezierCurve.hxx>
51 #include <GeomFill_Generator.hxx>
53 #include <TopTools_DataMapOfShapeShape.hxx>
54 #include <GeomFill.hxx>
55 #include <BRep_Tool.hxx>
58 #include <Precision.hxx>
59 #include <BRepLib.hxx>
61 #include <TColgp_Array1OfPnt.hxx>
62 #include <TColgp_Array1OfPnt2d.hxx>
63 #include <Geom_BSplineCurve.hxx>
65 #include <GeomConvert.hxx>
67 #include <BRepTools_WireExplorer.hxx>
68 #include <BRepTools.hxx>
72 //=======================================================================
73 //function : DetectKPart
75 //=======================================================================
77 Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
78 const TopoDS_Edge& Edge2)
81 Standard_Integer IType = 0;
83 // characteristics of the first edge
84 Standard_Real first1, last1, first2, last2, ff, ll;
87 Handle(Geom_Curve) curv1, curv;
88 GeomAdaptor_Curve AdC1;
89 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
91 // find the particular case
95 Standard_Real dist1 =0.;
103 TopExp::Vertices(Edge1,V1,V2);
104 pos1 = BRep_Tool::Pnt(V1);
107 curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
109 Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
112 if (Edge1.Orientation() == TopAbs_REVERSED) {
114 first1 = curv1->ReversedParameter(ll);
115 last1 = curv1->ReversedParameter(ff);
118 if (AdC1.GetType() == GeomAbs_Circle) {
119 // first circular section
121 pos1 = AdC1.Circle().Location();
122 dist1 = AdC1.Circle().Radius();
123 axe1 = AdC1.Circle().Axis();
125 else if (AdC1.GetType() == GeomAbs_Line) {
126 // first straight line section
128 pos1 = AdC1.Line().Location();
129 dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
130 gp_Vec vec(AdC1.Value(first1),AdC1.Value(last1));
132 axe1 = gp_Ax1(AdC1.Value(first1),dir);
135 // first section of any type
142 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
144 TopExp::Vertices(Edge2,V1,V2);
145 pos = BRep_Tool::Pnt(V1);
147 // the only particular case with degenerated edge at end : the cone
148 if (pos.IsEqual(pos1,Precision::Confusion())) {
149 // the top is mixed with the center of the circle
153 gp_Vec vec(pos1,pos);
155 axe = gp_Ax1(pos1,dir);
156 if (axe.IsParallel(axe1,Precision::Angular())) {
157 // the top is on the axis of the circle
161 // incorrect top --> no particular case
166 else if (IType != 4) { //not a plane
167 // no particular case
172 curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
174 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
177 if (Edge2.Orientation() == TopAbs_REVERSED) {
179 first2 = curv->ReversedParameter(ll);
180 last2 = curv->ReversedParameter(ff);
182 GeomAdaptor_Curve AdC(curv);
184 if (IType>0 && IType<4) {
185 if (AdC.GetType() != GeomAbs_Circle) {
186 // section not circular --> no particular case
190 if (AdC.Circle().Axis()
191 .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
193 if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
194 // possibility of cylinder or a piece of cylinder
195 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
196 Standard_Boolean Same,
197 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
198 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
203 Same = SameParametricLength
204 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
206 // cylinder or piece of cylinder
210 // the interval of definition is not correct
215 // possibility of cone truncation
216 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
217 Standard_Boolean Same,
218 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
219 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
224 Same = SameParametricLength
225 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
227 // truncation of cone
231 // the interval of definition is not correct
235 if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
236 // the centers are mixed
242 if (AdC.Circle().Radius()==dist1) {
247 // different radius --> no particular case
254 if (AdC.GetType() != GeomAbs_Line) {
255 // not a straight line section --> no particular case
259 pos = AdC.Line().Location();
260 dist = AdC.Value(first2).Distance(AdC.Value(last2));
261 gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
263 axe = gp_Ax1(AdC.Value(first2),dir);
264 if (axe.IsParallel(axe1,Precision::Angular())) {
265 // parallel straight line
266 if (Abs(dist-dist1)<Precision::Confusion()) {
267 gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
268 if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
278 // different length --> no particular case
283 // not parallel straight line --> no particular case
288 else if (IType==-2) {
289 if (AdC.GetType() == GeomAbs_Line)
291 else if (AdC.GetType() == GeomAbs_Circle)
293 // the only particular case with degenerated edge at the beginning the cone
294 pos = AdC.Circle().Location();
295 axe = AdC.Circle().Axis();
296 if (pos1.IsEqual(pos,Precision::Confusion())) {
297 // the top is mixed with the center of the circle
301 gp_Vec vec(pos1,pos);
303 axe1 = gp_Ax1(pos1,dir);
304 if (axe.IsParallel(axe1,Precision::Angular())) {
305 // the top is on the axis of the circle
309 // incorrect top --> no particular case
320 // torus and extrusion are not particular cases.
321 if (IType == 3 || IType == 5) IType = 0;
326 //=======================================================================
327 //function : CreateKPart
329 //=======================================================================
331 void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
332 const Standard_Integer IType,
333 Handle(Geom_Surface)& Surf)
335 // find the dimension
336 TopoDS_Vertex V1, V2;
339 Standard_Real a1, b1, aa =0., bb =0.;
340 TopoDS_Vertex v1f,v1l,v2f,v2l;
342 // find characteristics of the first edge
343 Handle(Geom_Curve) C1;
344 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
346 // cone with degenerated edge at the top
347 TopExp::Vertices(Edge1,v1f,v1l);
350 C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
351 C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
354 if (Edge1.Orientation() == TopAbs_REVERSED) {
356 aa = C1->ReversedParameter(b1);
357 bb = C1->ReversedParameter(a1);
358 TopExp::Vertices(Edge1,v1l,v1f);
361 TopExp::Vertices(Edge1,v1f,v1l);
365 // find characteristics of the second edge
366 Handle(Geom_Curve) C2;
367 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
369 // cone with degenerated edge at the top
370 TopExp::Vertices(Edge2,v2f,v2l);
373 C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
374 C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
375 if (Edge2.Orientation() == TopAbs_REVERSED) {
381 TopExp::Vertices(Edge2,v2l,v2f);
385 aa = a1; //C2->ReversedParameter(b1);
386 bb = b1; //C2->ReversedParameter(a1);
388 TopExp::Vertices(Edge2,v2f,v2l);
392 // create the new surface
396 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
401 TopoDS_Wire newW1, newW2;
402 BRep_Builder BW1, BW2;
407 // calculate the surface
408 Handle(Geom_Surface) surface;
409 Standard_Real V, Rad;
411 // cylindrical surface
412 gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
413 gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
414 gp_Ax3 Ac1 = c1.Position();
415 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
420 Handle(Geom_CylindricalSurface) Cyl =
421 new Geom_CylindricalSurface( Ac1, c1.Radius());
422 surface = new Geom_RectangularTrimmedSurface
423 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
427 gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
428 gp_Ax3 Ak1 = k1.Position();
430 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
431 .Dot(gp_Vec(Ak1.Direction()));
435 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
436 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
437 Rad = k2.Radius() - k1.Radius();
444 Standard_Real Ang = ATan( Rad / V);
445 Handle(Geom_ConicalSurface) Cone =
446 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
448 surface = new Geom_RectangularTrimmedSurface
449 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
451 else if (IType==-2) {
452 // conical surface with the top at the beginning (degen1 is true)
453 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
454 gp_Ax3 Ak2 = k2.Position();
455 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
456 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
457 .Dot(gp_Vec(Ak2.Direction()));
458 Rad = k2.Radius(); // - k2.Radius();
463 Standard_Real Ang = ATan( Rad / V);
464 Handle(Geom_ConicalSurface) Cone =
465 new Geom_ConicalSurface( Ak2, Ang, 0.);
467 surface = new Geom_RectangularTrimmedSurface
468 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
475 gp_Lin L1, L2, aLine;
478 L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
483 L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
487 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
488 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
490 gp_Vec P1P2( P1, P2 );
491 gp_Dir D1 = aLine.Direction();
492 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
493 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
494 V = P1P2.Dot( Ax.YDirection());
496 //surface = new Geom_RectangularTrimmedSurface
497 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
500 // surface of extrusion ?
509 //=======================================================================
510 //function : BRepFill_Generator
512 //=======================================================================
514 BRepFill_Generator::BRepFill_Generator()
519 //=======================================================================
522 //=======================================================================
524 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
526 myWires.Append( Wire);
530 //=======================================================================
533 //=======================================================================
535 void BRepFill_Generator::Perform()
540 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
543 B.MakeShell(myShell);
545 Standard_Integer Nb = myWires.Length();
547 BRepTools_WireExplorer ex1,ex2;
549 Standard_Boolean wPoint1, wPoint2, uClosed, DegenFirst, DegenLast;
551 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
553 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
554 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
556 wPoint1 = Standard_False;
558 wPoint1 = Standard_True;
559 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
560 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
562 DegenFirst = wPoint1;
564 TopoDS_Vertex V1, V2;
565 TopExp::Vertices(Wire1, V1, V2);
566 uClosed = V1.IsSame(V2);
569 wPoint2 = Standard_False;
571 wPoint2 = Standard_True;
572 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
573 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
581 TopTools_DataMapOfShapeShape Map;
583 Standard_Boolean tantque = ex1.More() && ex2.More();
587 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
589 Standard_Boolean degen1
590 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
591 Standard_Boolean degen2
592 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
595 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
596 Edge1 = TopoDS::Edge(aLocalShape);
597 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
598 // aLocalShape = ex1.Current();
599 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
600 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
601 V1f.Orientation(TopAbs_FORWARD);
603 V1l.Orientation(TopAbs_REVERSED);
608 TopoDS_Shape aLocalShape = ex1.Current();
609 Edge1 = TopoDS::Edge(aLocalShape);
610 // Edge1 = TopoDS::Edge(ex1.Current());
614 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
615 Edge2 = TopoDS::Edge(aLocalShape);
616 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
617 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
618 V2f.Orientation(TopAbs_FORWARD);
620 V2l.Orientation(TopAbs_REVERSED);
625 Edge2 = TopoDS::Edge(ex2.Current());
628 Standard_Boolean Periodic
629 = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
630 // ATTENTION : a non-punctual wire should not
631 // contain a punctual edge
632 if (!wPoint1) ex1.Next();
633 if (!wPoint2) ex2.Next();
635 // initialization of vertices
636 Handle(Geom_Surface) Surf;
637 Standard_Real f1=0, l1=1, f2=0, l2=1;
638 if (Edge1.Orientation() == TopAbs_REVERSED)
639 TopExp::Vertices(Edge1,V1l,V1f);
641 TopExp::Vertices(Edge1,V1f,V1l);
642 if (Edge2.Orientation() == TopAbs_REVERSED)
643 TopExp::Vertices(Edge2,V2l,V2f);
645 TopExp::Vertices(Edge2,V2f,V2l);
658 Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
659 Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
661 = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
663 // processing of KPart
664 Standard_Integer IType = DetectKPart(Edge1,Edge2);
667 TopLoc_Location L,L1,L2;
669 Handle(Geom_Curve) C1, C2;
670 TColgp_Array1OfPnt Extremities(1,2);
673 Extremities(1) = BRep_Tool::Pnt(V1f);
674 Extremities(2) = BRep_Tool::Pnt(V1l);
675 C1 = new Geom_BezierCurve(Extremities);
678 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
681 Extremities(1) = BRep_Tool::Pnt(V2l);
682 Extremities(2) = BRep_Tool::Pnt(V2f);
683 C2 = new Geom_BezierCurve(Extremities);
686 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
689 // compute the location
690 Standard_Boolean SameLoc = Standard_False;
692 // transform and trim the curves
694 if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
695 Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
696 C1 = new Geom_TrimmedCurve(C1,f1,l1);
699 C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
701 if (!SameLoc) C1->Transform(L1.Transformation());
702 if (Edge1.Orientation() == TopAbs_REVERSED) {
706 if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
707 Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
708 C2 = new Geom_TrimmedCurve(C2,f2,l2);
711 C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
713 if (!SameLoc) C2->Transform(L2.Transformation());
714 if (Edge2.Orientation() == TopAbs_REVERSED) {
718 GeomFill_Generator Generator;
719 Generator.AddCurve( C1);
720 Generator.AddCurve( C2);
721 Generator.Perform( Precision::PConfusion());
723 Surf = Generator.Surface();
724 B.MakeFace(Face,Surf,Precision::Confusion());
728 CreateKPart(Edge1,Edge2,IType,Surf);
729 B.MakeFace(Face,Surf,Precision::Confusion());
732 // make the missing edges
733 Standard_Real first,last;
734 Surf->Bounds(f1,l1,f2,l2);
736 if ( Map.IsBound(Vf_toMap)) {
737 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
738 Edge3 = TopoDS::Edge(aLocalShape);
739 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
742 Handle(Geom_Curve) CC;
743 TColgp_Array1OfPnt Extremities(1,2);
745 // general case : Edge3 corresponds to iso U=f1
751 // particular case : it is required to calculate the curve 3d
752 Extremities(1) = BRep_Tool::Pnt(V1f);
753 Extremities(2) = BRep_Tool::Pnt(V2f);
754 CC = new Geom_BezierCurve(Extremities);
758 B.MakeEdge(Edge3,CC,Precision::Confusion());
759 V1f.Orientation(TopAbs_FORWARD);
761 V2f.Orientation(TopAbs_REVERSED);
763 B.Range(Edge3,first,last);
765 Map.Bind(Vf_toMap, Edge3);
768 Standard_Boolean CommonEdge = Standard_False;
769 if ( Map.IsBound(Vl_toMap) ) {
770 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
771 const TopoDS_Edge CommonE = TopoDS::Edge(aLocalShape);
772 // const TopoDS_Edge CommonE = TopoDS::Edge(Map(V1l).Reversed());
773 TopoDS_Vertex V1, V2;
774 TopExp::Vertices(CommonE,V1,V2);
775 CommonEdge = V1.IsSame(V1l) && V2.IsSame(V2l);
778 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
779 Edge4 = TopoDS::Edge(aLocalShape);
780 // Edge4 = TopoDS::Edge(Map(V1l).Reversed());
783 Handle(Geom_Curve) CC;
784 TColgp_Array1OfPnt Extremities(1,2);
786 // general case : Edge4 corresponds to iso U=l1
792 // particular case : it is required to calculate the curve 3d
793 Extremities(1) = BRep_Tool::Pnt(V1l);
794 Extremities(2) = BRep_Tool::Pnt(V2l);
795 CC = new Geom_BezierCurve(Extremities);
799 B.MakeEdge(Edge4,CC,Precision::Confusion());
800 V1l.Orientation(TopAbs_FORWARD);
802 V2l.Orientation(TopAbs_REVERSED);
804 B.Range(Edge4,first,last);
805 Map.Bind(Vl_toMap, Edge4);
813 if (! (degen1 && IType == 4))
816 if (! (degen2 && IType == 4))
817 B.Add(W,Edge2.Reversed());
824 // complete myMap for edge1
825 if (! (degen1 && IType == 4))
827 TopTools_ListOfShape Empty;
828 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
829 myMap(Edge1).Append(Face);
834 Standard_Real T = Precision::Confusion();
836 if (IType != 4) //not plane
838 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
840 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
842 B.Range(Edge1,Face,-l1,-f1);
846 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
848 B.Range(Edge1,Face,f1,l1);
851 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
853 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
855 B.Range(Edge2,Face,-l1,-f1);
859 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
861 B.Range(Edge2,Face,f1,l1);
868 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
869 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
874 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
877 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
884 TColgp_Array1OfPnt2d Extrem1(1,2);
885 Extrem1(1).SetCoord(l1,f2);
886 Extrem1(2).SetCoord(l1,l2);
887 TColgp_Array1OfPnt2d Extrem2(1,2);
888 Extrem2(1).SetCoord(f1,f2);
889 Extrem2(2).SetCoord(f1,l2);
891 new Geom2d_BezierCurve(Extrem1),
892 new Geom2d_BezierCurve(Extrem2),
895 else if (IType != 4) { //not plane
896 TColgp_Array1OfPnt2d Extrem2(1,2);
897 Extrem2(1).SetCoord(f1,f2);
898 Extrem2(2).SetCoord(f1,l2);
900 new Geom2d_BezierCurve(Extrem2),
902 TColgp_Array1OfPnt2d Extrem1(1,2);
903 Extrem1(1).SetCoord(l1,f2);
904 Extrem1(2).SetCoord(l1,l2);
906 new Geom2d_BezierCurve(Extrem1),
910 // Set the non parameter flag;
911 B.SameParameter(Edge1,Standard_False);
912 B.SameParameter(Edge2,Standard_False);
913 B.SameParameter(Edge3,Standard_False);
914 B.SameParameter(Edge4,Standard_False);
915 B.SameRange(Edge1,Standard_False);
916 B.SameRange(Edge2,Standard_False);
917 B.SameRange(Edge3,Standard_False);
918 B.SameRange(Edge4,Standard_False);
920 tantque = ex1.More() && ex2.More();
921 if (wPoint1) tantque = ex2.More();
922 if (wPoint2) tantque = ex1.More();
925 BRepLib::SameParameter(myShell);
927 if (uClosed && DegenFirst && DegenLast)
928 myShell.Closed(Standard_True);
932 //=======================================================================
933 //function : GeneratedShapes
935 //=======================================================================
937 const TopTools_ListOfShape&
938 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
940 if (myMap.IsBound(SSection)) {
941 return myMap(SSection);
944 static TopTools_ListOfShape Empty;
949 //=======================================================================
950 //function : Generated
952 //=================================================================== ====
954 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const