Ask Your Question

How to use surface_to_stl

asked 2020-09-08 14:24:49 +0100

Ingo gravatar image describes a function surface_to_stl to export 3D surfaces. It has the following example:

    sage: x,y,z = var('x,y,z')
    sage: a = implicit_plot3d(x^2+y^2+z^2-9, [x,-5,5], [y,-5,5],[z,-5,5])
    sage: a
    sage: f.write(surface_to_stl(a))
    sage: f.close()

When I run it, I get Name 'file' is not defined. When I remove 'file', I can print, but get "name 'surface_to_stl' is not defined.

So, what is the correct way to use surface_to_stl and what are the limitations of this function or of the method .save('foo.stl')?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-09-08 15:44:56 +0100

FrédéricC gravatar image

This is much simpler now, just do :

sage: x,y,z = var('x,y,z')
sage: a = implicit_plot3d(x^2+y^2+z^2-9, [x,-5,5], [y,-5,5],[z,-5,5])
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-09-08 14:24:49 +0100

Seen: 236 times

Last updated: Sep 08 '20