예제 #1
0
 def trimtofp(p1, p2, r=5):
     ips = pym.sintbxyp(p1, p2, fp)
     if len(ips) > 0:
         for ip in ips:
             if ip.isnear(p1): continue
             p2 = p1.lerp(ip, 1 - r / p1.d(ip))
     return p2
예제 #2
0
 def trimtofp(p1,p2,r = 5):
     ips = pym.sintbxyp(p1,p2,fp)
     if len(ips) > 0:
         for ip in ips:
             if ip.isnear(p1):continue
             p2 = p1.lerp(ip,1-r/p1.d(ip))
     return p2
예제 #3
0
 def test_sintbxyp(self):
     u1,u2 = (vec3(77.000000,33.001942,0.000000) , vec3(63.000000,33.000004,0.000000))
     b = [
         vec3(75.000000,35.000011,0.000000) ,
         vec3(76.999992,35.000011,0.000000) ,
         vec3(76.999992,32.999996,0.000000) ,
         vec3(67.000000,33.000000,0.000000) ,
         vec3(66.999992,22.999996,0.000000) ,
         vec3(33.000000,23.000004,0.000000) ,
         vec3(33.000000,33.001392,0.000000) ,
         vec3(23.001953,33.000004,0.000000) ,
         vec3(23.001545,61.998047,0.000000) ,
         vec3(23.001442,63.001602,0.000000) ,
         vec3(18.000002,63.001541,0.000000) ,
         vec3(16.999865,63.001438,0.000000) ,
         vec3(17.000000,62.000000,0.000000) ,
         vec3(17.000000,58.000000,0.000000) ,
         vec3(17.000000,42.000000,0.000000) ,
         vec3(17.000000,38.000000,0.000000) ,
         vec3(17.000000,18.000000,0.000000) ,
         vec3(5.000000,18.000000,0.000000) ,
         vec3(5.000000,20.000000,0.000000) ,
         vec3(5.000000,38.000000,0.000000) ,
         vec3(5.000000,40.000000,0.000000) ,
         vec3(5.000000,42.000000,0.000000) ,
         vec3(5.000000,58.000000,0.000000) ,
         vec3(5.000000,60.000000,0.000000) ,
         vec3(5.000000,62.000000,0.000000) ,
         vec3(5.000000,63.000206,0.000000) ,
         vec3(5.000000,75.000000,0.000000) ,
         vec3(16.998253,75.000000,0.000000) ,
         vec3(17.999998,75.000000,0.000000) ,
         vec3(19.999998,75.000000,0.000000) ,
         vec3(22.000002,75.000000,0.000000) ,
         vec3(23.000202,75.000000,0.000000) ,
         vec3(34.999996,75.000000,0.000000) ,
         vec3(34.999996,63.001747,0.000000) ,
         vec3(34.999996,61.999722,0.000000) ,
         vec3(34.999996,60.000000,0.000000) ,
         vec3(34.999996,58.000000,0.000000) ,
         vec3(35.000000,36.999996,0.000000) ,
         vec3(35.000000,35.000004,0.000000) ,
         vec3(36.999866,35.000000,0.000000) ,
         vec3(63.000004,35.000004,0.000000) ,
         vec3(64.999992,35.000004,0.000000) ,
         vec3(64.999992,37.000004,0.000000) ,
         vec3(64.999992,43.001785,0.000000) ,
         vec3(64.999992,45.000004,0.000000) ,
         vec3(62.999996,45.000004,0.000000) ,
         vec3(56.999790,45.000004,0.000000) ,
         vec3(44.999996,45.000000,0.000000) ,
         vec3(44.999996,56.998211,0.000000) ,
         vec3(44.999996,58.000000,0.000000) ,
         vec3(44.999996,60.000000,0.000000) ,
         vec3(44.999996,62.000000,0.000000) ,
         vec3(45.000000,63.000206,0.000000) ,
         vec3(45.000000,75.000000,0.000000) ,
         vec3(57.000000,75.000000,0.000000) ,
         vec3(57.999996,75.000000,0.000000) ,
         vec3(59.999992,75.000000,0.000000) ,
         vec3(62.000004,75.000000,0.000000) ,
         vec3(63.000195,75.000000,0.000000) ,
         vec3(74.999985,75.000000,0.000000) ,
         vec3(74.999985,63.001747,0.000000) ,
         vec3(74.999985,60.000004,0.000000) ,
         vec3(74.999985,57.999996,0.000000) ,
         vec3(63.001968,58.000004,0.000000) ,
         vec3(63.001446,63.000515,0.000000) ,
         vec3(58.000008,63.000000,0.000000) ,
         vec3(56.998913,63.001442,0.000000) ,
         vec3(56.998459,58.000004,0.000000) ,
         vec3(56.998562,56.999187,0.000000) ,
         vec3(67.000008,57.000004,0.000000) ,
         vec3(67.000000,47.000000,0.000000) ,
         vec3(74.999992,47.000004,0.000000) ,
             ]
     ips = pym.sintbxyp(u1,u2,b,ieb = False)
     ax = dtl.plot_axes_xy(100)
     ax = dtl.plot_polygon_xy(b,ax,lw = 2,col = 'g')
     ax = dtl.plot_points_xy((u1,u2),ax,cs = ['b']*2)
     ax = dtl.plot_edges_xy((u1,u2),ax,col = 'b')
     ax = dtl.plot_points_xy(ips,ax,cs = ['r']*len(ips))
     print('IPS',ips)
     plt.show()
     pdb.set_trace()
