POV-Ray : Newsgroups : povray.binaries.images : Problems with CSG and Mesh : Re: Problems with CSG and Mesh Server Time
7 Aug 2024 07:19:20 EDT (-0400)
  Re: Problems with CSG and Mesh  
From: Jon Buller
Date: 15 May 2006 23:30:00
Message: <web.446944d6bc7695282ff3aa640@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

> You can substract or intersect from a patch object, but you can't
substract/intersect a patch object
> from another object. The patch object is only a surface, even if it have a defined
interior.

Hmmm...  I am doing this:

difference {
  mesh { triangle { } }
  cylinder { }
  pigment { rgb { <1/2,1,1/2> } }
}

for the green band, and the same for the torus, substituting torus for mesh,
and red for green...

To me, this is "subtract cylinder from mesh", correct?  Of course there is a
while loop around the cylinder to get all the holes, and a few loops inside
the mesh to make all the smooth_triangles...

I'll post the code if it helps, (or if anyone is interested) but there is a
bunch of ugly math in there to get the positions, distances, and normals
correct.  The algebra (and trig identities) needed to get the metric tensor
are pretty messy.  I needed to use Maxima to double check and find the
mistakes in my afternoon of algebraic manipulations.

......checks code... Oh, I think it was the inside_vector.  When I first did
this, I think I just used x, but the torus is {8,3 ...}.  That produced
some weird ghost reflections off the cylinders, so I changed it to 0, as
above and it worked better.  Changing it just now to <8,0,0> looks like it
is working correctly.  Perhaps my first attempt just happened to get the
inside_vector inside one of the cylinders, and I missed seeing the warning
until later.

Am I correct in believing that inside_vector is a point inside the mesh, and
the  part in the docs saying "You can specify the direction of this vector.
For example, to use +z as the direction..." perhaps should have the word
"location" substituted for "direction"?

Many thanks,

Jon


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.