sculpture_gen.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Simple-User-Input-Sculpture-Generation 作者: ClaireKincaid 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号