1 // Created on: 1998-08-26
2 // Created by: Julia GERASIMOVA
3 // Copyright (c) 1998-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_Filling.ixx>
18 #include <BRepFill_EdgeFaceAndOrder.hxx>
19 #include <BRepFill_FaceAndOrder.hxx>
20 #include <BRepAdaptor_HSurface.hxx>
21 #include <BRepAdaptor_HCurve.hxx>
22 #include <BRepAdaptor_HCurve2d.hxx>
23 #include <BRepFill_CurveConstraint.hxx>
25 #include <Geom2dAdaptor_HCurve.hxx>
26 #include <GeomAdaptor_HSurface.hxx>
27 #include <Adaptor3d_CurveOnSurface.hxx>
28 #include <Adaptor3d_HCurveOnSurface.hxx>
30 #include <GeomPlate_MakeApprox.hxx>
31 #include <GeomPlate_CurveConstraint.hxx>
32 #include <GeomPlate_PointConstraint.hxx>
34 #include <BRepLib_MakeEdge.hxx>
35 #include <BRepLib_MakeEdge2d.hxx>
36 #include <BRepLib_MakeWire.hxx>
37 #include <TopTools_ListIteratorOfListOfShape.hxx>
39 #include <TopoDS_Wire.hxx>
40 #include <BRepLib_MakeFace.hxx>
41 #include <TColStd_HArray1OfReal.hxx>
42 #include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
43 #include <BRep_TEdge.hxx>
44 #include <BRep_CurveRepresentation.hxx>
46 #include <BRep_Tool.hxx>
47 #include <GeomAPI_ProjectPointOnSurf.hxx>
48 #include <TopoDS_Vertex.hxx>
50 #include <Precision.hxx>
51 #include <GeomProjLib.hxx>
52 #include <BRepTools.hxx>
53 #include <BRep_Builder.hxx>
54 #include <BRepLib.hxx>
55 #include <TColgp_SequenceOfPnt.hxx>
56 #include <TopTools_ListIteratorOfListOfShape.hxx>
57 #include <BRepTools_WireExplorer.hxx>
58 #include <TColgp_Array1OfPnt2d.hxx>
59 #include <TColGeom2d_HArray1OfCurve.hxx>
61 #include <Geom2d_BezierCurve.hxx>
62 #include <Geom2d_TrimmedCurve.hxx>
63 #include <Geom_BSplineSurface.hxx>
65 #include <TColgp_SequenceOfXY.hxx>
66 #include <GeomPlate_PlateG0Criterion.hxx>
67 #include <BRep_TVertex.hxx>
69 static gp_Vec MakeFinVec( const TopoDS_Wire aWire, const TopoDS_Vertex aVertex )
71 TopoDS_Vertex Vfirst, Vlast, Origin;
72 BRepTools_WireExplorer Explo( aWire );
73 for (; Explo.More(); Explo.Next())
75 TopExp::Vertices( Explo.Current(), Vfirst, Vlast );
76 if (Vfirst.IsSame( aVertex ))
81 if (Vlast.IsSame( aVertex ))
87 return gp_Vec( BRep_Tool::Pnt( Origin ), BRep_Tool::Pnt( aVertex ) );
90 static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges)
93 TopoDS_Edge anEdge = TopoDS::Edge(Edges.First());
97 while (!Edges.IsEmpty())
99 TopoDS_Wire CurWire = MW.Wire();
100 TopoDS_Vertex V1, V2;
101 TopExp::Vertices(CurWire, V1, V2);
102 TopTools_ListIteratorOfListOfShape itl(Edges);
103 for (; itl.More(); itl.Next())
105 anEdge = TopoDS::Edge(itl.Value());
106 TopoDS_Vertex V3, V4;
107 TopExp::Vertices(anEdge, V3, V4);
108 if (V1.IsSame(V3) || V1.IsSame(V4) ||
109 V2.IsSame(V3) || V2.IsSame(V4))
119 //=======================================================================
120 //function : Constructor
122 //======================================================================
123 BRepFill_Filling::BRepFill_Filling( const Standard_Integer Degree,
124 const Standard_Integer NbPtsOnCur,
125 const Standard_Integer NbIter,
126 const Standard_Boolean Anisotropie,
127 const Standard_Real Tol2d,
128 const Standard_Real Tol3d,
129 const Standard_Real TolAng,
130 const Standard_Real TolCurv,
131 const Standard_Integer MaxDeg,
132 const Standard_Integer MaxSegments )
135 myNbPtsOnCur = NbPtsOnCur;
137 myAnisotropie = Anisotropie;
145 myMaxSegments = MaxSegments;
147 myIsInitFaceGiven = Standard_False;
149 myIsDone = Standard_False;
152 //=======================================================================
153 //function : SetConstrParam
155 //======================================================================
156 void BRepFill_Filling::SetConstrParam( const Standard_Real Tol2d,
157 const Standard_Real Tol3d,
158 const Standard_Real TolAng,
159 const Standard_Real TolCurv )
167 //=======================================================================
168 //function : SetResolParam
170 //======================================================================
171 void BRepFill_Filling::SetResolParam( const Standard_Integer Degree,
172 const Standard_Integer NbPtsOnCur,
173 const Standard_Integer NbIter,
174 const Standard_Boolean Anisotropie )
177 myNbPtsOnCur = NbPtsOnCur;
179 myAnisotropie = Anisotropie;
182 //=======================================================================
183 //function : SetApproxParam
185 //======================================================================
186 void BRepFill_Filling::SetApproxParam( const Standard_Integer MaxDeg,
187 const Standard_Integer MaxSegments )
190 myMaxSegments = MaxSegments;
193 //=======================================================================
194 //function : LoadInitSurface
196 //======================================================================
197 void BRepFill_Filling::LoadInitSurface( const TopoDS_Face& aFace )
200 myIsInitFaceGiven = Standard_True;
203 //=======================================================================
205 //purpose : adds an edge as a constraint
206 //======================================================================
207 Standard_Integer BRepFill_Filling::Add( const TopoDS_Edge& anEdge,
208 const GeomAbs_Shape Order,
209 const Standard_Boolean IsBound )
211 TopoDS_Face NullFace;
212 BRepFill_EdgeFaceAndOrder EdgeFaceAndOrder( anEdge, NullFace, Order );
215 myBoundary.Append( EdgeFaceAndOrder );
216 TopTools_ListOfShape EmptyList;
217 myOldNewMap.Bind(anEdge, EmptyList);
218 return myBoundary.Length();
222 myConstraints.Append( EdgeFaceAndOrder );
223 return (myBoundary.Length() + myFreeConstraints.Length() + myConstraints.Length());
227 //=======================================================================
229 //purpose : adds an edge with supporting face as a constraint
230 //======================================================================
231 Standard_Integer BRepFill_Filling::Add( const TopoDS_Edge& anEdge,
232 const TopoDS_Face& Support,
233 const GeomAbs_Shape Order,
234 const Standard_Boolean IsBound )
236 BRepFill_EdgeFaceAndOrder EdgeFaceAndOrder( anEdge, Support, Order );
239 myBoundary.Append( EdgeFaceAndOrder );
240 TopTools_ListOfShape EmptyList;
241 myOldNewMap.Bind(anEdge, EmptyList);
242 return myBoundary.Length();
246 myConstraints.Append( EdgeFaceAndOrder );
247 return (myBoundary.Length() + myFreeConstraints.Length() + myConstraints.Length());
251 //=======================================================================
253 //purpose : adds a "free constraint": face without edge
254 //======================================================================
255 Standard_Integer BRepFill_Filling::Add( const TopoDS_Face& Support,
256 const GeomAbs_Shape Order )
258 BRepFill_FaceAndOrder FaceAndOrder( Support, Order );
259 myFreeConstraints.Append( FaceAndOrder );
260 return (myBoundary.Length() + myFreeConstraints.Length());
263 //=======================================================================
265 //purpose : adds a point constraint
266 //======================================================================
267 Standard_Integer BRepFill_Filling::Add( const gp_Pnt& Point )
269 Handle( GeomPlate_PointConstraint ) aPC = new GeomPlate_PointConstraint( Point, GeomAbs_C0, myTol3d );
270 myPoints.Append( aPC );
271 return (myBoundary.Length() + myFreeConstraints.Length() + myConstraints.Length() + myPoints.Length());
274 //=======================================================================
276 //purpose : adds a point constraint on a face
277 //======================================================================
278 Standard_Integer BRepFill_Filling::Add( const Standard_Real U,
279 const Standard_Real V,
280 const TopoDS_Face& Support,
281 const GeomAbs_Shape Order )
283 Handle( BRepAdaptor_HSurface ) HSurf = new BRepAdaptor_HSurface();
284 HSurf->ChangeSurface().Initialize( Support );
285 Handle( GeomPlate_PointConstraint ) aPC =
286 new GeomPlate_PointConstraint( U, V, BRep_Tool::Surface( HSurf->ChangeSurface().Face() ), Order,
287 myTol3d, myTolAng, myTolCurv );
288 myPoints.Append( aPC );
289 return (myBoundary.Length() + myFreeConstraints.Length() + myConstraints.Length() + myPoints.Length());
293 //=======================================================================
294 //function : AddConstraints
296 //======================================================================
297 void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder& SeqOfConstraints )
301 GeomAbs_Shape CurOrder;
303 Handle(GeomPlate_CurveConstraint) Constr;
305 for (i = 1; i <= SeqOfConstraints.Length(); i++)
307 CurEdge = SeqOfConstraints(i).myEdge;
308 CurFace = SeqOfConstraints(i).myFace;
309 CurOrder = SeqOfConstraints(i).myOrder;
311 if (CurFace.IsNull()) {
312 if (CurOrder == GeomAbs_C0) {
313 Handle( BRepAdaptor_HCurve ) HCurve = new BRepAdaptor_HCurve();
314 HCurve->ChangeCurve().Initialize( CurEdge );
316 Constr = new BRepFill_CurveConstraint(HCurve,
321 else { // Pas de representation Topologique
322 // On prend une representation Geometrique : au pif !
323 Handle( Geom_Surface ) Surface;
324 Handle( Geom2d_Curve ) C2d;
327 BRep_Tool::CurveOnSurface( CurEdge, C2d, Surface, loc, f, l);
328 if (Surface.IsNull()) {
329 Standard_Failure::Raise( "Add" );
332 Surface = Handle(Geom_Surface)::DownCast(Surface->Copy());
333 Surface->Transform(loc.Transformation());
334 Handle( GeomAdaptor_HSurface ) Surf = new GeomAdaptor_HSurface(Surface);
335 Handle( Geom2dAdaptor_HCurve ) Curve2d = new Geom2dAdaptor_HCurve(C2d);
337 Adaptor3d_CurveOnSurface CurvOnSurf( Curve2d, Surf );
338 Handle (Adaptor3d_HCurveOnSurface) HCurvOnSurf = new Adaptor3d_HCurveOnSurface( CurvOnSurf );
340 Constr = new GeomPlate_CurveConstraint(HCurvOnSurf,
350 Handle( BRepAdaptor_HSurface ) Surf = new BRepAdaptor_HSurface();
351 Surf->ChangeSurface().Initialize( CurFace );
352 Handle( BRepAdaptor_HCurve2d ) Curve2d = new BRepAdaptor_HCurve2d();
353 Curve2d->ChangeCurve2d().Initialize( CurEdge, CurFace );
354 // If CurEdge has no 2d representation on CurFace,
355 // there will be exception "Attempt to access to null object"
356 // in this initialization (null pcurve).
357 Adaptor3d_CurveOnSurface CurvOnSurf( Curve2d, Surf );
358 Handle (Adaptor3d_HCurveOnSurface) HCurvOnSurf = new Adaptor3d_HCurveOnSurface( CurvOnSurf );
360 Constr = new BRepFill_CurveConstraint( HCurvOnSurf,
367 if (myIsInitFaceGiven)
369 Handle( Geom2d_Curve ) Curve2d;
370 Standard_Real FirstPar, LastPar;
371 Curve2d = BRep_Tool::CurveOnSurface( CurEdge, myInitFace, FirstPar, LastPar );
372 if (! Curve2d.IsNull())
374 Curve2d = new Geom2d_TrimmedCurve( Curve2d, FirstPar, LastPar );
375 Constr->SetCurve2dOnSurf( Curve2d );
378 myBuilder.Add( Constr );
382 //=======================================================================
383 //function : BuildWires
385 //======================================================================
386 void BRepFill_Filling::BuildWires( TopTools_ListOfShape& EdgeList, TopTools_ListOfShape& WireList )
390 TopTools_ListIteratorOfListOfShape Itl;
391 Standard_Integer i, j;
393 while (! EdgeList.IsEmpty())
396 TopoDS_Edge FirstEdge = TopoDS::Edge(EdgeList.First());
398 EdgeList.RemoveFirst();
399 TopoDS_Vertex V_wire[2], V_edge[2];
403 TopoDS_Wire CurWire = MW.Wire();
404 TopExp::Vertices(CurWire, V_wire[0], V_wire[1]);
405 Standard_Boolean found = Standard_False;
406 for (Itl.Initialize( EdgeList ); Itl.More(); Itl.Next())
408 TopoDS_Edge CurEdge = TopoDS::Edge(Itl.Value());
409 TopExp::Vertices(CurEdge, V_edge[0], V_edge[1]);
410 for (i = 0; i < 2; i++)
412 for (j = 0; j < 2; j++)
413 if (V_wire[i].IsSame(V_edge[j]))
416 EdgeList.Remove(Itl);
417 found = Standard_True;
426 if (!found) //try to find geometric coincidence
429 P_wire[0] = BRep_Tool::Pnt(V_wire[0]);
430 P_wire[1] = BRep_Tool::Pnt(V_wire[1]);
431 for (Itl.Initialize( EdgeList ); Itl.More(); Itl.Next())
433 TopoDS_Edge CurEdge = TopoDS::Edge(Itl.Value());
434 TopExp::Vertices(CurEdge, V_edge[0], V_edge[1]);
435 for (i = 0; i < 2; i++)
437 for (j = 0; j < 2; j++)
439 Standard_Real aDist = P_wire[i].Distance(BRep_Tool::Pnt(V_edge[j]));
440 if (aDist < BRep_Tool::Tolerance(V_wire[i]) &&
441 aDist < BRep_Tool::Tolerance(V_edge[j]))
444 myOldNewMap(CurEdge).Append(MW.Edge());
445 EdgeList.Remove(Itl);
446 found = Standard_True;
457 if (!found) //end of current wire, begin next wire
459 WireList.Append( MW.Wire() );
463 } //end of while (! EdgeList.IsEmpty())
466 //=======================================================================
467 //function : FindExtremitiesOfHoles
469 //======================================================================
470 void BRepFill_Filling::FindExtremitiesOfHoles(const TopTools_ListOfShape& WireList,
471 TopTools_SequenceOfShape& VerSeq ) const
473 TopTools_SequenceOfShape WireSeq;
474 TopTools_ListIteratorOfListOfShape Itl(WireList);
475 for (; Itl.More(); Itl.Next())
476 WireSeq.Append(Itl.Value());
479 theWire = TopoDS::Wire(WireSeq(1));
482 if (theWire.Closed())
485 TopoDS_Vertex Vfirst, Vlast;
486 TopExp::Vertices( theWire, Vfirst, Vlast );
487 gp_Vec FinVec = MakeFinVec( theWire, Vlast );
488 TopoDS_Vertex theVertex = Vlast;
489 VerSeq.Append( Vlast );
491 while (! WireSeq.IsEmpty())
493 TopoDS_Vertex MinVtx;
494 Standard_Integer i, MinInd = 1;
495 Standard_Boolean IsLast = Standard_False;
496 Standard_Real MinAngle = M_PI;
498 for (i = 1; i <= WireSeq.Length(); i++)
500 const TopoDS_Wire& CurWire = TopoDS::Wire( WireSeq(i) );
501 TopExp::Vertices( CurWire, Vfirst, Vlast );
503 Standard_Real angle =
504 FinVec.Angle(gp_Vec(BRep_Tool::Pnt(theVertex), BRep_Tool::Pnt(Vfirst)));
505 if (angle < MinAngle)
510 IsLast = Standard_True;
512 angle = FinVec.Angle(gp_Vec(BRep_Tool::Pnt(theVertex), BRep_Tool::Pnt(Vlast)));
513 if (angle < MinAngle)
518 IsLast = Standard_False;
521 VerSeq.Append( MinVtx );
522 const TopoDS_Wire& MinWire = TopoDS::Wire(WireSeq(MinInd));
523 TopExp::Vertices( MinWire, Vfirst, Vlast );
526 FinVec = MakeFinVec( MinWire, Vlast );
531 FinVec = MakeFinVec( MinWire, Vfirst );
534 VerSeq.Append( theVertex );
535 WireSeq.Remove(MinInd);
537 TopExp::Vertices( theWire, Vfirst, Vlast );
538 VerSeq.Append( Vfirst );
541 //=======================================================================
543 //purpose : builds the resulting face
544 //======================================================================
545 void BRepFill_Filling::Build()
547 GeomPlate_BuildPlateSurface thebuild( myDegree, myNbPtsOnCur, myNbIter,
548 myTol2d, myTol3d, myTolAng, myTolCurv, myAnisotropie );
550 myBuilder = thebuild;
553 Standard_Integer i, j;
555 //Creating array of vertices: extremities of wires
556 TopTools_SequenceOfShape VerSeq;
558 //Building missing bounds
559 TopTools_ListOfShape EdgeList, WireList;
560 for (i = 1; i <= myBoundary.Length(); i++)
561 EdgeList.Append( myBoundary(i).myEdge );
563 BuildWires( EdgeList, WireList );
564 FindExtremitiesOfHoles( WireList, VerSeq );
566 //Searching for surfaces for missing bounds
567 for (j = 1; j <= myFreeConstraints.Length(); j++)
569 GeomAPI_ProjectPointOnSurf Projector;
570 Quantity_Parameter U1, V1, U2, V2;
572 CurFace = myFreeConstraints(j).myFace;
573 Handle( BRepAdaptor_HSurface ) HSurf = new BRepAdaptor_HSurface();
574 HSurf->ChangeSurface().Initialize( CurFace );
575 Handle( Geom_Surface ) CurSurface = BRep_Tool::Surface( HSurf->ChangeSurface().Face() );
576 //BRepTopAdaptor_FClass2d Classifier( CurFace, Precision::Confusion() );
578 for (i = 1; i <= VerSeq.Length(); i += 2)
580 const TopoDS_Vertex& FirstVtx = TopoDS::Vertex(VerSeq(i));
581 const TopoDS_Vertex& LastVtx = TopoDS::Vertex(VerSeq(i+1));
583 gp_Pnt FirstPnt = BRep_Tool::Pnt(FirstVtx);
584 Projector.Init( FirstPnt, CurSurface );
585 if (Projector.LowerDistance() > Precision::Confusion())
587 Projector.LowerDistanceParameters( U1, V1 );
590 State = Classifier.Perform(gp_Pnt2d( U1, V1 ),
591 ((HSurf->IsUPeriodic() || HSurf->IsVPeriodic())? Standard_True : Standard_False));
592 if (State == TopAbs_OUT || State == TopAbs_UNKNOWN)
596 gp_Pnt LastPnt = BRep_Tool::Pnt(LastVtx);
597 Projector.Init( LastPnt, CurSurface );
598 if (Projector.LowerDistance() > Precision::Confusion())
600 Projector.LowerDistanceParameters( U2, V2 );
603 State = Classifier.Perform(gp_Pnt2d( U2, V2 ),
604 ((HSurf->IsUPeriodic() || HSurf->IsVPeriodic())? Standard_True : Standard_False));
605 if (State == TopAbs_OUT || State == TopAbs_UNKNOWN)
609 //Making the constraint
610 TColgp_Array1OfPnt2d Points( 1, 2 );
611 Points(1) = gp_Pnt2d( U1, V1 );
612 Points(2) = gp_Pnt2d( U2, V2 );
613 Handle( Geom2d_BezierCurve ) Line2d = new Geom2d_BezierCurve( Points );
614 TopoDS_Edge E = BRepLib_MakeEdge( Line2d, CurSurface, FirstVtx, LastVtx );
615 Add( E, CurFace, myFreeConstraints(j).myOrder );
616 VerSeq.Remove( i, i+1 );
618 } //for (i = 1; i <= VerSeq.Length(); i += 2)
619 } //for (j = 1; j <= myFreeConstraints.Length(); j++)
621 //Load initial surface to myBuilder if it is given
622 if (myIsInitFaceGiven)
624 Handle( BRepAdaptor_HSurface ) HSurfInit = new BRepAdaptor_HSurface();
625 HSurfInit->ChangeSurface().Initialize( myInitFace );
626 myBuilder.LoadInitSurface( BRep_Tool::Surface( HSurfInit->ChangeSurface().Face() ) );
629 //Adding constraints to myBuilder
630 AddConstraints( myBoundary );
631 myBuilder.SetNbBounds( myBoundary.Length() );
632 AddConstraints( myConstraints );
633 for (i = 1; i <= myPoints.Length(); i++)
634 myBuilder.Add( myPoints(i) );
637 if (myBuilder.IsDone())
638 myIsDone = Standard_True;
641 myIsDone = Standard_False;
645 Handle( GeomPlate_Surface ) GPlate = myBuilder.Surface();
646 Handle( Geom_BSplineSurface ) Surface;
648 Standard_Real dmax = 1.1 * myBuilder.G0Error(); //???????????
649 //Standard_Real dmax = myTol3d;
650 if (! myIsInitFaceGiven)
652 Standard_Real seuil; //?????
654 TColgp_SequenceOfXY S2d;
655 TColgp_SequenceOfXYZ S3d;
656 myBuilder.Disc2dContour(4,S2d);
657 myBuilder.Disc3dContour(4,0,S3d);
658 seuil = Max( myTol3d, 10*myBuilder.G0Error() ); //????????
659 GeomPlate_PlateG0Criterion Criterion( S2d, S3d, seuil );
660 GeomPlate_MakeApprox Approx( GPlate, Criterion, myTol3d, myMaxSegments, myMaxDeg );
661 Surface = Approx.Surface();
665 GeomPlate_MakeApprox Approx( GPlate, myTol3d, myMaxSegments, myMaxDeg, dmax, 0 ); //?????????????
666 //GeomConvert_ApproxSurface Approx( GPlate, myTol3d, GeomAbs_C1, GeomAbs_C1, myMaxDeg, myMaxDeg, myMaxSegments, 1 );
667 //Approx.Dump( cout );
668 Surface = Approx.Surface();
671 //Build the final wire and final face
672 TopTools_ListOfShape FinalEdges;
673 Handle(TColGeom2d_HArray1OfCurve) CurvesOnPlate = myBuilder.Curves2d();
675 for (i = 1; i <= myBoundary.Length(); i++)
677 const TopoDS_Edge& InitEdge = myBoundary(i).myEdge;
678 TopoDS_Edge anEdge = InitEdge;
679 if (!myOldNewMap(anEdge).IsEmpty())
680 anEdge = TopoDS::Edge( myOldNewMap(anEdge).First() );
681 Handle(Geom2d_Curve) aCurveOnPlate = CurvesOnPlate->Value(i);
683 TopoDS_Edge NewEdge = TopoDS::Edge(anEdge.EmptyCopied());
685 TopoDS_Vertex V1, V2;
686 TopExp::Vertices(anEdge, V1, V2, Standard_True); //with orientation
687 BB.UpdateVertex(V1, dmax);
688 BB.UpdateVertex(V2, dmax);
692 BB.UpdateEdge(NewEdge, aCurveOnPlate, Surface, Loc, dmax);
693 //BRepLib::SameRange(NewEdge);
694 BRepLib::SameParameter(NewEdge, dmax, Standard_True);
695 FinalEdges.Append(NewEdge);
696 myOldNewMap(InitEdge).Clear();
697 myOldNewMap(InitEdge).Append(NewEdge);
700 TopoDS_Wire FinalWire = WireFromList(FinalEdges);
701 if (!(FinalWire.Closed()))
702 Standard_Failure::Raise("Wire is not closed");
704 myFace = BRepLib_MakeFace( Surface, FinalWire );
707 //=======================================================================
710 //======================================================================
711 Standard_Boolean BRepFill_Filling::IsDone() const
716 //=======================================================================
718 //purpose : returns the result
719 //======================================================================
720 TopoDS_Face BRepFill_Filling::Face() const
725 //=======================================================================
726 //function : Generated
727 //purpose : returns the new edge (first in list) made from old edge "S"
728 //=======================================================================
729 const TopTools_ListOfShape& BRepFill_Filling::Generated(const TopoDS_Shape& S)
733 if (myOldNewMap.IsBound(S))
734 myGenerated.Append(myOldNewMap(S));
739 //==========================================================================
741 //purpose : returns maximum distance from boundary to the resulting surface
742 //==========================================================================
743 Standard_Real BRepFill_Filling::G0Error() const
745 return myBuilder.G0Error();
748 //=======================================================================
750 //purpose : returns maximum angle between the resulting surface
751 // and constraint surfaces at boundaries
752 //======================================================================
753 Standard_Real BRepFill_Filling::G1Error() const
755 return myBuilder.G1Error();
758 //=======================================================================
760 //purpose : returns maximum difference of curvature between
761 // the resulting surface and constraint surfaces at boundaries
762 //======================================================================
763 Standard_Real BRepFill_Filling::G2Error() const
765 return myBuilder.G2Error();
768 //==========================================================================
770 //purpose : returns maximum distance between the constraint number Index
771 // and the resulting surface
772 //==========================================================================
773 Standard_Real BRepFill_Filling::G0Error( const Standard_Integer Index )
775 return myBuilder.G0Error( Index );
778 //==========================================================================
780 //purpose : returns maximum angle between the constraint number Index
781 // and the resulting surface
782 //==========================================================================
783 Standard_Real BRepFill_Filling::G1Error( const Standard_Integer Index )
785 return myBuilder.G1Error( Index );
788 //==========================================================================
790 //purpose : returns maximum difference of curvature between
791 // the constraint number Index and the resulting surface
792 //==========================================================================
793 Standard_Real BRepFill_Filling::G2Error( const Standard_Integer Index )
795 return myBuilder.G2Error( Index );