Advertisement
Guest User

Untitled

a guest
May 25th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. def make_plane_view(self, y):
  2. straights_on_side = {}
  3. straights_with_ends = {}
  4. straights = []
  5. dict_ = {}
  6.  
  7. for side_coef in self.polys_sides_with_coef.keys():
  8. flag_found = False
  9. for side_coef_t in self.polys_sides_with_coef_1.keys():
  10. if side_coef_t == side_coef:
  11. polygon = self.polys_sides_with_coef_1
  12. flag_found = True
  13. break
  14. if not flag_found:
  15. for side_coef_2t in self.polys_sides_with_coef_2.keys():
  16. if side_coef_2t == side_coef:
  17. polygon = self.polys_sides_with_coef_2
  18. flag_found = True
  19. break
  20.  
  21. bones = self.have_intersection(y, self.polys_sides_with_coef[side_coef])
  22. if bones:
  23. # print('side: ' + str(self.polys_sides_with_coef[side_coef]))
  24. # print('side coef: ' + str(side_coef))
  25. # print('bones: ' + str(bones))
  26. end_list = self.find_straights_ends(side_coef, y, polygon)
  27. if end_list:
  28. dict_[side_coef] = end_list
  29. # straight_coef = self.planes_intersection(y, side_coef)
  30. # straights.append(straight_coef) # shouldnt be here !!!!!!! надо добавлять, когда точно будет 2 конца отрезка
  31. # straights_on_side[straight_coef] = side_coef # аналогично
  32. # straights_with_ends[straight_coef] = end_list
  33.  
  34. for side_coef in dict_.keys():
  35. end_list = dict_[side_coef]
  36. straight_coef = self.planes_intersection(y, side_coef)
  37. straights.append(straight_coef) # shouldnt be here !!!!!!! надо добавлять, когда точно будет 2 конца отрезка
  38. straights_on_side[straight_coef] = side_coef # аналогично
  39. straights_with_ends[straight_coef] = end_list
  40. return straights_with_ends, straights_on_side, straights
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement