POV-Ray : Newsgroups : povray.general : Holes in SuperEllipsoids Server Time
7 Aug 2024 17:22:38 EDT (-0400)
  Holes in SuperEllipsoids (Message 1 to 9 of 9)  
From: Patrick Dugan
Subject: Holes in SuperEllipsoids
Date: 8 Jul 2001 10:19:08
Message: <3b486bdc@news.povray.org>
I am tryting to create a difference between two Superquadric Ellipsoid
Objects.  Whenever I do this the object has some odd cutouts that appear at
certain angles.  I will post the image example in the binaries/images area.
Anything I can do to get the same object shape without the cutouts?  Here is
my questionable code...


///////////////////////////////////////
#include "colors.inc"

#version unofficial MegaPov 0.7;
global_settings {
   assumed_gamma 2.2
   max_trace_level 25
}

light_source {< -500, 500, -500> color White * 1.0}
camera { location <0,0,-3> look_at  <0,0,0>}


difference {
   superellipsoid {<0.25, 0.25> scale <1.00,1.00,1.00>}
   superellipsoid {<0.25, 0.25> scale <0.98,0.98,2.01>}  // deeper on z axis
to create cutout...
   scale <1,0.25,0.15>
   texture {pigment {Green} finish {ambient 0.4}}
   rotate <-90,0,90>
   rotate y * 45
}

sphere {<0,0,0> , 1300.0 texture {pigment { Gray90 }} hollow}

//////////////////////////////////////


Post a reply to this message

From: Tim Attwood
Subject: Re: Holes in SuperEllipsoids
Date: 8 Jul 2001 21:17:51
Message: <3B490638.D342FF02@worldnet.att.net>
> I am tryting to create a difference between two Superquadric Ellipsoid
> Objects.  Whenever I do this the object has some odd cutouts that appear at
> certain angles.  I will post the image example in the binaries/images area.
> Anything I can do to get the same object shape without the cutouts?  Here is
> my questionable code...

Well, that looks like the normal on some of the triangles got flipped somewhere
inside POV.  You can get the same shape with a CSG, "rounded box".  Here's
some code, the first part is a RoundBox macro and the second your example
rewritten to use it.

// ----- RoundBox -----
// LocA and LocB are box corners, Rad1 is the rounding radius
#macro RoundBox(LocA, LocB, Rad1)
merge {
  #local B1 = <LocA.x+Rad1,LocA.y+Rad1,LocA.z+Rad1>;
  #local B2 = <LocA.x+Rad1,LocA.y+Rad1,LocB.z-Rad1>;
  #local B3 = <LocB.x-Rad1,LocA.y+Rad1,LocB.z-Rad1>;
  #local B4 = <LocB.x-Rad1,LocA.y+Rad1,LocA.z+Rad1>;
  #local T1 = <LocA.x+Rad1,LocB.y-Rad1,LocA.z+Rad1>;
  #local T2 = <LocA.x+Rad1,LocB.y-Rad1,LocB.z-Rad1>;
  #local T3 = <LocB.x-Rad1,LocB.y-Rad1,LocB.z-Rad1>;
  #local T4 = <LocB.x-Rad1,LocB.y-Rad1,LocA.z+Rad1>;
  sphere{B1, Rad1}
  sphere{B2, Rad1}
  sphere{B3, Rad1}
  sphere{B4, Rad1}
  sphere{T1, Rad1}
  sphere{T2, Rad1}
  sphere{T3, Rad1}
  sphere{T4, Rad1}
  cylinder{B1, B2, Rad1}
  cylinder{B2, B3, Rad1}
  cylinder{B3, B4, Rad1}
  cylinder{B4, B1, Rad1}
  cylinder{T1, T2, Rad1}
  cylinder{T2, T3, Rad1}
  cylinder{T3, T4, Rad1}
  cylinder{T4, T1, Rad1}
  cylinder{T1, B1, Rad1}
  cylinder{T2, B2, Rad1}
  cylinder{T3, B3, Rad1}
  cylinder{T4, B4, Rad1}
  box{<B1.x,B1.y,LocA.z>,<T3.x,T3.y,LocB.z>}
  box{<LocA.x,B1.y,B1.z>,<LocB.x,T3.y,T3.z>}
  box{<B1.x,LocA.y,B1.z>,<T3.x,LocB.y,T3.z>}
  bounded_by{box{LocA,LocB}}
}
#end
// ----- scene -----
#version unofficial MegaPov 0.7;
global_settings {
   assumed_gamma 2.2
   max_trace_level 25
}
light_source {< -500, 500, -500> color White * 1.0}
camera { location <0,0,-3> look_at  <0,0,0>}

