def m_menu(self):
"""Runs the Mathmatically defined sculpture menu item."""
sin, cos = np.sin, np.cos
res = raw_input("Enter a functional definition of a volume (x**2+y**2+z**2 < 1) \n")
self.user_text = res
self.volume_data = self.bool_ops()
self.create_iso_surface(.7)
while True:
res = raw_input("Enter another functional definition of a volume (x**2+y**2+z**2 < 1) \n")
self.user_text = res
self.sec_volume_data = self.bool_ops()
self.create_iso_surface(.7, second=True)
res = raw_input("Enter a boolean operation to do with the previous solid (a = and, o = or, n = not, x = xor):\n")
if res == "a":
self.sec_volume_data = 0+ np.logical_and(my_sculpture.volume_data, my_sculpture.bool_ops())
elif res == "o":
self.sec_volume_data = 0+ np.logical_or(my_sculpture.volume_data, my_sculpture.bool_ops())
elif res == "n":
self.sec_volume_data = 0+ np.logical_not(my_sculpture.volume_data, my_sculpture.bool_ops())
elif res == "x":
self.sec_volume_data = 0+ np.logical_xor(my_sculpture.volume_data, my_sculpture.bool_ops())
self.create_iso_surface(.7, second=True)
sculpture_gen.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录