POV-Ray : Newsgroups : povray.newusers : Odd Isosurface difference? Server Time
27 Dec 2024 00:59:34 EST (-0500)
  Odd Isosurface difference? (Message 1 to 4 of 4)  
From: Grassblade
Subject: Odd Isosurface difference?
Date: 12 Dec 2006 17:35:00
Message: <web.457f2dd0e8109ada98f646ed0@news.povray.org>
Hello all, n00b here.
I've been playing around with POV for a few weeks now, I'm currently
interested in Isosurfaces. I tried making a book out of a page but I
stumbled on a strange behaviour: if I replicate the page with a while loop
I get the correct result shown in
http://i21.photobucket.com/albums/b288/aardpast/Real%20pics/BookIso2Correct.png
Now, when I want to cut the little tail and add a spine to the book by
adding the following block:
difference {
object{halfbook}
box{<-0.5,-0.5,-2> <0.7,0.7,5> rotate z*45 translate x*0.3 }
texture {T_Page2}
}

I get
http://i21.photobucket.com/albums/b288/aardpast/Real%20pics/BookIso2Difference2.png

Moving around the box doesn't get rid of the extra stuff. What am I doing
wrong? POV version is 3.6 for Windows. The code is:
#declare  halfbook=
union{
#while (a<1)
  isosurface{
      function{
        eparam*ln(x+fparam+(numpag-1)*zdist*(1-a)) +
bparam*(x+(numpag-1)*zdist*(1-a)) + cparam*pow(x+(numpag-1)*zdist*(1-a),2)
+ dparam - y}
        open
        max_gradient 2.5
      contained_by { box { 0.000001, <minimum + overh +
numpag*(1-a)*extralp,3 ,minimum + overh> } }
      translate <zdist*numpag*(1-a)*0.25,-2*zdist*numpag*(1-a),0>
      }
   #declare a=a+1/numpag;
#end
}


//difference{    // remove comments for pic #2
object{halfbook }
//box{<-0.5,-0.5,-2> <0.7,0.7,5> rotate z*45 translate x*0.3 }
//texture {T_Page2}
//}


Post a reply to this message

From: Thomas de Groot
Subject: Re: Odd Isosurface difference?
Date: 13 Dec 2006 07:40:24
Message: <457ff4b8$1@news.povray.org>
What you are seeing is the differenced box I believe.
The documentation says that using the open keyword (like in your example) is 
not recommended in CSG (see docs 3.4.4). So, I think that is where the 
problem comes from.
I don't know how to solve that conundrum! Either you see the box, or you get 
a filled page object...

Thomas


Post a reply to this message

From: Tek
Subject: Re: Odd Isosurface difference?
Date: 13 Dec 2006 07:43:45
Message: <457ff581$1@news.povray.org>
Right if I'm understanding your code correctly the problem is "open" in your 
isosurface object.

"difference" is a CSG operation, that is Constructive *Solid* Geometry. If 
an object is open it isn't solid, it's just and infinitely thin surface. In 
case you're wondering: the extra surfaces you're seeing are the surfaces 
created by taking the difference between the actual solid object, as if you 
didn't use "open", and the box, open only tells pov to throw out the 
implicit surfaces created by the isosurface's container but doesn't 
fundamentally alter pov's idea of what shape the object is. i.e. isosurfaces 
are solid regardless of whether or not their sides are invisible.

So, the solution is to use:

object{
    halfbook
    clipped_by {
        box{
            <-0.5,-0.5,-2> <0.7,0.7,5> rotate z*45 translate x*0.3
            inverse //invert the object so it behaves like a differenece.
        }
    }
}

Or alternatively you could create a parametric surface or bicubic_patch, 
both of which are actually flat, however using them in CSG is not 
recommended since the results can be a little unpredictable with genuinely 
non-solid objects (though in this case a difference would work fine).
-- 
Tek
http://evilsuperbrain.com

"Grassblade" <nomail@nomail> wrote in message 
news:web.457f2dd0e8109ada98f646ed0@news.povray.org...
> Hello all, n00b here.
> I've been playing around with POV for a few weeks now, I'm currently
> interested in Isosurfaces. I tried making a book out of a page but I
> stumbled on a strange behaviour: if I replicate the page with a while loop
> I get the correct result shown in
> http://i21.photobucket.com/albums/b288/aardpast/Real%20pics/BookIso2Correct.png
> Now, when I want to cut the little tail and add a spine to the book by
> adding the following block:
> difference {
> object{halfbook}
> box{<-0.5,-0.5,-2> <0.7,0.7,5> rotate z*45 translate x*0.3 }
> texture {T_Page2}
> }
>
> I get
> http://i21.photobucket.com/albums/b288/aardpast/Real%20pics/BookIso2Difference2.png
>
> Moving around the box doesn't get rid of the extra stuff. What am I doing
> wrong? POV version is 3.6 for Windows. The code is:
> #declare  halfbook=
> union{
> #while (a<1)
>  isosurface{
>      function{
>        eparam*ln(x+fparam+(numpag-1)*zdist*(1-a)) +
> bparam*(x+(numpag-1)*zdist*(1-a)) + cparam*pow(x+(numpag-1)*zdist*(1-a),2)
> + dparam - y}
>        open
>        max_gradient 2.5
>      contained_by { box { 0.000001, <minimum + overh +
> numpag*(1-a)*extralp,3 ,minimum + overh> } }
>      translate <zdist*numpag*(1-a)*0.25,-2*zdist*numpag*(1-a),0>
>      }
>   #declare a=a+1/numpag;
> #end
> }
>
>
> //difference{    // remove comments for pic #2
> object{halfbook }
> //box{<-0.5,-0.5,-2> <0.7,0.7,5> rotate z*45 translate x*0.3 }
> //texture {T_Page2}
> //}
>
>
>
>


Post a reply to this message

From: Grassblade
Subject: Re: Odd Isosurface difference?
Date: 13 Dec 2006 17:45:00
Message: <web.458082035ce1b967133366650@news.povray.org>
Thank you both, your help was much appreciated! And it works! That "inverse"
trick is especially neat. I guess I was putting too much faith in 2.4.1.9
about "empty" objects.
However, now I'm sort of stuck, because the original plan was to give the
pages some thickness. I know that using difference isn't a good idea, but I
can't put my function (translated a bit ) in a bounded_by or clipped_by
statement, can I?
Or I guess I could make a union of two pages. Is there a comand to "close"
the sides of the pages in that case?


Post a reply to this message

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