difference {
   object {RoundBox(<-1,-1,-1>,<1,1,1>,.5) scale <1.00,1.00,1.00>}
   object {RoundBox(<-1,-1,-1>,<1,1,1>,.5) scale <0.98,0.98,2.01>}
   scale <1,0.25,0.15>
   bounded_by{box{<-1,-.25,-.15>,<1,.25,.15>}}
   texture {pigment {Green} finish {ambient 0.4}}
   rotate <-90,0,90>
   rotate y * 45
}
sphere {<0,0,0> , 1300.0 texture {pigment { Gray90 }} hollow}

--
light_source{<-9,9,-9>rgb x+y+z}text{ttf"timrom.ttf"    // timothyea
"Tim Attwood".1,0 pigment{rgb x+y}translate<-2.7,-.3,5>}// @worldnet.att.net
sky_sphere {pigment{gradient y color_map{[.45 rgb<.2,.3,.2>][0.5 rgb x+y+z]
[0.55 rgb x+y][0.6 rgb x+.5*y][.7 rgb 0]}scale 2 translate -1}}


Post a reply to this message

From: Patrick Dugan
Subject: Re: Holes in SuperEllipsoids
Date: 9 Jul 2001 00:44:26
Message: <3b4936aa@news.povray.org>
Thank you!  That works very nicely.  I still can't figure out what why the
SEO messes up.

"Tim Attwood" <tim### [at] worldnetattnet> wrote in message
news:3B490638.D342FF02@worldnet.att.net...
> > I am tryting to create a difference between two Superquadric Ellipsoid
> > Objects.  Whenever I do this the object has some odd cutouts that appear
at
> > certain angles.  I will post the image example in the binaries/images
area.
> > Anything I can do to get the same object shape without the cutouts?
Here is
> > my questionable code...
>
> Well, that looks like the normal on some of the triangles got flipped
somewhere
> inside POV.  You can get the same shape with a CSG, "rounded box".  Here's
> some code, the first part is a RoundBox macro and the second your example
> rewritten to use it.
>
> // ----- RoundBox -----
> // LocA and LocB are box corners, Rad1 is the rounding radius
> #macro RoundBox(LocA, LocB, Rad1)
> merge {
>   #local B1 = <LocA.x+Rad1,LocA.y+Rad1,LocA.z+Rad1>;
>   #local B2 = <LocA.x+Rad1,LocA.y+Rad1,LocB.z-Rad1>;
>   #local B3 = <LocB.x-Rad1,LocA.y+Rad1,LocB.z-Rad1>;
>   #local B4 = <LocB.x-Rad1,LocA.y+Rad1,LocA.z+Rad1>;
>   #local T1 = <LocA.x+Rad1,LocB.y-Rad1,LocA.z+Rad1>;
>   #local T2 = <LocA.x+Rad1,LocB.y-Rad1,LocB.z-Rad1>;
>   #local T3 = <LocB.x-Rad1,LocB.y-Rad1,LocB.z-Rad1>;
>   #local T4 = <LocB.x-Rad1,LocB.y-Rad1,LocA.z+Rad1>;
>   sphere{B1, Rad1}
>   sphere{B2, Rad1}
>   sphere{B3, Rad1}
>   sphere{B4, Rad1}
>   sphere{T1, Rad1}
>   sphere{T2, Rad1}
>   sphere{T3, Rad1}
>   sphere{T4, Rad1}
>   cylinder{B1, B2, Rad1}
>   cylinder{B2, B3, Rad1}
>   cylinder{B3, B4, Rad1}
>   cylinder{B4, B1, Rad1}
>   cylinder{T1, T2, Rad1}
>   cylinder{T2, T3, Rad1}
>   cylinder{T3, T4, Rad1}
>   cylinder{T4, T1, Rad1}
>   cylinder{T1, B1, Rad1}
>   cylinder{T2, B2, Rad1}
>   cylinder{T3, B3, Rad1}
>   cylinder{T4, B4, Rad1}
>   box{<B1.x,B1.y,LocA.z>,<T3.x,T3.y,LocB.z>}
>   box{<LocA.x,B1.y,B1.z>,<LocB.x,T3.y,T3.z>}
>   box{<B1.x,LocA.y,B1.z>,<T3.x,LocB.y,T3.z>}
>   bounded_by{box{LocA,LocB}}
> }
> #end
> // ----- scene -----
> #version unofficial MegaPov 0.7;
> global_settings {
>    assumed_gamma 2.2
>    max_trace_level 25
> }
> light_source {< -500, 500, -500> color White * 1.0}
> camera { location <0,0,-3> look_at  <0,0,0>}
>
> difference {
>    object {RoundBox(<-1,-1,-1>,<1,1,1>,.5) scale <1.00,1.00,1.00>}
>    object {RoundBox(<-1,-1,-1>,<1,1,1>,.5) scale <0.98,0.98,2.01>}
>    scale <1,0.25,0.15>
>    bounded_by{box{<-1,-.25,-.15>,<1,.25,.15>}}
>    texture {pigment {Green} finish {ambient 0.4}}
>    rotate <-90,0,90>
>    rotate y * 45
> }
> sphere {<0,0,0> , 1300.0 texture {pigment { Gray90 }} hollow}
>
> --
> light_source{<-9,9,-9>rgb x+y+z}text{ttf"timrom.ttf"    // timothyea
> "Tim Attwood".1,0 pigment{rgb x+y}translate<-2.7,-.3,5>}//
@worldnet.att.net
> sky_sphere {pigment{gradient y color_map{[.45 rgb<.2,.3,.2>][0.5 rgb
x+y+z]
> [0.55 rgb x+y][0.6 rgb x+.5*y][.7 rgb 0]}scale 2 translate -1}}
>
>


