1 // Created on: 1995-12-11
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-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 <BRepCheck_Edge.ixx>
18 #include <TColStd_Array1OfTransient.hxx>
20 #include <BRepCheck_ListOfStatus.hxx>
21 #include <BRepCheck_ListIteratorOfListOfStatus.hxx>
23 #include <BRep_TEdge.hxx>
24 #include <BRep_TFace.hxx>
26 #include <BRep_CurveRepresentation.hxx>
27 #include <BRep_ListOfCurveRepresentation.hxx>
28 #include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
29 #include <BRep_GCurve.hxx>
30 #include <BRep_CurveOnSurface.hxx>
32 #include <BRep_Tool.hxx>
34 #include <TopExp_Explorer.hxx>
36 #include <Geom_Surface.hxx>
37 #include <Geom_RectangularTrimmedSurface.hxx>
38 #include <Geom_Plane.hxx>
39 #include <Geom_TrimmedCurve.hxx>
40 #include <Geom2d_Curve.hxx>
42 #include <Geom2dAdaptor_HCurve.hxx>
43 #include <GeomAdaptor_Curve.hxx>
44 #include <GeomAdaptor_HCurve.hxx>
45 #include <GeomAdaptor_HSurface.hxx>
46 #include <Adaptor3d_CurveOnSurface.hxx>
47 #include <Adaptor3d_HCurveOnSurface.hxx>
49 #include <ProjLib_ProjectedCurve.hxx>
50 #include <GeomProjLib.hxx>
51 #include <Extrema_LocateExtPC.hxx>
53 #include <BRepCheck.hxx>
54 #include <Geom2dAdaptor.hxx>
56 #include <TopAbs_ShapeEnum.hxx>
57 #include <TopoDS_Face.hxx>
58 #include <Precision.hxx>
61 //modified by NIZNHY-PKV Thu May 05 09:01:57 2011f
63 Standard_Boolean Validate(const Adaptor3d_Curve&,
64 const Adaptor3d_CurveOnSurface&,
66 const Standard_Boolean);
68 void PrintProblematicPoint(const gp_Pnt&,
73 Standard_Real Prec(const Adaptor3d_Curve& aAC3D,
74 const Adaptor3d_CurveOnSurface& aACS);
76 Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D);
78 Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS);
80 //static Standard_Boolean Validate(const Adaptor3d_Curve&,
81 // const Adaptor3d_Curve&,
82 // const Standard_Real,
83 // const Standard_Boolean);
84 //modified by NIZNHY-PKV Thu May 05 09:02:01 2011t
88 //=======================================================================
89 //function : BRepCheck_Edge
91 //=======================================================================
93 BRepCheck_Edge::BRepCheck_Edge(const TopoDS_Edge& E)
96 myGctrl = Standard_True;
99 //=======================================================================
102 //=======================================================================
104 void BRepCheck_Edge::Minimum()
108 BRepCheck_ListOfStatus thelist;
109 myMap.Bind(myShape, thelist);
110 BRepCheck_ListOfStatus& lst = myMap(myShape);
113 // Existence et unicite d`une representation 3D
114 Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&myShape.TShape());
115 BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
116 Standard_Boolean exist = Standard_False;
117 Standard_Boolean unique = Standard_True;
118 // Search for a 3D reference. If no existent one, creates it with the
119 // first encountered CurveOnSurf; if multiple, chooses the first one...
121 Standard_Boolean Degenerated = TE->Degenerated();
122 Standard_Boolean SameParameter = TE->SameParameter();
123 Standard_Boolean SameRange = TE->SameRange();
124 if (!SameRange && SameParameter) {
125 BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
127 // Handle(Geom_Curve) C3d;
129 while (itcr.More()) {
130 const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
131 if (cr->IsCurve3D()) {
133 exist = Standard_True;
136 unique = Standard_False;
138 if (myCref.IsNull() && !cr->Curve3D().IsNull()) {
146 BRepCheck::Add(lst,BRepCheck_No3DCurve);
150 BRepCheck::Add(lst,BRepCheck_Multiple3DCurve);
153 if (myCref.IsNull() && !Degenerated) {
154 itcr.Initialize(TE->Curves());
155 while (itcr.More()) {
156 const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
157 if (cr->IsCurveOnSurface()) {
164 else if (!myCref.IsNull() && Degenerated){
165 BRepCheck::Add(lst,BRepCheck_InvalidDegeneratedFlag);
168 if (!myCref.IsNull()) {
169 const Handle(BRep_GCurve)& GCref = *((Handle(BRep_GCurve)*)&myCref);
170 Standard_Real First,Last;
171 GCref->Range(First,Last);
174 BRepCheck::Add(lst,BRepCheck_InvalidRange);
177 if (myCref->IsCurve3D()) {
178 // eap 6 Jun 2002 occ332
179 // better transform C3d instead of transforming Surf upto C3d initial location,
180 // on transformed BSpline surface 'same parameter' may seem wrong
181 TopLoc_Location L = myShape.Location() * myCref->Location();
182 Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
183 (myCref->Curve3D()->Transformed
184 (/*myCref->Location()*/L.Transformation()));
185 GeomAdaptor_Curve GAC3d(C3d,First,Last);
186 myHCurve = new GeomAdaptor_HCurve(GAC3d);
188 else { // curve on surface
189 Handle(Geom_Surface) Sref = myCref->Surface();
190 Sref = Handle(Geom_Surface)::DownCast
191 (Sref->Transformed(myCref->Location().Transformation()));
192 const Handle(Geom2d_Curve)& PCref = myCref->PCurve();
193 Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
194 Handle(Geom2dAdaptor_HCurve) GHPCref =
195 new Geom2dAdaptor_HCurve(PCref,First,Last);
196 Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
197 myHCurve = new Adaptor3d_HCurveOnSurface(ACSref);
202 lst.Append(BRepCheck_NoError);
204 myMin = Standard_True;
209 //=======================================================================
210 //function : InContext
212 //=======================================================================
214 void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
216 if (myMap.IsBound(S)) {
219 BRepCheck_ListOfStatus thelist;
220 myMap.Bind(S, thelist);
221 BRepCheck_ListOfStatus& lst = myMap(S);
223 Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&myShape.TShape());
224 Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape));
226 TopAbs_ShapeEnum styp = S.ShapeType();
227 // for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
228 TopExp_Explorer exp(S,TopAbs_EDGE) ;
229 for ( ; exp.More(); exp.Next()) {
230 if (exp.Current().IsSame(myShape)) {
235 BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape);
241 if (!myCref.IsNull()) {
243 Standard_Boolean SameParameter = TE->SameParameter();
244 Standard_Boolean SameRange = TE->SameRange();
245 // Modified by skv - Tue Apr 27 11:48:13 2004 Begin
246 if (!SameParameter || !SameRange) {
248 BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
250 BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
254 // Modified by skv - Tue Apr 27 11:48:14 2004 End
255 Standard_Real First = myHCurve->FirstParameter();
256 Standard_Real Last = myHCurve->LastParameter();
258 Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &S.TShape());
259 const TopLoc_Location& Floc = S.Location();
260 const TopLoc_Location& TFloc = TF->Location();
261 const Handle(Geom_Surface)& Su = TF->Surface();
262 TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
263 Standard_Boolean pcurvefound = Standard_False;
265 BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
266 while (itcr.More()) {
267 const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
268 if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
269 pcurvefound = Standard_True;
270 const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
274 // Modified by skv - Tue Apr 27 11:50:35 2004 Begin
275 // if (SameRange && (fabs(f-First) > Precision::PConfusion() || fabs(l-Last)> Precision::PConfusion())) { //f != First || l != Last)) { gka OCC
276 if (fabs(f-First) > Precision::PConfusion() ||
277 fabs(l-Last) > Precision::PConfusion()) {
278 BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
279 BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
280 // if (SameParameter) {
281 // BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
284 // Modified by skv - Tue Apr 27 11:50:37 2004 End
286 Handle(Geom_Surface) Sb = cr->Surface();
287 Sb = Handle(Geom_Surface)::DownCast
288 // (Su->Transformed(L.Transformation()));
289 (Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
290 Handle(Geom2d_Curve) PC = cr->PCurve();
291 Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
292 Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
293 Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
294 Standard_Boolean ok =
295 Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
297 if (cr->IsCurveOnClosedSurface()) {
298 BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
301 BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
303 // Modified by skv - Tue Apr 27 11:53:00 2004 Begin
304 BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
305 // if (SameParameter) {
306 // BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
308 // Modified by skv - Tue Apr 27 11:53:01 2004 End
310 if (cr->IsCurveOnClosedSurface()) {
311 GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
312 ACS.Load(GAHS); // sans doute inutile
313 ACS.Load(GHPC); // meme remarque...
314 ok = Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
316 BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
317 // Modified by skv - Tue Apr 27 11:53:20 2004 Begin
319 BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
321 // Modified by skv - Tue Apr 27 11:53:23 2004 End
330 Handle(Geom_Plane) P;
331 Handle(Standard_Type) dtyp = Su->DynamicType();
332 if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
333 P = Handle(Geom_Plane)::DownCast
334 (Handle(Geom_RectangularTrimmedSurface)::
335 DownCast(Su)->BasisSurface());
338 P = Handle(Geom_Plane)::DownCast(Su);
340 if (P.IsNull()) { // not a plane
341 BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
343 else { // on fait la projection a la volee, comme BRep_Tool
346 P = Handle(Geom_Plane)::
347 DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
348 //on projette Cref sur ce plan
349 Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
351 // Dub - Normalement myHCurve est une GeomAdaptor_HCurve
352 GeomAdaptor_Curve& Gac =
353 Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
354 Handle(Geom_Curve) C3d = Gac.Curve();
355 Handle(Geom_Curve) ProjOnPlane =
356 GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
357 P, P->Position().Direction(),
359 Handle(GeomAdaptor_HCurve) aHCurve =
360 new GeomAdaptor_HCurve(ProjOnPlane);
362 ProjLib_ProjectedCurve proj(GAHS,aHCurve);
363 Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
364 Handle(Geom2dAdaptor_HCurve) GHPC =
365 new Geom2dAdaptor_HCurve(PC,
366 myHCurve->FirstParameter(),
367 myHCurve->LastParameter());
369 Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
371 Standard_Boolean ok = Validate(myHCurve->Curve(),ACS,
372 Tol,Standard_True); // voir dub...
374 BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
383 // on verifie que l`edge est bien connectee 2 fois (pas de bord libre)
384 Standard_Integer nbconnection = 0;
385 //TopExp_Explorer exp;
386 for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next()) {
387 const TopoDS_Face& fac = TopoDS::Face(exp.Current());
388 TopExp_Explorer exp2;
389 for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next()) {
390 if (exp2.Current().IsSame(myShape)) {
395 if (nbconnection < 2 && !TE->Degenerated()) {
396 BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
398 else if (nbconnection > 2) {
399 BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
402 BRepCheck::Add(myMap(S),BRepCheck_NoError);
409 if (myMap(S).IsEmpty()) {
410 myMap(S).Append(BRepCheck_NoError);
415 //=======================================================================
418 //=======================================================================
420 void BRepCheck_Edge::Blind()
422 // Modified by skv - Tue Apr 27 11:36:01 2004 Begin
423 // The body of this function is removed because of its useless.
425 myBlind = Standard_True;
427 // Modified by skv - Tue Apr 27 11:36:02 2004 End
431 //=======================================================================
432 //function : GeometricControls
434 //=======================================================================
436 void BRepCheck_Edge::GeometricControls(const Standard_Boolean B)
442 //=======================================================================
443 //function : GeometricControls
445 //=======================================================================
447 Standard_Boolean BRepCheck_Edge::GeometricControls() const
455 //=======================================================================
456 //function : Tolerance
458 //=======================================================================
460 Standard_Real BRepCheck_Edge::Tolerance()
462 Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&myShape.TShape());
463 Standard_Integer it, iRep=1, nbRep=(TE->Curves()).Extent();
465 return Precision::Confusion();
467 TColStd_Array1OfTransient theRep(1, nbRep*2);
468 Standard_Real First, Last;
469 if (!myHCurve.IsNull()) {
470 First = myHCurve->FirstParameter();
471 Last= myHCurve->LastParameter();
474 BRep_Tool::Range(TopoDS::Edge(myShape), First, Last);
477 BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
478 for (; itcr.More(); itcr.Next()) {
479 const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
480 if (cr->IsCurve3D() && !TE->Degenerated()) {
481 //// modified by jgv, 20.03.03 ////
482 TopLoc_Location Loc = myShape.Location() * cr->Location();
483 Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
484 (cr->Curve3D()->Transformed( Loc.Transformation() ));
485 ///////////////////////////////////
486 GeomAdaptor_Curve GAC3d(C3d,First,Last);
489 theRep(iRep)=theRep(1);
492 theRep(it) = new GeomAdaptor_HCurve(GAC3d);
495 else if (cr->IsCurveOnSurface()) {
497 Handle(Geom_Surface) Sref = cr->Surface();
498 //// modified by jgv, 20.03.03 ////
499 TopLoc_Location Loc = myShape.Location() * cr->Location();
500 Sref = Handle(Geom_Surface)::DownCast
501 (Sref->Transformed( Loc.Transformation() ));
502 ///////////////////////////////////
503 const Handle(Geom2d_Curve)& PCref = cr->PCurve();
504 Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
505 Handle(Geom2dAdaptor_HCurve) GHPCref =
506 new Geom2dAdaptor_HCurve(PCref,First,Last);
507 Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
508 theRep(iRep) = new Adaptor3d_HCurveOnSurface(ACSref);
511 if (cr->IsCurveOnClosedSurface()) {
512 Handle(Geom_Surface) Sref = cr->Surface();
513 Sref = Handle(Geom_Surface)::DownCast
514 (Sref->Transformed(cr->Location().Transformation()));
515 const Handle(Geom2d_Curve)& PCref = cr->PCurve2();
516 Handle(GeomAdaptor_HSurface) GAHSref = new GeomAdaptor_HSurface(Sref);
517 Handle(Geom2dAdaptor_HCurve) GHPCref =
518 new Geom2dAdaptor_HCurve(PCref,First,Last);
519 Adaptor3d_CurveOnSurface ACSref(GHPCref,GAHSref);
520 theRep(iRep) = new Adaptor3d_HCurveOnSurface(ACSref);
530 Standard_Real dist2, tol2, tolCal=0., prm;
533 for (i= 0; i< NCONTROL; i++) {
534 prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
536 center=(*(Handle(Adaptor3d_HCurve)*)&theRep(1))->Value(prm);
537 for (iRep=2; iRep<=nbRep; iRep++) {
538 othP=(*(Handle(Adaptor3d_HCurve)*)&theRep(iRep))->Value(prm);
539 dist2=center.SquareDistance(othP);
540 if (dist2>tolCal) tolCal=dist2;
546 // On prend 5% de marge car au dessus on crontrole severement
547 return sqrt(tolCal)*1.05;
550 //=======================================================================
551 //function : Validate
553 //=======================================================================
554 Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
555 const Adaptor3d_CurveOnSurface& Other,
556 const Standard_Real Tol,
557 const Standard_Boolean SameParameter)
559 Standard_Boolean Status, proj;
560 Standard_Real aPC, First, Last, Error;
561 gp_Pnt problematic_point ;
563 Status = Standard_True;
565 First = CRef.FirstParameter();
566 Last = CRef.LastParameter();
568 aPC=Precision::PConfusion();
569 proj = (!SameParameter ||
570 fabs(Other.FirstParameter()-First) > aPC ||
571 fabs( Other.LastParameter()-Last) > aPC);
574 Standard_Real Tol2, prm, dD;
576 //modified by NIZNHY-PKV Thu May 05 09:06:41 2011f
578 dD=Prec(CRef, Other);//3.e-15;
582 //modified by NIZNHY-PKV Thu May 05 09:06:47 2011t
584 for (i = 0; i< NCONTROL; ++i) {
585 prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
586 pref = CRef.Value(prm);
587 pother = Other.Value(prm);
588 if (pref.SquareDistance(pother) > Tol2) {
589 problematic_point = pref ;
590 Status = Standard_False;
591 Error = pref.Distance(pother);
592 PrintProblematicPoint(problematic_point, Error, Tol);
599 Extrema_LocateExtPC refd,otherd;
600 Standard_Real OFirst = Other.FirstParameter();
601 Standard_Real OLast = Other.LastParameter();
602 gp_Pnt pd = CRef.Value(First);
603 gp_Pnt pdo = Other.Value(OFirst);
604 Standard_Real distt = pd.SquareDistance(pdo);
605 if (distt > Tol*Tol) {
606 problematic_point = pd ;
607 Status = Standard_False ;
609 PrintProblematicPoint(problematic_point, Error, Tol);
613 pd = CRef.Value(Last);
614 pdo = Other.Value(OLast);
615 distt = pd.SquareDistance(pdo);
616 if (distt > Tol*Tol) {
617 problematic_point = pd ;
618 Status = Standard_False ;
620 PrintProblematicPoint(problematic_point, Error, Tol);
625 refd.Initialize(CRef,First,Last,CRef.Resolution(Tol));
626 otherd.Initialize(Other,OFirst,OLast,Other.Resolution(Tol));
627 for (Standard_Integer i = 2; i< NCONTROL-1; i++) {
628 Standard_Real rprm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
629 gp_Pnt pref = CRef.Value(rprm);
630 Standard_Real oprm = ((NCONTROL-1-i)*OFirst + i*OLast)/(NCONTROL-1);
631 gp_Pnt pother = Other.Value(oprm);
632 refd.Perform(pother,rprm);
633 if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol) {
634 problematic_point = pref ;
635 Status = Standard_False ;
637 Error = sqrt (refd.SquareDistance());
642 PrintProblematicPoint(problematic_point, Error, Tol);
646 otherd.Perform(pref,oprm);
647 if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol) {
648 problematic_point = pref ;
649 Status = Standard_False ;
650 if (otherd.IsDone()) {
651 Error = sqrt (otherd.SquareDistance());
656 PrintProblematicPoint(problematic_point, Error, Tol);
666 cout << " **** probleme de SameParameter au point :" << endl;
667 cout << " " << problematic_point.Coord(1) << " "
668 << problematic_point.Coord(2) << " "
669 << problematic_point.Coord(3) << endl ;
670 cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << endl;
678 //=======================================================================
681 //=======================================================================
682 Standard_Real Prec(const Adaptor3d_Curve& aAC3D,
683 const Adaptor3d_CurveOnSurface& aACS)
685 Standard_Real aXEmax, aXC, aXS;
687 aXC=PrecCurve(aAC3D);
688 aXS=PrecSurface(aACS);
689 aXEmax=(aXC>aXS) ? aXC: aXS;
692 //=======================================================================
693 //function : PrecCurve
695 //=======================================================================
696 Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D)
698 Standard_Real aXEmax;
699 GeomAbs_CurveType aCT;
701 aXEmax=RealEpsilon();
704 if (aCT==GeomAbs_Ellipse) {
706 Standard_Real aX[5], aXE;
708 gp_Elips aEL3D=aAC3D.Ellipse();
709 aEL3D.Location().Coord(aX[0], aX[1], aX[2]);
710 aX[3]=aEL3D.MajorRadius();
711 aX[4]=aEL3D.MinorRadius();
713 for (i=0; i<5; ++i) {
722 }//if (aCT=GeomAbs_Ellipse) {
726 //=======================================================================
727 //function : PrecSurface
729 //=======================================================================
730 Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS)
732 Standard_Real aXEmax;
733 GeomAbs_SurfaceType aST;
735 aXEmax=RealEpsilon();
737 const Handle(Adaptor3d_HSurface)& aAHS=aACS.GetSurface();
739 if (aST==GeomAbs_Cone) {
740 gp_Cone aCone=aAHS->Cone();
742 Standard_Real aX[4], aXE;
744 aCone.Location().Coord(aX[0], aX[1], aX[2]);
745 aX[3]=aCone.RefRadius();
747 for (i=0; i<4; ++i) {
756 }//if (aST==GeomAbs_Cone) {
759 //=======================================================================
760 //function : PrintProblematicPoint
762 //=======================================================================
764 void PrintProblematicPoint(const gp_Pnt& problematic_point,
765 const Standard_Real Error,
766 const Standard_Real Tol)
768 cout << " **** probleme de SameParameter au point :" << endl;
769 cout << " " << problematic_point.Coord(1) << " "
770 << problematic_point.Coord(2) << " " << problematic_point.Coord(3) << endl ;
771 cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << endl;
774 void PrintProblematicPoint(const gp_Pnt&,