POV-Ray : Newsgroups : povray.newusers : ERROR IN ISECT()?---developers lurking? : ERROR IN ISECT()?---developers lurking? Server Time
30 Jul 2024 14:22:07 EDT (-0400)
  ERROR IN ISECT()?---developers lurking?  
From: MVSmith
Date: 12 Feb 2004 13:24:44
Message: <402bc4ec$1@news.povray.org>
In an earlier posting (on 20040121), I requested info on "scanning"
unions and differences of objects to read off height-field data from the
composite structure and thence out to a text file. A day or two after this
I discovered the isect() function, which seems to do the trick.

Except....that when the vector you're using to intersect with the intended
surface strikes the junction between two objects in this composite
structure,
sometimes it shoots through the seam and intersects the surface on the
opposite
side.

Here's a test case.
Create a cube 4 units on a side, centered at the origin.
Create a sphere of radius 1, offset 2 units along the +y axis.
Create an object that is the difference between these--what you get is
a cube with a hemispherical "basin" of radius 1. The composite object
is centered on the y axis.

Now run isect() in a raster pattern from x= -2 to 2 and z = -2 to 2,
y = 3 (for example), and with a downward-pointing vector of length 6
(for example). If you iterate isect with this vector at fine enough a
resolution (say 0.001 unit) in the x and z components of the starting
point, sometimes the vector shoots through the top surface at the
junction between the cube and the hemisphere, along the edge of the
basin.

I can work around this programmatically by trapping the erroneous returns,
but thought I'd document this in case 1) a developer wanted to track this,
or
2) I missed something in generating a simple difference object or in using
isect.

--MVSmith


Post a reply to this message

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