POV-Ray : Newsgroups : povray.unofficial.patches : 360 degrees with isosurface? Server Time
2 Nov 2024 11:26:00 EDT (-0400)
  360 degrees with isosurface? (Message 1 to 10 of 10)  
From: SamuelT 
Subject: 360 degrees with isosurface?
Date: 10 Dec 1999 23:28:31
Message: <3851D4A6.B814D927@aol.com>
I was wondering if it was possible to make, say, a hexagon from an
isosurface. I can't seem to figure out a good way to make anything but
cubic objects. No matter how complex an object may seem , deep down it
is within cubic guidelines. Is there any way to make objects that use
the 360 degree model, to make seven-sided and higher polygons? If not,
can it be implemented in future versions of the isosurface? Thanks in
advance.

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

From: Chris Huff
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 06:50:30
Message: <chrishuff_99-4FFAE9.06505511121999@news.povray.org>
In article <3851D4A6.B814D927@aol.com>, "SamuelT." <STB### [at] aolcom> 
wrote:

> I was wondering if it was possible to make, say, a hexagon from an
> isosurface. I can't seem to figure out a good way to make anything but
> cubic objects. No matter how complex an object may seem , deep down it
> is within cubic guidelines. Is there any way to make objects that use
> the 360 degree model, to make seven-sided and higher polygons? If not,
> can it be implemented in future versions of the isosurface? Thanks in
> advance.

It is definitely possible. Look at the trig functions for the 
isosurface, you can do just about anything with them.