Post a reply to this message

From: Mark Wagner
Subject: Re: Holes in SuperEllipsoids
Date: 9 Jul 2001 01:41:42
Message: <3b494416$1@news.povray.org>
Patrick Dugan wrote in message <3b4936aa@news.povray.org>...
>Thank you!  That works very nicely.  I still can't figure out what why the
>SEO messes up.


I haven't tested your scene code, but it sounds like a known bug with
superellipsoids.  To the best of my knowlege, it has been fixed in the
latest version of MegaPOV, and will be fixed in the next official version of
POV-Ray.

--
Mark


Post a reply to this message

From: Bob H 
Subject: Re: Holes in SuperEllipsoids
Date: 9 Jul 2001 02:48:09
Message: <3b4953a9@news.povray.org>
"Mark Wagner" <mar### [at] gtenet> wrote in message
news:3b494416$1@news.povray.org...
> Patrick Dugan wrote in message <3b4936aa@news.povray.org>...
> >Thank you!  That works very nicely.  I still can't figure out what why
the
> >SEO messes up.
>
> I haven't tested your scene code, but it sounds like a known bug with
> superellipsoids.  To the best of my knowlege, it has been fixed in the
> latest version of MegaPOV, and will be fixed in the next official version
of
> POV-Ray.

Not v0.7 and don't count on it for v3.5.

Bob H.


Post a reply to this message

From: Chris Huff
Subject: Re: Holes in SuperEllipsoids
Date: 10 Jul 2001 14:52:05
Message: <chrishuff-DBE04A.13503310072001@povray.org>
In article <3B490638.D342FF02@worldnet.att.net>,
 Tim Attwood <tim### [at] worldnetattnet> wrote:

> Well, that looks like the normal on some of the triangles got flipped 
> somewhere inside POV. 

The scene he posted didn't use any triangles, just a CSG difference with 
two superellipsoids. This is probably an error in the solving method, 
maybe some intersections are not being found.


