POV-Ray : Newsgroups : povray.unofficial.patches : 360 degrees with isosurface? : Re: 360 degrees with isosurface? Server Time
2 Sep 2024 16:21:12 EDT (-0400)
  Re: 360 degrees with isosurface?  
From: Chris Huff
Date: 11 Dec 1999 14:24:00
Message: <chrishuff_99-86449B.14242411121999@news.povray.org>
In article <38529FAA.9A53DEA1@aol.com>, "SamuelT." <STB### [at] aolcom> 
wrote:

> Cool! Thanks Chris! I'll get started on this stuff soon and might post my
> progress at the images section. The only drawback about this, is that the
> parser might get "bored" like it has in the past when using large 
> functions.

Well, much of the code is duplicated, you could separate it into a 
separate function to make it considerably shorter, something like this:


//Makes one side of prism aligned in xz plane
//Syntax is: PrismSide(angle, x, z) - distance
#declare PrismSide =
function {
    z*sin(radians(x)) + y*cos(radians(x))
}

//Makes a hexagonal prism, the angles given
//are the angles of the sides to each other
isosurface {
    function {
       PrismSide(0, x, y) - 1)
       &PrismSide(60, x, y) - 1)
       &PrismSide(120, x, y) - 1)
       &PrismSide(180, x, y) - 1)
       &PrismSide(240, x, y) - 1)
       &PrismSide(300, x, y) - 1)
       &(abs(y) - 1)
    }
    threshold 0
    clipped_by{box {<-5, -5, -15>, < 5, 5, 5>}}
    accuracy 0.001
    texture {ComYw}
}

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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