sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.19k stars 412 forks source link

add demos for implicit_plot3d that show how to do CSG (constructive solid geometry) #9484

Open ba94b9bb-195b-4422-a5e2-176920eaa163 opened 14 years ago

ba94b9bb-195b-4422-a5e2-176920eaa163 commented 14 years ago

See http://groups.google.com/group/sage-support/browse_thread/thread/e05229d90733c78d for an example of how to do CSG (intersections and unions of solid objects) with implicit_plot3d; I think the given example:

sage: var('x,y,z')
(x, y, z)
sage: implicit_plot3d(max_symbolic(min_symbolic(x*x+y*y-1, x*x+z*z-2), x-1.8, y-1.8, z-1.8, -x-1.8, -y-1.8, -z-1.8), (x, -2, 2), (y, -2, 2), (z, -2, 2), smooth=False)

(along with some explanation) should be added to the implicit_plot3d docstring.

Component: graphics

Work Issues: Very minor doc formatting

Author: Carl Witty

Reviewer: Karl-Dieter Crisman

Issue created by migration from https://trac.sagemath.org/ticket/9484

ba94b9bb-195b-4422-a5e2-176920eaa163 commented 13 years ago

Author: Carl Witty

ba94b9bb-195b-4422-a5e2-176920eaa163 commented 13 years ago
comment:1

Attachment: trac_9484-implicit-plot3d-csg-example.patch.gz

I picked a slightly different example.

kcrisman commented 13 years ago
comment:2

Probably depends on #9482 and #9483.

kcrisman commented 13 years ago
comment:3

After #9483, I go from error message to no error message with this example as expected. Can't test the actual view for some reason :(

ba94b9bb-195b-4422-a5e2-176920eaa163 commented 13 years ago
comment:4

I apologize for not marking the dependency in my comment.

By the way, you could see a version of the plot by adding a viewer='tachyon' keyword argument to the implicit_plot3d call.

kcrisman commented 13 years ago
comment:5

This looks fine, except probably one should put commands like implicit_plot3d in double ticks like ``implicit_plot3d``, or in that case you might even be able to use :meth: or something like that. Very interesting example!

kcrisman commented 13 years ago

Reviewer: Karl-Dieter Crisman

kcrisman commented 13 years ago

Work Issues: Very minor doc formatting