コード例 #1
0
 def test_point_from_projections(self):
     """Test: point from projections"""
     P = gp_Pnt(7.0, 8.0, 9.0)
     radius = 5
     SP = Geom_SphericalSurface(gp_Ax3(gp_XOY()), radius)
     PPS = GeomAPI_ProjectPointOnSurf(P, SP)
     N = PPS.NearestPoint()
     self.assertTrue(isinstance(N, gp_Pnt))
     NbResults = PPS.NbPoints()
     if NbResults > 0:
         for i in range(1, NbResults + 1):
             Q = PPS.Point(i)
             self.assertTrue(isinstance(Q, gp_Pnt))
             distance = PPS.Distance(i)
             # in any case, it should be > 1
             self.assertGreater(distance, 1.0)
     lower_d = PPS.LowerDistance()
     self.assertGreater(lower_d, 1.0)
     if NbResults > 0:
         for i in range(1, NbResults + 1):
             Q = PPS.Point(i)
             distance = PPS.Distance(i)
             pstring = "Q" + repr(i) + ": at Distance :" + repr(
                 PPS.Distance(i))
             print(pstring)
コード例 #2
0
 def test_point_from_projections(self):
     '''Test: point from projections'''
     P = gp_Pnt(7., 8., 9.)
     radius = 5
     SP = Geom_SphericalSurface(gp_Ax3(gp_XOY()), radius)
     PPS = GeomAPI_ProjectPointOnSurf(P, SP)
     N = PPS.NearestPoint()
     NbResults = PPS.NbPoints()
     if NbResults > 0:
         for i in range(1, NbResults + 1):
             Q = PPS.Point(i)
             distance = PPS.Distance(i)
     pstring = "N  : at Distance : " + repr(PPS.LowerDistance())
     if NbResults > 0:
         for i in range(1, NbResults + 1):
             Q = PPS.Point(i)
             distance = PPS.Distance(i)
             pstring = "Q" + repr(i) + ": at Distance :" + repr(
                 PPS.Distance(i))