diff --git a/mathics/format/asy.py b/mathics/format/asy.py index 53bcb0e87..30e162c37 100644 --- a/mathics/format/asy.py +++ b/mathics/format/asy.py @@ -189,19 +189,22 @@ def cylinder3dbox(self, **options) -> str: asy = "" i = 0 while i < len(self.points) / 2: - asy += "draw(surface(cylinder({0}, {1}, {2}, {3})), rgb({2},{3},{4}));".format( - tuple(self.points[i * 2].pos()[0]), - self.radius, - # distance between start and end - ( - (self.points[i * 2][0][0] - self.points[i * 2 + 1][0][0]) ** 2 - + (self.points[i * 2][0][1] - self.points[i * 2 + 1][0][1]) ** 2 - + (self.points[i * 2][0][2] - self.points[i * 2 + 1][0][2]) ** 2 + try: + asy += "draw(surface(cylinder({0}, {1}, {2}, {3})), rgb({2},{3},{4}));".format( + tuple(self.points[i * 2].pos()[0]), + self.radius, + # distance between start and end + ( + (self.points[i * 2][0][0] - self.points[i * 2 + 1][0][0]) ** 2 + + (self.points[i * 2][0][1] - self.points[i * 2 + 1][0][1]) ** 2 + + (self.points[i * 2][0][2] - self.points[i * 2 + 1][0][2]) ** 2 + ) + ** 0.5, + (1, 1, 0), # FIXME: currently always drawing around the axis X+Y + *face_color[:3], ) - ** 0.5, - (1, 1, 0), # FIXME: currently always drawing around the axis X+Y - *face_color[:3], - ) + except: # noqa + pass i += 1