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 = 0., last1 = 0., 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
94 Standard_Real dist1 =0.;
99 TopExp::Vertices(Edge1,V1,V2);
100 pos1 = BRep_Tool::Pnt(V1);
103 curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
105 Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
108 if (Edge1.Orientation() == TopAbs_REVERSED) {
110 first1 = curv1->ReversedParameter(ll);
111 last1 = curv1->ReversedParameter(ff);
114 if (AdC1.GetType() == GeomAbs_Circle) {
115 // first circular section
117 pos1 = AdC1.Circle().Location();
118 dist1 = AdC1.Circle().Radius();
119 axe1 = AdC1.Circle().Axis();
121 else if (AdC1.GetType() == GeomAbs_Line) {
122 // first straight line section
124 pos1 = AdC1.Line().Location();
125 dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
126 gp_Vec vec(AdC1.Value(first1),AdC1.Value(last1));
128 axe1 = gp_Ax1(AdC1.Value(first1),dir);
131 // first section of any type
138 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
140 TopExp::Vertices(Edge2,V1,V2);
141 pos = BRep_Tool::Pnt(V1);
143 // the only particular case with degenerated edge at end : the cone
144 if (pos.IsEqual(pos1,Precision::Confusion())) {
145 // the top is mixed with the center of the circle
149 gp_Vec vec(pos1,pos);
151 axe = gp_Ax1(pos1,dir);
152 if (axe.IsParallel(axe1,Precision::Angular())) {
153 // the top is on the axis of the circle
157 // incorrect top --> no particular case
162 else if (IType != 4) { //not a plane
163 // no particular case
168 curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
170 Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
173 if (Edge2.Orientation() == TopAbs_REVERSED) {
175 first2 = curv->ReversedParameter(ll);
176 last2 = curv->ReversedParameter(ff);
178 GeomAdaptor_Curve AdC(curv);
180 if (IType>0 && IType<4) {
181 if (AdC.GetType() != GeomAbs_Circle) {
182 // section not circular --> no particular case
186 if (AdC.Circle().Axis()
187 .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
189 if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
190 // possibility of cylinder or a piece of cylinder
191 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
192 Standard_Boolean Same,
193 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
194 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
199 Same = SameParametricLength
200 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
202 // cylinder or piece of cylinder
206 // the interval of definition is not correct
211 // possibility of cone truncation
212 Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
213 Standard_Boolean Same,
214 SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
215 Standard_Real m1=(first1+last1)/2., m2=(first2+last2)/2.;
220 Same = SameParametricLength
221 && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
223 // truncation of cone
227 // the interval of definition is not correct
231 if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
232 // the centers are mixed
238 if (AdC.Circle().Radius()==dist1) {
243 // different radius --> no particular case
250 if (AdC.GetType() != GeomAbs_Line) {
251 // not a straight line section --> no particular case
255 pos = AdC.Line().Location();
256 dist = AdC.Value(first2).Distance(AdC.Value(last2));
257 gp_Vec vec(AdC.Value(first2),AdC.Value(last2));
259 axe = gp_Ax1(AdC.Value(first2),dir);
260 if (axe.IsParallel(axe1,Precision::Angular())) {
261 // parallel straight line
262 if (Abs(dist-dist1)<Precision::Confusion()) {
263 gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
264 if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
274 // different length --> no particular case
279 // not parallel straight line --> no particular case
284 else if (IType==-2) {
285 if (AdC.GetType() == GeomAbs_Line)
287 else if (AdC.GetType() == GeomAbs_Circle)
289 // the only particular case with degenerated edge at the beginning the cone
290 pos = AdC.Circle().Location();
291 axe = AdC.Circle().Axis();
292 if (pos1.IsEqual(pos,Precision::Confusion())) {
293 // the top is mixed with the center of the circle
297 gp_Vec vec(pos1,pos);
299 axe1 = gp_Ax1(pos1,dir);
300 if (axe.IsParallel(axe1,Precision::Angular())) {
301 // the top is on the axis of the circle
305 // incorrect top --> no particular case
316 // torus and extrusion are not particular cases.
317 if (IType == 3 || IType == 5) IType = 0;
322 //=======================================================================
323 //function : CreateKPart
325 //=======================================================================
327 void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
328 const Standard_Integer IType,
329 Handle(Geom_Surface)& Surf)
331 // find the dimension
332 TopoDS_Vertex V1, V2;
335 Standard_Real a1, b1, aa =0., bb =0.;
336 TopoDS_Vertex v1f,v1l,v2f,v2l;
338 // find characteristics of the first edge
339 Handle(Geom_Curve) C1;
340 Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
342 // cone with degenerated edge at the top
343 TopExp::Vertices(Edge1,v1f,v1l);
346 C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
347 C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
350 if (Edge1.Orientation() == TopAbs_REVERSED) {
352 aa = C1->ReversedParameter(b1);
353 bb = C1->ReversedParameter(a1);
354 TopExp::Vertices(Edge1,v1l,v1f);
357 TopExp::Vertices(Edge1,v1f,v1l);
361 // find characteristics of the second edge
362 Handle(Geom_Curve) C2;
363 Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
365 // cone with degenerated edge at the top
366 TopExp::Vertices(Edge2,v2f,v2l);
369 C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
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
392 TopoDS_Edge edge1, edge2, edge3, edge4, couture;
397 TopoDS_Wire newW1, newW2;
398 BRep_Builder BW1, BW2;
403 // calculate the surface
404 Handle(Geom_Surface) surface;
405 Standard_Real V, Rad;
407 // cylindrical surface
408 gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
409 gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
410 gp_Ax3 Ac1 = c1.Position();
411 V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
416 Handle(Geom_CylindricalSurface) Cyl =
417 new Geom_CylindricalSurface( Ac1, c1.Radius());
418 surface = new Geom_RectangularTrimmedSurface
419 ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
423 gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
424 gp_Ax3 Ak1 = k1.Position();
426 V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
427 .Dot(gp_Vec(Ak1.Direction()));
431 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
432 V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
433 Rad = k2.Radius() - k1.Radius();
440 Standard_Real Ang = ATan( Rad / V);
441 Handle(Geom_ConicalSurface) Cone =
442 new Geom_ConicalSurface( Ak1, Ang, k1.Radius());
444 surface = new Geom_RectangularTrimmedSurface
445 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
447 else if (IType==-2) {
448 // conical surface with the top at the beginning (degen1 is true)
449 gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
450 gp_Ax3 Ak2 = k2.Position();
451 Ak2.SetLocation(BRep_Tool::Pnt(v1f));
452 V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
453 .Dot(gp_Vec(Ak2.Direction()));
454 Rad = k2.Radius(); // - k2.Radius();
459 Standard_Real Ang = ATan( Rad / V);
460 Handle(Geom_ConicalSurface) Cone =
461 new Geom_ConicalSurface( Ak2, Ang, 0.);
463 surface = new Geom_RectangularTrimmedSurface
464 ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
471 gp_Lin L1, L2, aLine;
474 L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
479 L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
483 gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
484 gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
486 gp_Vec P1P2( P1, P2 );
487 gp_Dir D1 = aLine.Direction();
488 gp_Ax3 Ax( aLine.Location(), gp_Dir(D1.Crossed(P1P2)), D1 );
489 Handle(Geom_Plane) Plan = new Geom_Plane(Ax);
490 V = P1P2.Dot( Ax.YDirection());
492 //surface = new Geom_RectangularTrimmedSurface
493 //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
496 // surface of extrusion ?
505 //=======================================================================
506 //function : BRepFill_Generator
508 //=======================================================================
510 BRepFill_Generator::BRepFill_Generator()
515 //=======================================================================
518 //=======================================================================
520 void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
522 myWires.Append( Wire);
526 //=======================================================================
529 //=======================================================================
531 void BRepFill_Generator::Perform()
536 TopoDS_Edge Edge1, Edge2, Edge3, Edge4, Couture;
539 B.MakeShell(myShell);
541 Standard_Integer Nb = myWires.Length();
543 BRepTools_WireExplorer ex1,ex2;
545 Standard_Boolean wPoint1, wPoint2, uClosed = Standard_False, DegenFirst = Standard_False, DegenLast = Standard_False;
547 for ( Standard_Integer i = 1; i <= Nb-1; i++) {
549 TopoDS_Wire Wire1 = TopoDS::Wire(myWires( i ));
550 TopoDS_Wire Wire2 = TopoDS::Wire(myWires(i+1));
552 wPoint1 = Standard_False;
554 wPoint1 = Standard_True;
555 for(ex1.Init(Wire1); ex1.More(); ex1.Next()) {
556 wPoint1 = wPoint1 && (BRep_Tool::Degenerated(ex1.Current()));
558 DegenFirst = wPoint1;
560 TopoDS_Vertex V1, V2;
561 TopExp::Vertices(Wire1, V1, V2);
562 uClosed = V1.IsSame(V2);
565 wPoint2 = Standard_False;
567 wPoint2 = Standard_True;
568 for(ex2.Init(Wire2); ex2.More(); ex2.Next()) {
569 wPoint2 = wPoint2 && (BRep_Tool::Degenerated(ex2.Current()));
577 TopTools_DataMapOfShapeShape Map;
579 Standard_Boolean tantque = ex1.More() && ex2.More();
583 TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap;
585 Standard_Boolean degen1
586 = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current()));
587 Standard_Boolean degen2
588 = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current()));
591 TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied();
592 Edge1 = TopoDS::Edge(aLocalShape);
593 // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied());
594 // aLocalShape = ex1.Current();
595 // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l);
596 TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l);
597 V1f.Orientation(TopAbs_FORWARD);
599 V1l.Orientation(TopAbs_REVERSED);
604 TopoDS_Shape aLocalShape = ex1.Current();
605 Edge1 = TopoDS::Edge(aLocalShape);
606 // Edge1 = TopoDS::Edge(ex1.Current());
610 TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied();
611 Edge2 = TopoDS::Edge(aLocalShape);
612 // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied());
613 TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l);
614 V2f.Orientation(TopAbs_FORWARD);
616 V2l.Orientation(TopAbs_REVERSED);
621 Edge2 = TopoDS::Edge(ex2.Current());
624 Standard_Boolean Periodic
625 = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
626 // ATTENTION : a non-punctual wire should not
627 // contain a punctual edge
628 if (!wPoint1) ex1.Next();
629 if (!wPoint2) ex2.Next();
631 // initialization of vertices
632 Handle(Geom_Surface) Surf;
633 Standard_Real f1=0, l1=1, f2=0, l2=1;
634 if (Edge1.Orientation() == TopAbs_REVERSED)
635 TopExp::Vertices(Edge1,V1l,V1f);
637 TopExp::Vertices(Edge1,V1f,V1l);
638 if (Edge2.Orientation() == TopAbs_REVERSED)
639 TopExp::Vertices(Edge2,V2l,V2f);
641 TopExp::Vertices(Edge2,V2f,V2l);
654 Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
655 Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
657 = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
659 // processing of KPart
660 Standard_Integer IType = DetectKPart(Edge1,Edge2);
663 TopLoc_Location L,L1,L2;
665 Handle(Geom_Curve) C1, C2;
666 TColgp_Array1OfPnt Extremities(1,2);
669 Extremities(1) = BRep_Tool::Pnt(V1f);
670 Extremities(2) = BRep_Tool::Pnt(V1l);
671 C1 = new Geom_BezierCurve(Extremities);
674 C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
677 Extremities(1) = BRep_Tool::Pnt(V2l);
678 Extremities(2) = BRep_Tool::Pnt(V2f);
679 C2 = new Geom_BezierCurve(Extremities);
682 C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
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);
732 if ( Map.IsBound(Vf_toMap)) {
733 TopoDS_Shape aLocalShape = Map(Vf_toMap).Reversed();
734 Edge3 = TopoDS::Edge(aLocalShape);
735 // Edge3 = TopoDS::Edge(Map(V1f).Reversed());
738 Handle(Geom_Curve) CC;
739 TColgp_Array1OfPnt Extremities(1,2);
741 // general case : Edge3 corresponds to iso U=f1
747 // particular case : it is required to calculate the curve 3d
748 Extremities(1) = BRep_Tool::Pnt(V1f);
749 Extremities(2) = BRep_Tool::Pnt(V2f);
750 CC = new Geom_BezierCurve(Extremities);
754 B.MakeEdge(Edge3,CC,Precision::Confusion());
755 V1f.Orientation(TopAbs_FORWARD);
757 V2f.Orientation(TopAbs_REVERSED);
759 B.Range(Edge3,first,last);
761 Map.Bind(Vf_toMap, Edge3);
764 Standard_Boolean CommonEdge = Standard_False;
765 if ( Map.IsBound(Vl_toMap) ) {
766 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
767 const TopoDS_Edge CommonE = TopoDS::Edge(aLocalShape);
768 // const TopoDS_Edge CommonE = TopoDS::Edge(Map(V1l).Reversed());
769 TopoDS_Vertex V1, V2;
770 TopExp::Vertices(CommonE,V1,V2);
771 CommonEdge = V1.IsSame(V1l) && V2.IsSame(V2l);
774 TopoDS_Shape aLocalShape = Map(Vl_toMap).Reversed();
775 Edge4 = TopoDS::Edge(aLocalShape);
776 // Edge4 = TopoDS::Edge(Map(V1l).Reversed());
779 Handle(Geom_Curve) CC;
780 TColgp_Array1OfPnt Extremities(1,2);
782 // general case : Edge4 corresponds to iso U=l1
788 // particular case : it is required to calculate the curve 3d
789 Extremities(1) = BRep_Tool::Pnt(V1l);
790 Extremities(2) = BRep_Tool::Pnt(V2l);
791 CC = new Geom_BezierCurve(Extremities);
795 B.MakeEdge(Edge4,CC,Precision::Confusion());
796 V1l.Orientation(TopAbs_FORWARD);
798 V2l.Orientation(TopAbs_REVERSED);
800 B.Range(Edge4,first,last);
801 Map.Bind(Vl_toMap, Edge4);
809 if (! (degen1 && IType == 4))
812 if (! (degen2 && IType == 4))
813 B.Add(W,Edge2.Reversed());
820 // complete myMap for edge1
821 if (! (degen1 && IType == 4))
823 TopTools_ListOfShape Empty;
824 if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty);
825 myMap(Edge1).Append(Face);
830 Standard_Real T = Precision::Confusion();
832 if (IType != 4) //not plane
834 if ( Edge1.Orientation() == TopAbs_REVERSED ) {
836 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(-1,0)),
838 B.Range(Edge1,Face,-l1,-f1);
842 new Geom2d_Line(gp_Pnt2d(0,f2),gp_Dir2d(1,0)),
844 B.Range(Edge1,Face,f1,l1);
847 if ( Edge2.Orientation() == TopAbs_REVERSED ) {
849 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(-1,0)),
851 B.Range(Edge2,Face,-l1,-f1);
855 new Geom2d_Line(gp_Pnt2d(0,l2),gp_Dir2d(1,0)),
857 B.Range(Edge2,Face,f1,l1);
864 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
865 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
870 new Geom2d_Line(gp_Pnt2d(f1,0),gp_Dir2d(0,1)),
873 new Geom2d_Line(gp_Pnt2d(l1,0),gp_Dir2d(0,1)),
880 TColgp_Array1OfPnt2d Extrem1(1,2);
881 Extrem1(1).SetCoord(l1,f2);
882 Extrem1(2).SetCoord(l1,l2);
883 TColgp_Array1OfPnt2d Extrem2(1,2);
884 Extrem2(1).SetCoord(f1,f2);
885 Extrem2(2).SetCoord(f1,l2);
887 new Geom2d_BezierCurve(Extrem1),
888 new Geom2d_BezierCurve(Extrem2),
891 else if (IType != 4) { //not plane
892 TColgp_Array1OfPnt2d Extrem2(1,2);
893 Extrem2(1).SetCoord(f1,f2);
894 Extrem2(2).SetCoord(f1,l2);
896 new Geom2d_BezierCurve(Extrem2),
898 TColgp_Array1OfPnt2d Extrem1(1,2);
899 Extrem1(1).SetCoord(l1,f2);
900 Extrem1(2).SetCoord(l1,l2);
902 new Geom2d_BezierCurve(Extrem1),
906 // Set the non parameter flag;
907 B.SameParameter(Edge1,Standard_False);
908 B.SameParameter(Edge2,Standard_False);
909 B.SameParameter(Edge3,Standard_False);
910 B.SameParameter(Edge4,Standard_False);
911 B.SameRange(Edge1,Standard_False);
912 B.SameRange(Edge2,Standard_False);
913 B.SameRange(Edge3,Standard_False);
914 B.SameRange(Edge4,Standard_False);
916 tantque = ex1.More() && ex2.More();
917 if (wPoint1) tantque = ex2.More();
918 if (wPoint2) tantque = ex1.More();
921 BRepLib::SameParameter(myShell);
923 if (uClosed && DegenFirst && DegenLast)
924 myShell.Closed(Standard_True);
928 //=======================================================================
929 //function : GeneratedShapes
931 //=======================================================================
933 const TopTools_ListOfShape&
934 BRepFill_Generator::GeneratedShapes (const TopoDS_Shape& SSection) const
936 if (myMap.IsBound(SSection)) {
937 return myMap(SSection);
940 static TopTools_ListOfShape Empty;
945 //=======================================================================
946 //function : Generated
948 //=================================================================== ====
950 const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const