[metapost] surfaces
lfinsto1 at gwdg.de
lfinsto1 at gwdg.de
Fri May 12 08:58:57 CEST 2006
> hi metapost friends, i have a big question (and problem to me), how i can
> draw t he intersection of surfaces in metapost code, for example i want
> draw
> the intersection between a parabolid and a cylinder. I reed somethig about
> featpost and mp 3D but i dont get good results. Well a hope that you can
> help me.
I'm interested in intersections and quadric surfaces, too. I've worked on
these subjects a bit, but I've only gotten up to the intersection of an
ellipsoid and a plane
(http://www.gnu.org/software/3dldf/ellpsoid.html#Intersection_Ellipsoid_Plane).
I would like to continue working on this, but unfortunately, it's not
possible at the moment. I know there's an algebraic solution for finding
the intersection figure of two quadric surfaces, but the "explanation"
involved references to earlier results, which I hadn't read. If I
remember correctly, it's in an appendix of this book at around page 360:
Brauner, Heinrich, _Lehrbuch der konstruktiven Geometrie_.
Wien [u.a.] : Springer, 1986
ISBN: 3-211-81833-2 - ISBN 0-387-81833-2
There are various approaches to using MetaPost for 3D drawing. One is to
write a macro package in the MetaPost language. I've chosen to write a
package in C++ that writes MetaPost code (GNU 3DLDF ---
http://www.gnu.org/software/3dldf/LDF.html). Another possibility might be
to have MetaPost write code to be passed to a rendering package using
OpenGL, Renderman, or some other standard. Denis Roegel published an
article about his work on this not too long ago. According to my
understanding of the matter, in renderers, the problem isn't really
solved, it just "comes out in the wash". That is, objects in the
resulting image appear to intersect, but the points of intersection are
not calculated. Nor is the equation of the resulting figure calculated,
if it happens to be a figure that has an equation.
Yet another approach would be to define the quadric surfaces using NURBs
surfaces. Then the problem of finding the intersections is the same as
finding those of any other two NURBs surfaces. I presume this is done by
iterating through all the combinations of the individual sections of the
two surfaces, except where some kind of optimization is possible. This
seems like a brute-force approach to me, but it has the advantage of being
able to handle different shapes. The main reason I've worked on finding
the intersections of geometric shapes using their equations is because I
find the problem interesting in itself.
I discovered that just finding points on an ellipse doesn't necessarily
lead to accurately determining the center, axes, etc., even if you can
find as many points as you want (using the Braikenridge-Maclaurin
construction). By the same token, it's not always possible to determine
its equation (after transforming it so that it lies in standard position).
I strongly suspect the same is true of the quadric surfaces. The conic
sections and quadric surfaces may be "easy" for good mathematicians, but
I've had a hard time finding the information I wanted for purposes of
programming. I've found even less information on this subject in books on
computer graphics.
I hate to say this, but if you want fast results rather than a programming
challenge, you might want to think about using some other package where
this is already implemented.
Laurence Finston
More information about the metapost
mailing list