POV-Ray : Newsgroups : povray.general : Isosurface and CSG Server Time
6 Nov 2024 02:23:30 EST (-0500)
  Isosurface and CSG (Message 1 to 3 of 3)  
From: GRedner
Subject: Isosurface and CSG
Date: 10 Nov 2002 13:05:06
Message: <web.3dce9f165d7f5b933f9b38ca0@news.povray.org>
I'm new here, so bear with me :)

I need to create an oddly-shaped object (and unforunately I can't 'cheat' -
it has to be exact). It's an isosurface of the following form (simplified):

isosurface {
    function { (x*y)/(z*z) } open
    contained_by { box { -10, 10 } }
}

And it looks like this:
http://gredner.dnsalias.com:1983/Ars/povray1.png

What I want to so is cut the isosurface in half about the origin, such that
the upper and lower "cups" are separate. Furthermore, I'd like to be able
to fill each of them with a different color.

How would I do this? I've done some experimentation with using CSG, but I
can't seem to get it right. The simplest operation, to create the two solid
cups, I thought could be accomplished by removig the "open" specifier and
doing a difference object, subtracting the isosurface from a box of the
same size, but that gives me a result which doesn't look even remotely
right.



-Gabe


Post a reply to this message

From: Christoph Hormann
Subject: Re: Isosurface and CSG
Date: 10 Nov 2002 13:38:27
Message: <3DCEA7A3.D33E4FF@gmx.de>
GRedner wrote:
> 
> I'm new here, so bear with me :)
> 
> I need to create an oddly-shaped object (and unforunately I can't 'cheat' -
> it has to be exact). It's an isosurface of the following form (simplified):
> 
> isosurface {
>     function { (x*y)/(z*z) } open
>     contained_by { box { -10, 10 } }
> }
> 

You should beware of division by zero with this function.  It is not
defined in the z=0 plane.

> 
> What I want to so is cut the isosurface in half about the origin, such that
> the upper and lower "cups" are separate. Furthermore, I'd like to be able
> to fill each of them with a different color.

If you want to cut the isosurface into two parts with a planar cut use:

intersection {
  object { Iso_Object }
  plane { Normal, 0 }
}

intersection {
  object { Iso_Object }
  plane { Normal, 0  inverse }
}

where 'Iso_Object' is the isosurface and 'Normal' is the orientation of
the plane.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 02 Nov. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Isosurface and CSG
Date: 10 Nov 2002 14:31:47
Message: <3dceb423@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> intersection {
>   object { Iso_Object }
>   plane { Normal, 0 }
> }

> intersection {
>   object { Iso_Object }
>   plane { Normal, 0  inverse }
> }

  Wouldn't it be more efficient to make two isosurfaces with the same
function but with properly placed container boxes?

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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