6 #include <TopoDS_Shape.hxx>
7 #include <TopoDS_Face.hxx>
10 #include <Standard_Real.hxx>
11 #include <Standard_Integer.hxx>
12 #include <BRep_Tool.hxx>
13 #include <Geom_Surface.hxx>
14 #include <Prs3d_ShapeTool.hxx>
17 #include <GeomLProp_SLProps.hxx>
18 #include <IntCurvesFace_ShapeIntersector.hxx>
35 double recovery_tolerance) :
37 direction(direction(0),
42 recovery_tolerance(recovery_tolerance)
46 TopExp_Explorer faceExplorer(sh , TopAbs_FACE);
47 unsigned int n_faces = 0;
48 while (faceExplorer.More())
61 double &mean_curvature,
66 gp_Pnt P0 =
Pnt(origin);
72 gp_Pnt Pproj(0.0,0.0,0.0);
74 Standard_Real Mean_Curvature;
80 IntCurvesFace_ShapeIntersector Inters;
82 Inters.Perform(line,-RealLast(),+RealLast());
86 double av_curvature = 0.0;
87 if (Inters.NbPnt() == 0)
89 unsigned int succeeded = 0;
90 cout<<
"Axis A("<<
Direction<<
") direction projection of point P("<<origin<<
") on shape FAILED!"<<endl;
91 cout<<
"Trying to fix this"<<endl;
95 gp_Lin line1(gpaxis1);
96 IntCurvesFace_ShapeIntersector Inters1;
98 Inters1.Perform(line1,-RealLast(),+RealLast());
101 if (Inters1.NbPnt() > 0)
104 Standard_Real min_distance = 1e15;
105 Standard_Real distance;
106 int lowest_dist_int=0;
107 for (
int i=0; i<Inters1.NbPnt(); ++i)
109 distance =
Pnt(origin).Distance(Inters1.Pnt(i+1));
111 if (distance < min_distance)
113 min_distance = distance;
114 Pproj = Inters1.Pnt(i+1);
115 lowest_dist_int = i+1;
118 average +=
Pnt(Inters1.Pnt(lowest_dist_int));
119 TopoDS_Face face1 = Inters1.Face(lowest_dist_int);
120 Handle(Geom_Surface) SurfToProj1 = BRep_Tool::Surface(face1);
121 GeomLProp_SLProps props1(SurfToProj1, Inters1.UParameter(lowest_dist_int), Inters1.VParameter(lowest_dist_int), 1,
tolerance);
122 gp_Dir Normal1 = props1.Normal();
123 Standard_Real Mean_Curvature1 = props1.MeanCurvature();
125 if (face1.Orientation()==TopAbs_REVERSED)
127 Normal1.SetCoord(-1.0*Normal1.X(),-1.0*Normal1.Y(),-1.0*Normal1.Z());
128 Mean_Curvature1*=-1.0;
130 av_normal +=
Point<3>(Normal1.X(),Normal1.Y(),Normal1.Z());
131 av_curvature += Mean_Curvature1;
136 gp_Lin line2(gpaxis2);
137 IntCurvesFace_ShapeIntersector Inters2;
139 Inters2.Perform(line2,-RealLast(),+RealLast());
142 if (Inters2.NbPnt() > 0)
145 Standard_Real min_distance = 1e15;
146 Standard_Real distance;
147 int lowest_dist_int=0;
148 for (
int i=0; i<Inters2.NbPnt(); ++i)
150 distance =
Pnt(origin).Distance(Inters2.Pnt(i+1));
152 if (distance < min_distance)
154 min_distance = distance;
155 Pproj = Inters2.Pnt(i+1);
156 lowest_dist_int = i+1;
159 average +=
Pnt(Inters2.Pnt(lowest_dist_int));
160 TopoDS_Face face2 = Inters2.Face(lowest_dist_int);
161 Handle(Geom_Surface) SurfToProj2 = BRep_Tool::Surface(face2);
162 GeomLProp_SLProps props2(SurfToProj2, Inters2.UParameter(lowest_dist_int), Inters2.VParameter(lowest_dist_int), 1,
tolerance);
163 gp_Dir Normal2 = props2.Normal();
164 Standard_Real Mean_Curvature2 = props2.MeanCurvature();
166 if (face2.Orientation()==TopAbs_REVERSED)
168 Normal2.SetCoord(-1.0*Normal2.X(),-1.0*Normal2.Y(),-1.0*Normal2.Z());
169 Mean_Curvature2*=-1.0;
171 av_normal +=
Point<3>(Normal2.X(),Normal2.Y(),Normal2.Z());
172 av_curvature += Mean_Curvature2;
177 gp_Lin line3(gpaxis3);
178 IntCurvesFace_ShapeIntersector Inters3;
180 Inters3.Perform(line3,-RealLast(),+RealLast());
183 if (Inters3.NbPnt() > 0)
186 Standard_Real min_distance = 1e15;
187 Standard_Real distance;
188 int lowest_dist_int=0;
189 for (
int i=0; i<Inters3.NbPnt(); ++i)
191 distance =
Pnt(origin).Distance(Inters3.Pnt(i+1));
193 if (distance < min_distance)
195 min_distance = distance;
196 Pproj = Inters3.Pnt(i+1);
197 lowest_dist_int = i+1;
200 average +=
Pnt(Inters3.Pnt(lowest_dist_int));
201 TopoDS_Face face3 = Inters3.Face(lowest_dist_int);
202 Handle(Geom_Surface) SurfToProj3 = BRep_Tool::Surface(face3);
203 GeomLProp_SLProps props3(SurfToProj3, Inters3.UParameter(lowest_dist_int), Inters3.VParameter(lowest_dist_int), 1,
tolerance);
204 gp_Dir Normal3 = props3.Normal();
205 Standard_Real Mean_Curvature3 = props3.MeanCurvature();
207 if (face3.Orientation()==TopAbs_REVERSED)
209 Normal3.SetCoord(-1.0*Normal3.X(),-1.0*Normal3.Y(),-1.0*Normal3.Z());
210 Mean_Curvature3*=-1.0;
212 av_normal +=
Point<3>(Normal3.X(),Normal3.Y(),Normal3.Z());
213 av_curvature += Mean_Curvature3;
218 gp_Lin line4(gpaxis4);
219 IntCurvesFace_ShapeIntersector Inters4;
221 Inters4.Perform(line4,-RealLast(),+RealLast());
224 if (Inters4.NbPnt() > 0)
227 Standard_Real min_distance = 1e15;
228 Standard_Real distance;
229 int lowest_dist_int=0;
230 for (
int i=0; i<Inters4.NbPnt(); ++i)
232 distance =
Pnt(origin).Distance(Inters4.Pnt(i+1));
234 if (distance < min_distance)
236 min_distance = distance;
237 Pproj = Inters4.Pnt(i+1);
238 lowest_dist_int = i+1;
241 average +=
Pnt(Inters4.Pnt(lowest_dist_int));
242 TopoDS_Face face4 = Inters4.Face(lowest_dist_int);
243 Handle(Geom_Surface) SurfToProj4 = BRep_Tool::Surface(face4);
244 GeomLProp_SLProps props4(SurfToProj4, Inters4.UParameter(lowest_dist_int), Inters4.VParameter(lowest_dist_int), 1,
tolerance);
245 gp_Dir Normal4 = props4.Normal();
246 Standard_Real Mean_Curvature4 = props4.MeanCurvature();
248 if (face4.Orientation()==TopAbs_REVERSED)
250 Normal4.SetCoord(-1.0*Normal4.X(),-1.0*Normal4.Y(),-1.0*Normal4.Z());
251 Mean_Curvature4*=-1.0;
253 av_normal +=
Point<3>(Normal4.X(),Normal4.Y(),Normal4.Z());
254 av_curvature += Mean_Curvature4;
258 cout<<
"Recovery attempt of point projection on surface in given direction FAILED"<<endl;
264 Pproj =
Pnt(average/succeeded);
265 av_normal/=succeeded;
266 Normal.SetCoord(av_normal(0),av_normal(1),av_normal(2));
267 Mean_Curvature = av_curvature/succeeded;
272 Standard_Real min_distance = 1e15;
273 Standard_Real distance;
274 int lowest_dist_int=0;
275 for (
int i=0; i<Inters.NbPnt(); ++i)
277 distance =
Pnt(origin).Distance(Inters.Pnt(i+1));
279 if (distance < min_distance)
281 min_distance = distance;
282 Pproj = Inters.Pnt(i+1);
283 lowest_dist_int = i+1;
286 TopoDS_Face face = Inters.Face(lowest_dist_int);
287 Handle(Geom_Surface) SurfToProj = BRep_Tool::Surface(face);
288 GeomLProp_SLProps props(SurfToProj, Inters.UParameter(lowest_dist_int), Inters.VParameter(lowest_dist_int), 1,
tolerance);
289 Normal = props.Normal();
290 Mean_Curvature = props.MeanCurvature();
292 if (face.Orientation()==TopAbs_REVERSED)
294 Normal.SetCoord(-1.0*Normal.X(),-1.0*Normal.Y(),-1.0*Normal.Z());
295 Mean_Curvature*=-1.0;
301 projection =
Pnt(Pproj);
304 normal(0) = Normal.X();
305 normal(1) = Normal.Y();
306 normal(2) = Normal.Z();
310 mean_curvature = double(Mean_Curvature);
322 gp_Pnt P0 =
Pnt(origin);
327 gp_Pnt Pproj(0.0,0.0,0.0);
333 IntCurvesFace_ShapeIntersector Inters;
336 Inters.Perform(line,-RealLast(),+RealLast());
339 if (Inters.NbPnt() == 0)
341 unsigned int succeeded = 0;
342 cout<<
"Axis A("<<
Direction<<
") direction projection of point P("<<origin<<
") on shape FAILED!"<<endl;
343 cout<<
"Trying to fix this"<<endl;
347 gp_Lin line1(gpaxis1);
348 IntCurvesFace_ShapeIntersector Inters1;
350 Inters1.Perform(line1,-RealLast(),+RealLast());
353 if (Inters1.NbPnt() > 0)
355 Standard_Real min_distance = 1e15;
356 Standard_Real distance;
357 int lowest_dist_int=0;
358 for (
int i=0; i<Inters1.NbPnt(); ++i)
360 distance =
Pnt(origin).Distance(Inters1.Pnt(i+1));
362 if (distance < min_distance)
364 min_distance = distance;
365 Pproj = Inters1.Pnt(i+1);
366 lowest_dist_int = i+1;
369 average +=
Pnt(Inters1.Pnt(lowest_dist_int));
375 gp_Lin line2(gpaxis2);
376 IntCurvesFace_ShapeIntersector Inters2;
378 Inters2.Perform(line2,-RealLast(),+RealLast());
381 if (Inters2.NbPnt() > 0)
383 Standard_Real min_distance = 1e15;
384 Standard_Real distance;
385 int lowest_dist_int=0;
386 for (
int i=0; i<Inters2.NbPnt(); ++i)
388 distance =
Pnt(origin).Distance(Inters2.Pnt(i+1));
390 if (distance < min_distance)
392 min_distance = distance;
393 Pproj = Inters2.Pnt(i+1);
394 lowest_dist_int = i+1;
397 average +=
Pnt(Inters2.Pnt(lowest_dist_int));
403 gp_Lin line3(gpaxis3);
404 IntCurvesFace_ShapeIntersector Inters3;
406 Inters3.Perform(line3,-RealLast(),+RealLast());
409 if (Inters3.NbPnt() > 0)
411 Standard_Real min_distance = 1e15;
412 Standard_Real distance;
413 int lowest_dist_int=0;
414 for (
int i=0; i<Inters3.NbPnt(); ++i)
416 distance =
Pnt(origin).Distance(Inters3.Pnt(i+1));
418 if (distance < min_distance)
420 min_distance = distance;
421 Pproj = Inters3.Pnt(i+1);
422 lowest_dist_int = i+1;
425 average +=
Pnt(Inters3.Pnt(lowest_dist_int));
431 gp_Lin line4(gpaxis4);
432 IntCurvesFace_ShapeIntersector Inters4;
434 Inters4.Perform(line4,-RealLast(),+RealLast());
437 if (Inters4.NbPnt() > 0)
439 Standard_Real min_distance = 1e15;
440 Standard_Real distance;
441 int lowest_dist_int=0;
442 for (
int i=0; i<Inters4.NbPnt(); ++i)
444 distance =
Pnt(origin).Distance(Inters4.Pnt(i+1));
446 if (distance < min_distance)
448 min_distance = distance;
449 Pproj = Inters4.Pnt(i+1);
450 lowest_dist_int = i+1;
453 average +=
Pnt(Inters4.Pnt(lowest_dist_int));
458 cout<<
"Recovery attempt of point projection on surface in given direction FAILED"<<endl;
464 Pproj =
Pnt(average/succeeded);
469 Standard_Real min_distance = 1e15;
470 Standard_Real distance;
471 for (
int i=0; i<Inters.NbPnt(); ++i)
473 distance =
Pnt(origin).Distance(Inters.Pnt(i+1));
475 if (distance < min_distance)
477 min_distance = distance;
478 Pproj = Inters.Pnt(i+1);
484 projection =
Pnt(Pproj);
492 const Point<3> &assigned_axis)
const
496 gp_Pnt P0 =
Pnt(origin);
497 gp_Dir axis(assigned_axis(0),assigned_axis(1),assigned_axis(2));
498 gp_Ax1 gpaxis(P0, axis);
502 gp_Pnt Pproj(0.0,0.0,0.0);
507 IntCurvesFace_ShapeIntersector Inters;
509 Inters.Perform(line,-RealLast(),+RealLast());
512 if (Inters.NbPnt() == 0)
514 unsigned int succeeded = 0;
515 cout<<
"Axis A("<<assigned_axis <<
") direction projection of point P("<<origin<<
") on shape FAILED!"<<endl;
516 cout<<
"Trying to fix this"<<endl;
520 gp_Lin line1(gpaxis1);
521 IntCurvesFace_ShapeIntersector Inters1;
523 Inters1.Perform(line1,-RealLast(),+RealLast());
526 if (Inters1.NbPnt() > 0)
528 Standard_Real min_distance = 1e15;
529 Standard_Real distance;
530 int lowest_dist_int=0;
531 for (
int i=0; i<Inters1.NbPnt(); ++i)
533 distance =
Pnt(origin).Distance(Inters1.Pnt(i+1));
535 if (distance < min_distance)
537 min_distance = distance;
538 Pproj = Inters1.Pnt(i+1);
539 lowest_dist_int = i+1;
543 average +=
Pnt(Inters1.Pnt(lowest_dist_int));
548 gp_Lin line2(gpaxis2);
549 IntCurvesFace_ShapeIntersector Inters2;
551 Inters2.Perform(line2,-RealLast(),+RealLast());
554 if (Inters2.NbPnt() > 0)
556 Standard_Real min_distance = 1e15;
557 Standard_Real distance;
558 int lowest_dist_int=0;
559 for (
int i=0; i<Inters2.NbPnt(); ++i)
561 distance =
Pnt(origin).Distance(Inters2.Pnt(i+1));
563 if (distance < min_distance)
565 min_distance = distance;
566 Pproj = Inters2.Pnt(i+1);
567 lowest_dist_int = i+1;
571 average +=
Pnt(Inters2.Pnt(lowest_dist_int));
575 gp_Lin line3(gpaxis3);
576 IntCurvesFace_ShapeIntersector Inters3;
578 Inters3.Perform(line3,-RealLast(),+RealLast());
581 if (Inters3.NbPnt() > 0)
584 Standard_Real min_distance = 1e15;
585 Standard_Real distance;
586 int lowest_dist_int=0;
587 for (
int i=0; i<Inters3.NbPnt(); ++i)
589 distance =
Pnt(origin).Distance(Inters3.Pnt(i+1));
591 if (distance < min_distance)
593 min_distance = distance;
594 Pproj = Inters3.Pnt(i+1);
595 lowest_dist_int = i+1;
598 average +=
Pnt(Inters3.Pnt(lowest_dist_int));
602 gp_Lin line4(gpaxis4);
603 IntCurvesFace_ShapeIntersector Inters4;
605 Inters4.Perform(line4,-RealLast(),+RealLast());
608 if (Inters4.NbPnt() > 0)
611 Standard_Real min_distance = 1e15;
612 Standard_Real distance;
613 int lowest_dist_int=0;
614 for (
int i=0; i<Inters4.NbPnt(); ++i)
616 distance =
Pnt(origin).Distance(Inters4.Pnt(i+1));
618 if (distance < min_distance)
620 min_distance = distance;
621 Pproj = Inters4.Pnt(i+1);
622 lowest_dist_int = i+1;
625 average +=
Pnt(Inters4.Pnt(lowest_dist_int));
629 cout<<
"Recovery attempt of point projection on surface in given direction FAILED"<<endl;
635 Pproj =
Pnt(average/succeeded);
640 Standard_Real min_distance = 1e15;
641 Standard_Real distance;
642 for (
int i=0; i<Inters.NbPnt(); ++i)
644 distance =
Pnt(origin).Distance(Inters.Pnt(i+1));
646 if (distance < min_distance)
648 min_distance = distance;
649 Pproj = Inters.Pnt(i+1);
657 projection =
Pnt(Pproj);
665 double &mean_curvature,
667 const Point<3> &assigned_axis)
const
671 gp_Pnt P0 =
Pnt(origin);
672 gp_Dir axis(assigned_axis(0),assigned_axis(1),assigned_axis(2));
673 gp_Ax1 gpaxis(P0, axis);
678 gp_Pnt Pproj(0.0,0.0,0.0);
680 Standard_Real Mean_Curvature;
686 IntCurvesFace_ShapeIntersector Inters;
689 Inters.Perform(line,-RealLast(),+RealLast());
693 double av_curvature = 0.0;
694 if (Inters.NbPnt() == 0)
696 unsigned int succeeded = 0;
697 cout<<
"Axis A("<<assigned_axis <<
") direction projection of point P("<<origin<<
") on shape FAILED!"<<endl;
698 cout<<
"Trying to fix this"<<endl;
703 gp_Lin line1(gpaxis1);
704 IntCurvesFace_ShapeIntersector Inters1;
706 Inters1.Perform(line1,-RealLast(),+RealLast());
709 if (Inters1.NbPnt() > 0)
712 Standard_Real min_distance = 1e15;
713 Standard_Real distance;
714 int lowest_dist_int=0;
715 for (
int i=0; i<Inters1.NbPnt(); ++i)
717 distance =
Pnt(origin).Distance(Inters1.Pnt(i+1));
719 if (distance < min_distance)
721 min_distance = distance;
722 Pproj = Inters1.Pnt(i+1);
723 lowest_dist_int = i+1;
726 average +=
Pnt(Inters1.Pnt(lowest_dist_int));
727 TopoDS_Face face1 = Inters1.Face(lowest_dist_int);
728 Handle(Geom_Surface) SurfToProj1 = BRep_Tool::Surface(face1);
729 GeomLProp_SLProps props1(SurfToProj1, Inters1.UParameter(lowest_dist_int), Inters1.VParameter(lowest_dist_int), 1,
tolerance);
730 gp_Dir Normal1 = props1.Normal();
731 Standard_Real Mean_Curvature1 = props1.MeanCurvature();
733 if (face1.Orientation()==TopAbs_REVERSED)
735 Normal1.SetCoord(-1.0*Normal1.X(),-1.0*Normal1.Y(),-1.0*Normal1.Z());
736 Mean_Curvature1*=-1.0;
738 av_normal +=
Point<3>(Normal1.X(),Normal1.Y(),Normal1.Z());
739 av_curvature += Mean_Curvature1;
744 gp_Lin line2(gpaxis2);
745 IntCurvesFace_ShapeIntersector Inters2;
747 Inters2.Perform(line2,-RealLast(),+RealLast());
750 if (Inters2.NbPnt() > 0)
753 Standard_Real min_distance = 1e15;
754 Standard_Real distance;
755 int lowest_dist_int=0;
756 for (
int i=0; i<Inters2.NbPnt(); ++i)
758 distance =
Pnt(origin).Distance(Inters2.Pnt(i+1));
760 if (distance < min_distance)
762 min_distance = distance;
763 Pproj = Inters2.Pnt(i+1);
764 lowest_dist_int = i+1;
767 average +=
Pnt(Inters2.Pnt(lowest_dist_int));
768 TopoDS_Face face2 = Inters2.Face(lowest_dist_int);
769 Handle(Geom_Surface) SurfToProj2 = BRep_Tool::Surface(face2);
770 GeomLProp_SLProps props2(SurfToProj2, Inters2.UParameter(lowest_dist_int), Inters2.VParameter(lowest_dist_int), 1,
tolerance);
771 gp_Dir Normal2 = props2.Normal();
772 Standard_Real Mean_Curvature2 = props2.MeanCurvature();
774 if (face2.Orientation()==TopAbs_REVERSED)
776 Normal2.SetCoord(-1.0*Normal2.X(),-1.0*Normal2.Y(),-1.0*Normal2.Z());
777 Mean_Curvature2*=-1.0;
779 av_normal +=
Point<3>(Normal2.X(),Normal2.Y(),Normal2.Z());
780 av_curvature += Mean_Curvature2;
785 gp_Lin line3(gpaxis3);
786 IntCurvesFace_ShapeIntersector Inters3;
788 Inters3.Perform(line3,-RealLast(),+RealLast());
791 if (Inters3.NbPnt() > 0)
794 Standard_Real min_distance = 1e15;
795 Standard_Real distance;
796 int lowest_dist_int=0;
797 for (
int i=0; i<Inters3.NbPnt(); ++i)
799 distance =
Pnt(origin).Distance(Inters3.Pnt(i+1));
801 if (distance < min_distance)
803 min_distance = distance;
804 Pproj = Inters3.Pnt(i+1);
805 lowest_dist_int = i+1;
808 average +=
Pnt(Inters3.Pnt(lowest_dist_int));
809 TopoDS_Face face3 = Inters3.Face(lowest_dist_int);
810 Handle(Geom_Surface) SurfToProj3 = BRep_Tool::Surface(face3);
811 GeomLProp_SLProps props3(SurfToProj3, Inters3.UParameter(lowest_dist_int), Inters3.VParameter(lowest_dist_int), 1,
tolerance);
812 gp_Dir Normal3 = props3.Normal();
813 Standard_Real Mean_Curvature3 = props3.MeanCurvature();
815 if (face3.Orientation()==TopAbs_REVERSED)
817 Normal3.SetCoord(-1.0*Normal3.X(),-1.0*Normal3.Y(),-1.0*Normal3.Z());
818 Mean_Curvature3*=-1.0;
820 av_normal +=
Point<3>(Normal3.X(),Normal3.Y(),Normal3.Z());
821 av_curvature += Mean_Curvature3;
826 gp_Lin line4(gpaxis4);
827 IntCurvesFace_ShapeIntersector Inters4;
829 Inters4.Perform(line4,-RealLast(),+RealLast());
832 if (Inters4.NbPnt() > 0)
835 Standard_Real min_distance = 1e15;
836 Standard_Real distance;
837 int lowest_dist_int=0;
838 for (
int i=0; i<Inters4.NbPnt(); ++i)
840 distance =
Pnt(origin).Distance(Inters4.Pnt(i+1));
842 if (distance < min_distance)
844 min_distance = distance;
845 Pproj = Inters4.Pnt(i+1);
846 lowest_dist_int = i+1;
849 average +=
Pnt(Inters4.Pnt(lowest_dist_int));
850 TopoDS_Face face4 = Inters4.Face(lowest_dist_int);
851 Handle(Geom_Surface) SurfToProj4 = BRep_Tool::Surface(face4);
852 GeomLProp_SLProps props4(SurfToProj4, Inters4.UParameter(lowest_dist_int), Inters4.VParameter(lowest_dist_int), 1,
tolerance);
853 gp_Dir Normal4 = props4.Normal();
854 Standard_Real Mean_Curvature4 = props4.MeanCurvature();
856 if (face4.Orientation()==TopAbs_REVERSED)
858 Normal4.SetCoord(-1.0*Normal4.X(),-1.0*Normal4.Y(),-1.0*Normal4.Z());
859 Mean_Curvature4*=-1.0;
861 av_normal +=
Point<3>(Normal4.X(),Normal4.Y(),Normal4.Z());
862 av_curvature += Mean_Curvature4;
866 cout<<
"Recovery attempt of point projection on surface in given direction FAILED"<<endl;
872 Pproj =
Pnt(average/succeeded);
873 av_normal/=succeeded;
874 Normal.SetCoord(av_normal(0),av_normal(1),av_normal(2));
875 Mean_Curvature = av_curvature/succeeded;
880 Standard_Real min_distance = 1e15;
881 Standard_Real distance;
882 int lowest_dist_int=0;
883 for (
int i=0; i<Inters.NbPnt(); ++i)
885 distance =
Pnt(origin).Distance(Inters.Pnt(i+1));
887 if (distance < min_distance)
889 min_distance = distance;
890 Pproj = Inters.Pnt(i+1);
891 lowest_dist_int = i+1;
894 TopoDS_Face face = Inters.Face(lowest_dist_int);
895 Handle(Geom_Surface) SurfToProj = BRep_Tool::Surface(face);
896 GeomLProp_SLProps props(SurfToProj, Inters.UParameter(lowest_dist_int), Inters.VParameter(lowest_dist_int), 1,
tolerance);
897 Normal = props.Normal();
898 Mean_Curvature = props.MeanCurvature();
900 if (face.Orientation()==TopAbs_REVERSED)
902 Normal.SetCoord(-1.0*Normal.X(),-1.0*Normal.Y(),-1.0*Normal.Z());
903 Mean_Curvature*=-1.0;
909 projection =
Pnt(Pproj);
912 normal(0) = Normal.X();
913 normal(1) = Normal.Y();
914 normal(2) = Normal.Z();
917 mean_curvature = double(Mean_Curvature);
927 axis_projection(projected_point, source_point);
928 return projected_point;
938 axis_projection(projected_point, source_point);
941 return projected_point;
948 axis_projection(projected_point, y);
950 return projected_point;
#define AssertThrow(cond, exc)
bool assigned_axis_projection_and_diff_forms(Point< 3 > &projection, Point< 3 > &normal, double &mean_curvature, const Point< 3 > &origin, const Point< 3 > &assigned_axis) const
bool axis_projection(Point< 3 > &projection, const Point< 3 > &origin) const
static::ExceptionBase & ExcMessage(std::string arg1)
double recovery_tolerance
virtual Point< 3 > get_new_point_on_quad(const Triangulation< 2, 3 >::quad_iterator &quad) const
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
AxisProjection(const TopoDS_Shape &sh, Point< 3 > direction, double tolerance=1e-7, double recovery_tolerance=1e-7)
dealii::Point< 3 > Pnt(const gp_Pnt &p)
Convert OpenCascade point into.
bool axis_projection_and_diff_forms(Point< 3 > &projection, Point< 3 > &normal, double &mean_curvature, const Point< 3 > &origin) const
We collect in this namespace all utilities which operate on OpenCascade entities which don't need cla...
bool assigned_axis_projection(Point< 3 > &projection, const Point< 3 > &origin, const Point< 3 > &assigned_axis) const
Handle(Geom_Curve) NumericalTowingTank
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual Point< 3 > project_to_surface(const Triangulation< 2, 3 >::quad_iterator &quad, const Point< 3 > &y) const
virtual Point< 3 > get_new_point_on_line(const Triangulation< 2, 3 >::line_iterator &line) const