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.
18 #include <BRep_Builder.hxx>
19 #include <BRep_Tool.hxx>
20 #include <BRepFill_Generator.hxx>
21 #include <BRepLib.hxx>
22 #include <BRepTools.hxx>
23 #include <BRepTools_WireExplorer.hxx>
24 #include <Geom2d_BezierCurve.hxx>
25 #include <Geom2d_Line.hxx>
26 #include <Geom_BezierCurve.hxx>
27 #include <Geom_BSplineCurve.hxx>
28 #include <Geom_Circle.hxx>
29 #include <Geom_ConicalSurface.hxx>
30 #include <Geom_Curve.hxx>
31 #include <Geom_CylindricalSurface.hxx>
32 #include <Geom_Line.hxx>
33 #include <Geom_Plane.hxx>
34 #include <Geom_RectangularTrimmedSurface.hxx>
35 #include <Geom_Surface.hxx>
36 #include <Geom_TrimmedCurve.hxx>
37 #include <GeomAbs_Shape.hxx>
38 #include <GeomAdaptor_Curve.hxx>
39 #include <GeomConvert.hxx>
40 #include <GeomFill.hxx>
41 #include <GeomFill_Generator.hxx>
44 #include <gp_Circ.hxx>
45 #include <gp_Dir2d.hxx>
47 #include <gp_Pnt2d.hxx>
49 #include <Precision.hxx>
50 #include <Standard_NullObject.hxx>
51 #include <TColgp_Array1OfPnt.hxx>
52 #include <TColgp_Array1OfPnt2d.hxx>
54 #include <TopExp_Explorer.hxx>
55 #include <TopLoc_Location.hxx>
57 #include <TopoDS_Edge.hxx>
58 #include <TopoDS_Face.hxx>
59 #include <TopoDS_Shape.hxx>
60 #include <TopoDS_Shell.hxx>
61 #include <TopoDS_Vertex.hxx>
62 #include <TopoDS_Wire.hxx>
63 #include <TopTools_DataMapOfShapeShape.hxx>
65 //=======================================================================
66 //function : DetectKPart
68 //=======================================================================
69 Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
70 const TopoDS_Edge& Edge2)
73 Standard_Integer IType = 0;
75 // characteristics of the first edge
76 Standard_Real first1 = 0., last1 = 0., first2, last2, ff, ll;
79 Handle(Geom_Curve) curv1, curv;
80 GeomAdaptor_Curve AdC1;
81 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
83 // find the particular case
86 Standard_Real dist1 =0.;
91 TopExp::Vertices(Edge1,V1,V2);
92 pos1 = BRep_Tool::Pnt(V1);
95 curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
97 throw Standard_NullObject("Null 3D curve in edge");
99 Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
102 if (Edge1.Orientation() == TopAbs_REVERSED) {
104 first1 = curv1->ReversedParameter(ll);
105 last1 = curv1->ReversedParameter(ff);
108 if (AdC1.GetType() == GeomAbs_Circle) {
109 // first circular section
111 pos1 = AdC1.Circle().Location();
112 dist1 = AdC1.Circle().Radius();
113 axe1 = AdC1.Circle().Axis();
115 else if (AdC1.GetType() == GeomAbs_Line) {
116 // first straight line section
118 pos1 = AdC1.Line().Location();
119 dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
120 gp_Vec vec(AdC1.Value(first1),AdC1.Value(last1));
122 axe1 = gp_Ax1(AdC1.Value(first1),dir);
125 // first section of any type
132 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
134 TopExp::Vertices(Edge2,V1,V2);
135 pos = BRep_Tool::Pnt(V1);
137 // the only particular case with degenerated edge at end : the cone
138 if (pos.IsEqual(pos1,Precision::Confusion())) {
139 // the top is mixed with the center of the circle
143 gp_Vec vec(pos1,pos);
145 axe = gp_Ax1(pos1,dir);
146 if (axe.IsParallel(axe1,Precision::Angular())) {
147 // the top is on the axis of the circle
151 // incorrect top --> no particular case
156 else if (IType != 4) { //not a plane
157 // no particular case
162 curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
164 throw Standard_NullObject("Null 3D curve in edge");
166 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
169 if (Edge2.Orientation() == TopAbs_REVERSED) {
171 first2 = curv->ReversedParameter(ll);
172 last2 = curv->ReversedParameter(ff);
174 GeomAdaptor_Curve AdC(curv);
176 if (IType>0 && IType<4) {
177 if (AdC.GetType() != GeomAbs_Circle) {
178 // section not circular --> no particular case
182 if (AdC.Circle().Axis()
183 .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
185 if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
186 // possibility of cylinder or a piece of cylinder
187 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
188 Standard_Boolean Same,
189 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
190 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
195 Same = SameParametricLength
196 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
198 // cylinder or piece of cylinder
202 // the interval of definition is not correct
207 // possibility of cone truncation
208 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
209 Standard_Boolean Same,
210 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
211 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
216 Same = SameParametricLength
217 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
219 // truncation of cone
223 // the interval of definition is not correct
227 if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
228 // the centers are mixed
234 if (AdC.Circle().Radius()==dist1) {
239 // different radius --> no particular case
246 if (AdC.GetType() != GeomAbs_Line) {
247 // not a straight line section --> no particular case
251 pos = AdC.Line().Location();
252 dist = AdC.Value(first2).Distance(AdC.Value(last2));
253 gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
255 axe = gp_Ax1(AdC.Value(first2), aDir);
256 if (axe.IsParallel(axe1,Precision::Angular())) {
257 // parallel straight line
258 if (Abs(dist-dist1)<Precision::Confusion()) {
259 gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
260 if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
270 // different length --> no particular case
275 // not parallel straight line --> no particular case
280 else if (IType==-2) {
281 if (AdC.GetType() == GeomAbs_Line)
283 else if (AdC.GetType() == GeomAbs_Circle)
285 // the only particular case with degenerated edge at the beginning the cone
286 pos = AdC.Circle().Location();
287 axe = AdC.Circle().Axis();
288 if (pos1.IsEqual(pos,Precision::Confusion())) {
289 // the top is mixed with the center of the circle
293 gp_Vec vec(pos1,pos);
295 axe1 = gp_Ax1(pos1,dir);
296 if (axe.IsParallel(axe1,Precision::Angular())) {
297 // the top is on the axis of the circle
301 // incorrect top --> no particular case
312 // torus and extrusion are not particular cases.
313 if (IType == 3 || IType == 5) IType = 0;
318 //=======================================================================
319 //function : CreateKPart
321 //=======================================================================
323 void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
324 const Standard_Integer IType,
325 Handle(Geom_Surface)& Surf)
327 // find the dimension
328 TopoDS_Vertex V1, V2;
331 Standard_Real a1, b1, aa =0., bb =0.;
332 TopoDS_Vertex v1f,v1l,v2f,v2l;
334 // find characteristics of the first edge
335 Handle(Geom_Curve) C1;
336 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
338 // cone with degenerated edge at the top
339 TopExp::Vertices(Edge1,v1f,v1l);
342 C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
344 throw Standard_NullObject("Null 3D curve in edge");
345 C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
348 if (Edge1.Orientation() == TopAbs_REVERSED) {
350 aa = C1->ReversedParameter(b1);
351 bb = C1->ReversedParameter(a1);
352 TopExp::Vertices(Edge1,v1l,v1f);
355 TopExp::Vertices(Edge1,v1f,v1l);
359 // find characteristics of the second edge
360 Handle(Geom_Curve) C2;
361 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
363 // cone with degenerated edge at the top
364 TopExp::Vertices(Edge2,v2f,v2l);
367 C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
369 throw Standard_NullObject("Null 3D curve in edge");
370 C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
371 if (Edge2.Orientation() == TopAbs_REVERSED) {
377 TopExp::Vertices(Edge2,v2l,v2f);
381 aa = a1; //C2->ReversedParameter(b1);
382 bb = b1; //C2->ReversedParameter(a1);
384 TopExp::Vertices(Edge2,v2f,v2l);
388 // create the new surface
391 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
393 TopoDS_Wire newW1, newW2;
394 BRep_Builder BW1, BW2;
398 GeomAdaptor_Curve aC1Adaptor;
401 GeomAdaptor_Curve aC2Adaptor;
405 // calculate the surface
406 Handle(Geom_Surface) surface;
407 Standard_Real V, Rad;
409 // cylindrical surface
410 gp_Circ c1 = aC1Adaptor.Circle();
411 gp_Circ c2 = aC2Adaptor.Circle();
412 gp_Ax3 Ac1 = c1.Position();
413 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
418 Handle(Geom_CylindricalSurface) Cyl =
419 new Geom_CylindricalSurface( Ac1, c1.Radius());
420 surface = new Geom_RectangularTrimmedSurface
421 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
425 gp_Circ k1 = aC1Adaptor.Circle();
426 gp_Ax3 Ak1 = k1.Position();
428 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
429 .Dot(gp_Vec(Ak1.Direction()));
433 gp_Circ k2 = aC2Adaptor.Circle();
434 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
435 Rad = k2.Radius() - k1.Radius();
442 Standard_Real Ang = ATan( Rad / V);
443 Handle(Geom_ConicalSurface) Cone =
444 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
446 surface = new Geom_RectangularTrimmedSurface
447 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
449 else if (IType==-2) {
450 // conical surface with the top at the beginning (degen1 is true)
451 gp_Circ k2 = aC2Adaptor.Circle();
452 gp_Ax3 Ak2 = k2.Position();
453 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
454 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
455 .Dot(gp_Vec(Ak2.Direction()));
456 Rad = k2.Radius(); // - k2.Radius();
461 Standard_Real Ang = ATan( Rad / V);
462 Handle(Geom_ConicalSurface) Cone =
463 new Geom_ConicalSurface( Ak2, Ang, 0.);
465 surface = new Geom_RectangularTrimmedSurface
466 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
473 gp_Lin L1, L2, aLine;
476 L1 = aC1Adaptor.Line();
481 L2 = aC2Adaptor.Line();
485 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
486 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
488 gp_Vec P1P2( P1, P2 );
489 gp_Dir D1 = aLine.Direction();
490 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
491 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
492 V = P1P2.Dot( Ax.YDirection());
494 //surface = new Geom_RectangularTrimmedSurface
495 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
498 // surface of extrusion ?
507 //=======================================================================
508 //function : BRepFill_Generator
510 //=======================================================================
512 BRepFill_Generator::BRepFill_Generator()
517 //=======================================================================
520 //=======================================================================
522 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
524 myWires.Append( Wire);
528 //=======================================================================
531 //=======================================================================
533 void BRepFill_Generator::Perform()
538 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
541 B.MakeShell(myShell);
543 Standard_Integer Nb = myWires.Length();
545 BRepTools_WireExplorer ex1,ex2;
547 Standard_Boolean wPoint1, wPoint2, uClosed = Standard_False, DegenFirst = Standard_False, DegenLast = Standard_False;
549 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
551 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
552 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
554 wPoint1 = Standard_False;
556 wPoint1 = Standard_True;
557 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
558 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
560 DegenFirst = wPoint1;
562 TopoDS_Vertex V1, V2;
563 TopExp::Vertices(Wire1, V1, V2);
564 uClosed = V1.IsSame(V2);
567 wPoint2 = Standard_False;
569 wPoint2 = Standard_True;
570 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
571 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
579 TopTools_DataMapOfShapeShape Map;
581 Standard_Boolean tantque = ex1.More() && ex2.More();
585 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
587 Standard_Boolean degen1
588 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
589 Standard_Boolean degen2
590 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
593 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
594 Edge1 = TopoDS::Edge(aLocalShape);
595 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
596 // aLocalShape = ex1.Current();
597 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
598 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
599 V1f.Orientation(TopAbs_FORWARD);
601 V1l.Orientation(TopAbs_REVERSED);
606 TopoDS_Shape aLocalShape = ex1.Current();
607 Edge1 = TopoDS::Edge(aLocalShape);
608 // Edge1 = TopoDS::Edge(ex1.Current());
612 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
613 Edge2 = TopoDS::Edge(aLocalShape);
614 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
615 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
616 V2f.Orientation(TopAbs_FORWARD);
618 V2l.Orientation(TopAbs_REVERSED);
623 Edge2 = TopoDS::Edge(ex2.Current());
626 Standard_Boolean Periodic = (BRep_Tool::IsClosed(Edge1) || degen1) &&
627 (BRep_Tool::IsClosed(Edge2) || degen2);
628 // ATTENTION : a non-punctual wire should not
629 // contain a punctual edge
630 if (!wPoint1) ex1.Next();
631 if (!wPoint2) ex2.Next();
633 // initialization of vertices
634 Handle(Geom_Surface) Surf;
635 Standard_Real f1=0, l1=1, f2=0, l2=1;
636 if (Edge1.Orientation() == TopAbs_REVERSED)
637 TopExp::Vertices(Edge1,V1l,V1f);
639 TopExp::Vertices(Edge1,V1f,V1l);
640 if (Edge2.Orientation() == TopAbs_REVERSED)
641 TopExp::Vertices(Edge2,V2l,V2f);
643 TopExp::Vertices(Edge2,V2f,V2l);
655 // processing of KPart
656 Standard_Integer IType = DetectKPart(Edge1,Edge2);
659 TopLoc_Location L,L1,L2;
661 Handle(Geom_Curve) C1, C2;
662 TColgp_Array1OfPnt Extremities(1,2);
665 Extremities(1) = BRep_Tool::Pnt(V1f);
666 Extremities(2) = BRep_Tool::Pnt(V1l);
667 C1 = new Geom_BezierCurve(Extremities);
670 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
672 throw Standard_NullObject("Null 3D curve in edge");
675 Extremities(1) = BRep_Tool::Pnt(V2l);
676 Extremities(2) = BRep_Tool::Pnt(V2f);
677 C2 = new Geom_BezierCurve(Extremities);
680 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
682 throw Standard_NullObject("Null 3D curve in edge");
685 // compute the location
686 Standard_Boolean SameLoc = Standard_False;
688 // transform and trim the curves
690 if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
691 Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
692 C1 = new Geom_TrimmedCurve(C1,f1,l1);
695 C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
697 if (!SameLoc) C1->Transform(L1.Transformation());
698 if (Edge1.Orientation() == TopAbs_REVERSED) {
702 if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
703 Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
704 C2 = new Geom_TrimmedCurve(C2,f2,l2);
707 C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
709 if (!SameLoc) C2->Transform(L2.Transformation());
710 if (Edge2.Orientation() == TopAbs_REVERSED) {
714 GeomFill_Generator Generator;
715 Generator.AddCurve( C1);
716 Generator.AddCurve( C2);
717 Generator.Perform( Precision::PConfusion());
719 Surf = Generator.Surface();
720 B.MakeFace(Face,Surf,Precision::Confusion());
724 CreateKPart(Edge1,Edge2,IType,Surf);
725 B.MakeFace(Face,Surf,Precision::Confusion());
728 // make the missing edges
729 Standard_Real first,last;
730 Surf->Bounds(f1,l1,f2,l2);
742 if ( Map.IsBound(Vf_toMap)) {
743 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
744 Edge3 = TopoDS::Edge(aLocalShape);
745 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
752 B.Degenerated(Edge3, Standard_True);
756 Handle(Geom_Curve) CC;
757 TColgp_Array1OfPnt Extremities(1, 2);
759 // general case : Edge3 corresponds to iso U=f1
763 // particular case : it is required to calculate the curve 3d
764 Extremities(1) = BRep_Tool::Pnt(V1f);
765 Extremities(2) = BRep_Tool::Pnt(V2f);
766 CC = new Geom_BezierCurve(Extremities);
768 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());
798 B.Degenerated(Edge4, Standard_True);
802 Handle(Geom_Curve) CC;
803 TColgp_Array1OfPnt Extremities(1, 2);
805 // general case : Edge4 corresponds to iso U=l1
809 // particular case : it is required to calculate the curve 3d
810 Extremities(1) = BRep_Tool::Pnt(V1l);
811 Extremities(2) = BRep_Tool::Pnt(V2l);
812 CC = new Geom_BezierCurve(Extremities);
814 B.MakeEdge(Edge4, CC, Precision::Confusion());
816 V1l.Orientation(TopAbs_FORWARD);
818 V2l.Orientation(TopAbs_REVERSED);
820 B.Range(Edge4, first, last);
821 Map.Bind(Vl_toMap, Edge4);
829 if (! (degen1 && IType == 4))
832 if (! (degen2 && IType == 4))
833 B.Add(W,Edge2.Reversed());
840 // complete myMap for edge1
841 if (! (degen1 && IType == 4))
843 TopTools_ListOfShape Empty;
844 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
845 myMap(Edge1).Append(Face);
850 Standard_Real T = Precision::Confusion();
852 if (IType != 4) //not plane
854 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
856 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
858 B.Range(Edge1,Face,-l1,-f1);
862 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
864 B.Range(Edge1,Face,f1,l1);
867 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
869 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
871 B.Range(Edge2,Face,-l1,-f1);
875 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
877 B.Range(Edge2,Face,f1,l1);
884 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
885 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
890 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
893 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
900 TColgp_Array1OfPnt2d Extrem1(1,2);
901 Extrem1(1).SetCoord(l1,f2);
902 Extrem1(2).SetCoord(l1,l2);
903 TColgp_Array1OfPnt2d Extrem2(1,2);
904 Extrem2(1).SetCoord(f1,f2);
905 Extrem2(2).SetCoord(f1,l2);
907 new Geom2d_BezierCurve(Extrem1),
908 new Geom2d_BezierCurve(Extrem2),
911 else if (IType != 4) { //not plane
912 TColgp_Array1OfPnt2d Extrem2(1,2);
913 Extrem2(1).SetCoord(f1,f2);
914 Extrem2(2).SetCoord(f1,l2);
916 new Geom2d_BezierCurve(Extrem2),
918 TColgp_Array1OfPnt2d Extrem1(1,2);
919 Extrem1(1).SetCoord(l1,f2);
920 Extrem1(2).SetCoord(l1,l2);
922 new Geom2d_BezierCurve(Extrem1),
926 // Set the non parameter flag;
927 B.SameParameter(Edge1,Standard_False);
928 B.SameParameter(Edge2,Standard_False);
929 B.SameParameter(Edge3,Standard_False);
930 B.SameParameter(Edge4,Standard_False);
931 B.SameRange(Edge1,Standard_False);
932 B.SameRange(Edge2,Standard_False);
933 B.SameRange(Edge3,Standard_False);
934 B.SameRange(Edge4,Standard_False);
936 tantque = ex1.More() && ex2.More();
937 if (wPoint1) tantque = ex2.More();
938 if (wPoint2) tantque = ex1.More();
941 BRepLib::SameParameter(myShell);
943 if (uClosed && DegenFirst && DegenLast)
944 myShell.Closed(Standard_True);
948 //=======================================================================
949 //function : GeneratedShapes
951 //=======================================================================
953 const TopTools_ListOfShape&
954 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
956 if (myMap.IsBound(SSection)) {
957 return myMap(SSection);
960 static TopTools_ListOfShape Empty;
965 //=======================================================================
966 //function : Generated
968 //=================================================================== ====
970 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const