예제 #4
0
 def test_sintbxyp(self):
     u1, u2 = (vec3(77.000000, 33.001942,
                    0.000000), vec3(63.000000, 33.000004, 0.000000))
     b = [
         vec3(75.000000, 35.000011, 0.000000),
         vec3(76.999992, 35.000011, 0.000000),
         vec3(76.999992, 32.999996, 0.000000),
         vec3(67.000000, 33.000000, 0.000000),
         vec3(66.999992, 22.999996, 0.000000),
         vec3(33.000000, 23.000004, 0.000000),
         vec3(33.000000, 33.001392, 0.000000),
         vec3(23.001953, 33.000004, 0.000000),
         vec3(23.001545, 61.998047, 0.000000),
         vec3(23.001442, 63.001602, 0.000000),
         vec3(18.000002, 63.001541, 0.000000),
         vec3(16.999865, 63.001438, 0.000000),
         vec3(17.000000, 62.000000, 0.000000),
         vec3(17.000000, 58.000000, 0.000000),
         vec3(17.000000, 42.000000, 0.000000),
         vec3(17.000000, 38.000000, 0.000000),
         vec3(17.000000, 18.000000, 0.000000),
         vec3(5.000000, 18.000000, 0.000000),
         vec3(5.000000, 20.000000, 0.000000),
         vec3(5.000000, 38.000000, 0.000000),
         vec3(5.000000, 40.000000, 0.000000),
         vec3(5.000000, 42.000000, 0.000000),
         vec3(5.000000, 58.000000, 0.000000),
         vec3(5.000000, 60.000000, 0.000000),
         vec3(5.000000, 62.000000, 0.000000),
         vec3(5.000000, 63.000206, 0.000000),
         vec3(5.000000, 75.000000, 0.000000),
         vec3(16.998253, 75.000000, 0.000000),
         vec3(17.999998, 75.000000, 0.000000),
         vec3(19.999998, 75.000000, 0.000000),
         vec3(22.000002, 75.000000, 0.000000),
         vec3(23.000202, 75.000000, 0.000000),
         vec3(34.999996, 75.000000, 0.000000),
         vec3(34.999996, 63.001747, 0.000000),
         vec3(34.999996, 61.999722, 0.000000),
         vec3(34.999996, 60.000000, 0.000000),
         vec3(34.999996, 58.000000, 0.000000),
         vec3(35.000000, 36.999996, 0.000000),
         vec3(35.000000, 35.000004, 0.000000),
         vec3(36.999866, 35.000000, 0.000000),
         vec3(63.000004, 35.000004, 0.000000),
         vec3(64.999992, 35.000004, 0.000000),
         vec3(64.999992, 37.000004, 0.000000),
         vec3(64.999992, 43.001785, 0.000000),
         vec3(64.999992, 45.000004, 0.000000),
         vec3(62.999996, 45.000004, 0.000000),
         vec3(56.999790, 45.000004, 0.000000),
         vec3(44.999996, 45.000000, 0.000000),
         vec3(44.999996, 56.998211, 0.000000),
         vec3(44.999996, 58.000000, 0.000000),
         vec3(44.999996, 60.000000, 0.000000),
         vec3(44.999996, 62.000000, 0.000000),
         vec3(45.000000, 63.000206, 0.000000),
         vec3(45.000000, 75.000000, 0.000000),
         vec3(57.000000, 75.000000, 0.000000),
         vec3(57.999996, 75.000000, 0.000000),
         vec3(59.999992, 75.000000, 0.000000),
         vec3(62.000004, 75.000000, 0.000000),
         vec3(63.000195, 75.000000, 0.000000),
         vec3(74.999985, 75.000000, 0.000000),
         vec3(74.999985, 63.001747, 0.000000),
         vec3(74.999985, 60.000004, 0.000000),
         vec3(74.999985, 57.999996, 0.000000),
         vec3(63.001968, 58.000004, 0.000000),
         vec3(63.001446, 63.000515, 0.000000),
         vec3(58.000008, 63.000000, 0.000000),
         vec3(56.998913, 63.001442, 0.000000),
         vec3(56.998459, 58.000004, 0.000000),
         vec3(56.998562, 56.999187, 0.000000),
         vec3(67.000008, 57.000004, 0.000000),
         vec3(67.000000, 47.000000, 0.000000),
         vec3(74.999992, 47.000004, 0.000000),
     ]
     ips = pym.sintbxyp(u1, u2, b, ieb=False)
     ax = dtl.plot_axes_xy(100)
     ax = dtl.plot_polygon_xy(b, ax, lw=2, col='g')
     ax = dtl.plot_points_xy((u1, u2), ax, cs=['b'] * 2)
     ax = dtl.plot_edges_xy((u1, u2), ax, col='b')
     ax = dtl.plot_points_xy(ips, ax, cs=['r'] * len(ips))
     print('IPS', ips)
     plt.show()
     pdb.set_trace()