> You can get the same shape with a CSG, "rounded box".  Here's some 
> code, the first part is a RoundBox macro and the second your example 
> rewritten to use it.

BTW, the shape of a "rounded box" is not exactly the same as a 
superellipsoid...the superellipsoid doesn't have any truely flat areas.

A CSG shape might actually be faster than a similar superellipsoid...it 
will use more memory, of course. Another solution would be to use a 
difference of two isosurface superellipsoids...isosurfaces use a 
completely different solving method which might render without 
artifacts, and can sometimes be faster...though harder to use.

-- 
Christopher James Huff - chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Tim Attwood
Subject: Re: Holes in SuperEllipsoids
Date: 11 Jul 2001 04:09:05
Message: <3B4C0999.4B6E9E0C@worldnet.att.net>
> The scene he posted didn't use any triangles, just a CSG difference with
> two superellipsoids. This is probably an error in the solving method,
> maybe some intersections are not being found.

I meant that... (some internal POV tesselation error).

> BTW, the shape of a "rounded box" is not exactly the same as a
> superellipsoid...the superellipsoid doesn't have any truely flat areas.
>
> A CSG shape might actually be faster than a similar superellipsoid...it
> will use more memory, of course. Another solution would be to use a
> difference of two isosurface superellipsoids...isosurfaces use a
> completely different solving method which might render without
> artifacts, and can sometimes be faster...though harder to use.

Actually RoundBox is very close on the flatish areas, and differs more
where it actually curves: the superellipsoid follows a parabolic. Here's
a scene to show the difference.

camera {
 location  <0, 0, -3.0>
 look_at   <0, 0,  0.0>
 orthographic
}
union {
  object {RoundBox(<-1,-1,-1>,<1,1,1>,.5) pigment {Blue}}
  superellipsoid{<.25,.25> pigment{Red} translate <0,0,2>}
  translate <1,-1,0>
  scale <4,4,.25>
  translate <-1,1,0>
}

Maybe a superellipsoid could be more closely approximated by scaling some
of the RoundBox components then rotating them.
--
light_source{<-9,9,-9>rgb x+y+z}text{ttf"timrom.ttf"    // timothyea
"Tim Attwood".1,0 pigment{rgb x+y}translate<-2.7,-.3,5>}// @worldnet.att.net
sky_sphere {pigment{gradient y color_map{[.45 rgb<.2,.3,.2>][0.5 rgb x+y+z]
[0.55 rgb x+y][0.6 rgb x+.5*y][.7 rgb 0]}scale 2 translate -1}}


Post a reply to this message

From: Ken
Subject: Re: Holes in SuperEllipsoids
Date: 11 Jul 2001 08:50:23
Message: <3B4C4B87.37BBE2EF@pacbell.net>
Tim Attwood wrote:
> 
> > The scene he posted didn't use any triangles, just a CSG difference with
> > two superellipsoids. This is probably an error in the solving method,
> > maybe some intersections are not being found.
> 
> I meant that... (some internal POV tesselation error).

Except in a couple of cases (like HF's and bicubic patches) POV-Ray
does not do internal tesselation. All of POV-Ray's primitives are
mathematical constructs and are not internally tesselated. Which is
also true of the superellipsoid object.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Tim Attwood
Subject: Re: Holes in SuperEllipsoids
Date: 11 Jul 2001 18:57:46
Message: <3B4CD9E1.5CC09A87@worldnet.att.net>
> Except in a couple of cases (like HF's and bicubic patches) POV-Ray
> does not do internal tesselation. All of POV-Ray's primitives are
> mathematical constructs and are not internally tesselated. Which is
> also true of the superellipsoid object.

Well, it is a triangle shaped hole. *shrug*
--
light_source{<-9,9,-9>rgb x+y+z}text{ttf"timrom.ttf"    // timothyea
"Tim Attwood".1,0 pigment{rgb x+y}translate<-2.7,-.3,5>}// @worldnet.att.net
sky_sphere {pigment{gradient y color_map{[.45 rgb<.2,.3,.2>][0.5 rgb x+y+z]
[0.55 rgb x+y][0.6 rgb x+.5*y][.7 rgb 0]}scale 2 translate -1}}


Post a reply to this message

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