|
![](/i/fill.gif) |
> Note: a buch of interesting information on the toriodal variant of the
> superquadric appeared in one of the Graphics Gems books.
>
> Unlike the normal torus, you won't find an exact (general) solution for
> the intersection of a ray with the surface. This thing is way worse
> than an three variable polynomial with integral powers.
>
> For someone with time on their hands, what you need to do is to follow
> the example of what I did in the superquadric code. Chop the surface
> into octants, find intersections with the bounding box+planes that
> chopped it, then do a N-R solution.
>
> The difficulty with this particular surface is that it doesn't guarantee
> just one solution per octant. Even worse, there is no simple way to
> slice the octant to make that happen (yes, I thought about this one a
> few years back and didn't think it was worth the time).
>
> I suppose an interval arithmetic approach would work pretty well, but
> that requires adding quite a bit of code.
>
> Triangles are probably best here...
Yes, but the problem is twofold, when it comes to triangles.
a) Can't CSG.
b) degenerate triangles.
I might simply take the C code on that page, and make a DXF-outputting mesh
generator/ (DXF supports quad meshes...)
I truly wish povray had a 'quad mesh' - less chance of degenerate triangles
(Note: it might work as a variant on the polygon code - simply stipulate
that all points are coplanar. )
Twyst
>
> Xander
Post a reply to this message
|
![](/i/fill.gif) |