POV-Ray : Newsgroups : povray.binaries.images : Intersection of solid mesh with isosurface Server Time
29 Jul 2024 18:24:41 EDT (-0400)
  Intersection of solid mesh with isosurface (Message 1 to 3 of 3)  
From: jceddy
Subject: Intersection of solid mesh with isosurface
Date: 24 Sep 2013 12:30:01
Message: <web.5241bd7f9d81581c314aa6840@news.povray.org>
It appears that intersecting a solid mesh with an isosurface doesn't work
properly...is this a known issue, or am I doing something wrong?

I've attached images showing the result of the same solid mesh with an
isosurface (on the left) and a simple spherical shell created by taking the
difference of two spheres (on the right).

You can see on the right side the mesh object appears solid, but on the left
(isosurface) side, it appears hollow...is this just something I'm not going to
be able to do?

Here's the code for the isosurface intersection:

#declare iso_ =
isosurface {
  function{
    x-f_snoise3d(x, y, z)*5
  }
  contained_by { box {<-10,-10,-10>, <10, 10, 10> } }
  accuracy 0.003
  max_gradient 12

  pigment { color Red }
  finish { ambient 0.5 }
}


intersection {
  object { skull_ scale 5.0 }
  object { iso_ }

  translate 10*z
}

And the code for the spherical shell intersection:

intersection {
  object { skull_ scale 5.0 }
  difference {
    sphere { <0, 0, 0>, 4.8 }
    sphere { <0, 0, 0>, 4.2 }

    pigment { color Red }
    finish { ambient 0.5 }
  }

  translate 10*z
}


Post a reply to this message


Attachments:
Download 'meshintersect.jpg' (167 KB)

Preview of image 'meshintersect.jpg'
meshintersect.jpg


 

From: Alain
Subject: Re: Intersection of solid mesh with isosurface
Date: 24 Sep 2013 23:02:29
Message: <52425245$1@news.povray.org>

> It appears that intersecting a solid mesh with an isosurface doesn't work
> properly...is this a known issue, or am I doing something wrong?
>
> I've attached images showing the result of the same solid mesh with an
> isosurface (on the left) and a simple spherical shell created by taking the
> difference of two spheres (on the right).
>
> You can see on the right side the mesh object appears solid, but on the left
> (isosurface) side, it appears hollow...is this just something I'm not going to
> be able to do?
>
> Here's the code for the isosurface intersection:
>
> #declare iso_ =
> isosurface {
>    function{
>      x-f_snoise3d(x, y, z)*5
>    }
>    contained_by { box {<-10,-10,-10>, <10, 10, 10> } }
	all_intersections // Add this
>    accuracy 0.003
>    max_gradient 12
>
>    pigment { color Red }
>    finish { ambient 0.5 }
> }
>
>
> intersection {
>    object { skull_ scale 5.0 }
>    object { iso_ }
>
>    translate 10*z
> }
>

Try adding "all_intersections" in your isosurface definition.

When a ray encounter a surface from the isosuerace, it stop there. In 
your case, the rays can intersect several surfaces that don't contribute 
to the final shape as they are outside the mesh. When this occurs, the 
surface behind those are not evaluated at all. You can't know how many 
such surfaces must be crossed, so you need to add all_intersections to 
ensure that you encounter the correct surface.

You don't need max_intersections or all_intersections if the isosurface 
is transparent as a new ray is traced behind the transparent surface.



Alain


Post a reply to this message

From: jceddy
Subject: Re: Intersection of solid mesh with isosurface
Date: 25 Sep 2013 09:05:00
Message: <web.5242df2c332ff9ca314aa6840@news.povray.org>
That was exactly it...thanks a million!


Post a reply to this message

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