//Makes a hexagonal prism, the angles given to the trig functions
//are the angles of the sides
isosurface {
   function {
      (z*sin(radians(0)) + x*cos(radians(0)) - 1)
      &(z*sin(radians(60)) + x*cos(radians(60)) - 1)
      &(z*sin(radians(120)) + x*cos(radians(120)) - 1)
      &(z*sin(radians(180)) + x*cos(radians(180)) - 1)
      &(z*sin(radians(240)) + x*cos(radians(240)) - 1)
      &(z*sin(radians(300)) + x*cos(radians(300)) - 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

From: SamuelT 
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 13:54:39
Message: <38529FAA.9A53DEA1@aol.com>
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.

Chris Huff wrote:

> In article <3851D4A6.B814D927@aol.com>, "SamuelT." <STB### [at] aolcom>
> wrote:
>
> > I was wondering if it was possible to make, say, a hexagon from an
> > isosurface. I can't seem to figure out a good way to make anything but
> > cubic objects. No matter how complex an object may seem , deep down it
> > is within cubic guidelines. Is there any way to make objects that use
> > the 360 degree model, to make seven-sided and higher polygons? If not,
> > can it be implemented in future versions of the isosurface? Thanks in
> > advance.
>
> It is definitely possible. Look at the trig functions for the
> isosurface, you can do just about anything with them.
>
> //Makes a hexagonal prism, the angles given to the trig functions
> //are the angles of the sides
> isosurface {
>    function {
>       (z*sin(radians(0)) + x*cos(radians(0)) - 1)
>       &(z*sin(radians(60)) + x*cos(radians(60)) - 1)
>       &(z*sin(radians(120)) + x*cos(radians(120)) - 1)
>       &(z*sin(radians(180)) + x*cos(radians(180)) - 1)
>       &(z*sin(radians(240)) + x*cos(radians(240)) - 1)
>       &(z*sin(radians(300)) + x*cos(radians(300)) - 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/

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

From: SamuelT 
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 14:14:43
Message: <3852A45F.401732A2@aol.com>
It appears my version of the superpatch doesn't know what 'radians' is. Off
I go now to download the megapatch, hoping it supports radians....

Chris Huff wrote:

> In article <3851D4A6.B814D927@aol.com>, "SamuelT." <STB### [at] aolcom>
> wrote:
>
>
>
> It is definitely possible. Look at the trig functions for the
> isosurface, you can do just about anything with them.
>
>

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

From: Chris Huff
Subject: Re: 360 degrees with isosurface?
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

From: Chris Huff
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 14:29:15
Message: <chrishuff_99-6D3FC7.14294011121999@news.povray.org>
In article <3852A45F.401732A2@aol.com>, "SamuelT." <STB### [at] aolcom> 
wrote:

> It appears my version of the superpatch doesn't know what 'radians' is. 
> Off
> I go now to download the megapatch, hoping it supports radians....

I am pretty certain it does, since it includes the MultiPatch, which is 
what I used on this.
You can replace the calls to radians like this:
radians(D)
can be replaced with:
D*pi/180

Actually, as I remember, the Superpatch doesn't recognize "pi" either. 
That is another thing the Multipatch adds, and which should be in the 
Megapatch. You can work around this by adding
#declare PI = pi;
and using "PI" in place of "pi".
D*PI/180

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


Post a reply to this message

From: SamuelT 
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 15:09:46
Message: <3852B146.322D24A2@aol.com>
I have the multipatch now and it works fine (but slow). I'm glad to see pi in
there, since I use it a lot.

Chris Huff wrote:

> In article <3852A45F.401732A2@aol.com>, "SamuelT." <STB### [at] aolcom>
> wrote:
>
> > It appears my version of the superpatch doesn't know what 'radians' is.
> > Off
> > I go now to download the megapatch, hoping it supports radians....
>
> I am pretty certain it does, since it includes the MultiPatch, which is
> what I used on this.
> You can replace the calls to radians like this:
> radians(D)
> can be replaced with:
> D*pi/180
>
> Actually, as I remember, the Superpatch doesn't recognize "pi" either.
> That is another thing the Multipatch adds, and which should be in the
> Megapatch. You can work around this by adding
> #declare PI = pi;
> and using "PI" in place of "pi".
> D*PI/180
>
> --
> Chris Huff
> e-mail: chr### [at] yahoocom
> Web page: http://chrishuff.dhs.org/

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

From: SamuelT 
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 15:12:11
Message: <3852B1D6.EBABC753@aol.com>
Actually, I was able to encase the first three parts in abs( ) functions to
shorten it. The remaining three were deleted. It worked well, but I don't think
it helped the rendering time, only my editor space :)

Chris Huff wrote:

> 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/

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial: http://members.aol.com/stbenge


Post a reply to this message

From: Chris Huff
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 15:26:17
Message: <chrishuff_99-361734.15264311121999@news.povray.org>
In article <3852B1D6.EBABC753@aol.com>, "SamuelT." <STB### [at] aolcom> 
wrote:

> Actually, I was able to encase the first three parts in abs( ) functions 
> to
> shorten it. The remaining three were deleted. It worked well, but I don't 
> think
> it helped the rendering time, only my editor space :)

Well, my first version used abs() functions and was shorter by 3 lines, 
but this only works for prisms with an even number of sides.

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


Post a reply to this message

From: SamuelT 
Subject: Re: 360 degrees with isosurface?
Date: 11 Dec 1999 18:31:53
Message: <3852E0A5.5DA9EEF7@aol.com>
Yeah, I can see it not working for a 7-sided object.

Chris Huff wrote:

> In article <3852B1D6.EBABC753@aol.com>, "SamuelT." <STB### [at] aolcom>
> wrote:
>
> > Actually, I was able to encase the first three parts in abs( ) functions
> > to
> > shorten it. The remaining three were deleted. It worked well, but I don't
> > think
> > it helped the rendering time, only my editor space :)
>
> Well, my first version used abs() functions and was shorter by 3 lines,
> but this only works for prisms with an even number of sides.
>
> --
> Chris Huff
> e-mail: chr### [at] yahoocom
> Web page: http://chrishuff.dhs.org/

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial: http://members.aol.com/stbenge


Post a reply to this message

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