POV-Ray : Newsgroups : povray.binaries.images : Zeger's greebles.inc Server Time
7 Aug 2024 05:14:11 EDT (-0400)
  Zeger's greebles.inc (Message 1 to 10 of 10)  
From: Doctor John
Subject: Zeger's greebles.inc
Date: 8 Jun 2006 05:30:05
Message: <4487ee1d@news.povray.org>
Whilst attempting to debug Zeger's greebles.inc I managed to produce the 
attached - definitely "under construction". Also attached both pov and 
megapov output for unmodified Zeger code
Now for the bit that is likely to provoke a few flames
#declare FLAMEPROOF_UNDERWEAR=true;
First thing to be spotted
#macro RoundPrism(Points,R,H)
    #local Aantal=dimension_size(Points,1);
    #local Tel=0;
    #local Aantal2=Aantal;
    #local Points2=array[Aantal];
-- CUT --
 BLAH
-- CUT --
         #if (Aantal2>2)
            polygon {
                Aantal2,
                #local Tel=0;
                #while (Tel<Aantal)
                    #ifdef(Points2[Tel])
                        <Points2[Tel].x,Points2[Tel].y>
                    #end
                    #local Tel=Tel+1;
                #end
                translate -z*H
            }
        #end
    rotate x*90
    }
#end
Surely there's a fencepost error here. If I wish to produce an n-sided 
polygon, I need n+1 (Antaal+1) points.
Possibly -
polygon {
       Aantal2,
              #local Tel=0;
                #while (Tel<Aantal+1) //Umm....why are we using Antaal 
instead of Antaal2??
                    #ifdef(Points2[Tel])
                        <Points2[Tel].x,Points2[Tel].y>,
                    #end
                    #local Tel=Tel+1;
                <Points2[0].x,Points2[0].y>
                #end
                translate -z*H
            }
                -would work and prevent the "polygon not closed" warnings
Secondly (and to my eyes this a BIG problem) why is the macro 
VerdeelSuperellipsoid calling itself?
#macro 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,BevelHeight,StepF,StepB,Diepte)
 #if (Diepte<0)
  #local Scale=BevelHeight*(.5+rand(Seed)*.5);
  SuperEllipsoidSegment(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,StepF,StepB)
  #ifndef (Detail) #local Detail=5; #end
  SuperEllipsoidGreeble(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,Detail,StepF,StepB)
 #else
  #local PercentageU=.5+(rand(Seed)-rand(Seed))*.5*.6;
  #local PercentageV=.5+(rand(Seed)-rand(Seed))*.5*.6;
  #local FM=F1+(F2-F1)*PercentageU;
  #local BM=B1+(B2-B1)*PercentageV;
XXXX 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,B1,BM,Bevel,BevelHeight,StepF,StepB,Verlaag(Diepte))
XXXX 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,B1,BM,Bevel,BevelHeight,StepF,StepB,Verlaag(Diepte))
XXXX 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,BM,B2,Bevel,BevelHeight,StepF,StepB,Verlaag(Diepte))
XXXX 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,BM,B2,Bevel,BevelHeight,StepF,StepB,Verlaag(Diepte))
 #end
#end
Enlightenment needed.
#declare FLAMEPROOF_UNDERWEAR=false;

John
-- 
"Please refrain from fondling the nymphs and sprites - it makes them giggly
and skittish.
Thank you for your co-operation.
The Management"


Post a reply to this message


Attachments:
Download 'greebletest.jpg' (130 KB) Download 'greebletest.txt' (5 KB) Download 'greebletestpov.txt' (4 KB)

Preview of image 'greebletest.jpg'
greebletest.jpg

From: Doctor John
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 05:35:15
Message: <4487ef53$1@news.povray.org>
Oops, forgot to mention that I produced the image by commenting out that 
polygon block in macro RoundPrism

John
-- 
"Please refrain from fondling the nymphs and sprites - it makes them giggly
and skittish.
Thank you for your co-operation.
The Management"


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 08:17:36
Message: <44881560$1@news.povray.org>
"Doctor John" <doc### [at] linuxmailorg> wrote in message 
news:4487ee1d@news.povray.org...
> Whilst attempting to debug Zeger's greebles.inc I managed to produce 
the 
> attached - definitely "under construction". Also attached both pov and 

> megapov output for unmodified Zeger code
> Now for the bit that is likely to provoke a few flames
> #declare FLAMEPROOF_UNDERWEAR=true;
> First thing to be spotted
> #macro RoundPrism(Points,R,H)
>     #local Aantal=dimension_size(Points,1);
>     #local Tel=0;
>     #local Aantal2=Aantal;
>     #local Points2=array[Aantal];
> -- CUT --
>  BLAH
> -- CUT --
>          #if (Aantal2>2)
>             polygon {
>                 Aantal2,
>                 #local Tel=0;
>                 #while (Tel<Aantal)
>                     #ifdef(Points2[Tel])
>                         <Points2[Tel].x,Points2[Tel].y>
>                     #end
>                     #local Tel=Tel+1;
>                 #end
>                 translate -z*H
>             }
>         #end
>     rotate x*90
>     }
> #end
> Surely there's a fencepost error here. If I wish to produce an n-sided 

> polygon, I need n+1 (Antaal+1) points.
> Possibly -
> polygon {
>        Aantal2,
>               #local Tel=0;
>                 #while (Tel<Aantal+1) //Umm....why are we using Antaal 

> instead of Antaal2??
>                     #ifdef(Points2[Tel])
>                         <Points2[Tel].x,Points2[Tel].y>,
>                     #end
>                     #local Tel=Tel+1;
>                 <Points2[0].x,Points2[0].y>
>                 #end
>                 translate -z*H
>             }
>                 -would work and prevent the "polygon not closed" 
warnings

I tend to ignore warnings, but yes, indeed, that would be better :)

but that's not the problem though, POV-Ray just closes the prism for you 
if you forget to

> Secondly (and to my eyes this a BIG problem) why is the macro 
> VerdeelSuperellipsoid calling itself?
> #macro 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,BevelHeight,StepF,
StepB,Diepte)
>  #if (Diepte<0)
>   #local Scale=BevelHeight*(.5+rand(Seed)*.5);
>   
SuperEllipsoidSegment(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,StepF,StepB)

>   #ifndef (Detail) #local Detail=5; #end
>   
SuperEllipsoidGreeble(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,Detail,StepF
,StepB)
>  #else
>   #local PercentageU=.5+(rand(Seed)-rand(Seed))*.5*.6;
>   #local PercentageV=.5+(rand(Seed)-rand(Seed))*.5*.6;
>   #local FM=F1+(F2-F1)*PercentageU;
>   #local BM=B1+(B2-B1)*PercentageV;
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,B1,BM,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,B1,BM,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,BM,B2,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,BM,B2,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
>  #end
> #end
> Enlightenment needed.

because it's a recursive macro, that's the whole idea :)

but, as far as I know, there are no problems with the 
superellipsoidal-greebles.

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

From: Doctor John
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 09:12:29
Message: <4488223d@news.povray.org>
"Zeger Knaepen" <zeg### [at] povplacecom> wrote in message 
news:44881560$1@news.povray.org...
>"Doctor John" <doc### [at] linuxmailorg> wrote in message 
>news:4487ee1d@news.povray.org...
>>                 -would work and prevent the "polygon not closed" warnings

>I tend to ignore warnings, but yes, indeed, that would be better :)
>but that's not the problem though, POV-Ray just closes the prism for you if 
>you forget to

True, but you've then got less output to wade through when things don't work

>> Secondly (and to my eyes this a BIG problem) why is the macro
>> VerdeelSuperellipsoid calling itself?
>> Enlightenment needed.

>because it's a recursive macro, that's the whole idea :)
>but, as far as I know, there are no problems with the 
>superellipsoidal-greebles.

Unfortunately, that's exactly where we seem to be getting problems. As soon 
as I comment out the superellipsoid bits in greebletest.pov everything runs 
perfectly

I shall carry on trying to figure out exactly where your code produces the 
Singular Matrix error (b4 anyone mentions it I already know that MInvers is 
a function in matrices.cpp and that it's the only place in the source code 
that generates a Singular Matrix error)

BTW Zeger, none of the above is a criticism of you or your coding. I 
actually think that the concept is brilliant; I'm just having problems with 
the implementation.

John
-- 
"Please refrain from fondling the nymphs and sprites - it makes them giggly
and skittish.
Thank you for your co-operation.
The Management"


Post a reply to this message

From: Ross
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 10:50:13
Message: <44883925@news.povray.org>
Zeger's Greebles, Inc. sounds like a good company name :)


Post a reply to this message

From: Stephen
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 11:25:00
Message: <web.448840cb6d0cce98c6b359800@news.povray.org>
"Ross" <rli### [at] everestkcnet> wrote:
> Zeger's Greebles, Inc. sounds like a good company name :)

Zeger's Greebles sounds like a condition or people you might want to avoid,
to me :-)

Stephen


Post a reply to this message

From: stm31415
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 11:45:00
Message: <web.448845ce6d0cce988010b7e50@news.povray.org>
"Stephen" <mcavoys_AT_aolDOT.com> wrote:
> "Ross" <rli### [at] everestkcnet> wrote:
> > Zeger's Greebles, Inc. sounds like a good company name :)
>
> Zeger's Greebles sounds like a condition or people you might want to avoid,
> to me :-)
>
> Stephen

Nah, man - they're fuzzy with cute little noses and they have a children's
TV show on PBS.


-s
5TF!


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 13:31:57
Message: <44885f0d@news.povray.org>
> >> Secondly (and to my eyes this a BIG problem) why is the macro
> >> VerdeelSuperellipsoid calling itself?
> >> Enlightenment needed.
> 
> >because it's a recursive macro, that's the whole idea :)
> >but, as far as I know, there are no problems with the 
> >superellipsoidal-greebles.
> 
> Unfortunately, that's exactly where we seem to be getting problems. As 
soon 
> as I comment out the superellipsoid bits in greebletest.pov everything 
runs 
> perfectly

hmm, sounds impossible to me...
let's see

hmm, you must be commenting out something else, the only problem I get, 
is a "Singular matrix in MInvers" error, always with the polygon in 
RoundPrism(..), which has nothing to do with the superellipsoidal 
greebles (those are all triangles)

Trust me, the only kind of greebles that will get you that error, are 
polygon-greebles (or prism-greebles, which are just combinations of 
polygon-greebles :))

> I shall carry on trying to figure out exactly where your code produces 
the 
> Singular Matrix error (b4 anyone mentions it I already know that 
MInvers is 
> a function in matrices.cpp and that it's the only place in the source 
code 
> that generates a Singular Matrix error)

I really think it's just a matter of scale.

Let me try something!
there you go...

in RoundPrism(..), changing

  polygon {
   Aantal2,
   #local Tel=0;
   #while (Tel<Aantal)
    #ifdef(Points2[Tel])<Points2[Tel].x,Points2[Tel].y> #end
    #local Tel=Tel+1;
   #end
   translate -z*H
  }

into

  polygon {
   Aantal2,
   #local Tel=0;
   #while (Tel<Aantal)
    #ifdef(Points2[Tel])<Points2[Tel].x,Points2[Tel].y>*100000 #end
    #local Tel=Tel+1;
   #end
   scale 1/100000
   translate -z*H
  }

fixes the problem, in this particular case.  Enough proof for me that 
the problem is that the points in the polygon are too close together :-/

> BTW Zeger, none of the above is a criticism of you or your coding. I 
> actually think that the concept is brilliant; I'm just having problems 
with 
> the implementation.

well, if it works, and it kind of does :), then the implementation 
shouldn't matter too much :)
but, it's "opensource" for a reason, of course.  If you know how to do 
it faster, or better, then by all means, do so ! :)

what I do, is more or less this:

I recursively subdivide the surface along the U and V directions (or X 
and Z for polygons), like this:

Let's say, you have a rectangle going from U=0 to U=1 and V=0 to 
V=1.  Now take a random point between <0,0> and <1,1>, for example, a 
purely random choice :), <.5,.5>

given this point, you can now make 4 rectangles: <0,0> -> <.5,.5>, 
<0,.5> -> <.5,1>, <.5,0> -> <1,.5>, and <.5,.5> -> <1,1>

do the same thing with these 4 rectangles, and you get, if I'm not 
mistaken, 16 rectangles, and so on and so on untill you're tired of 
subdividing :)

now, draw every one of those sub-rectangles as a beveled prism with a 
bevel-width that is, of course, smaller than half the size of the 
rectangle, and a random bevel-height.  Those are the greeble-cells.

Every greeble-cell needs to have some greebles, of course, so add up to 
5 (or whatever number, I'm going to keep on saying 5 just for the ease 
of typing) beveled rectangles that fit insinde the greeble-cell, up to 5 
little rounded cylinders (superellipsoids), up to 5 cylinders going 
along the U-direction and up to 5 cylinders going along the V-direction.

that's it.  That's the idea with rectangles, but it's the analog with 
cylinders or superellipsoid.

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

From: Sven Littkowski
Subject: Re: Zeger's greebles.inc
Date: 8 Jun 2006 15:21:29
Message: <448878b9@news.povray.org>
Well, what about "Industrial Light and Greebles inc."? Sounds similar to a 
big known company somehow involved with the Star Wars saga...

Best greetings,

Sven




"Ross" <rli### [at] everestkcnet> schrieb im Newsbeitrag 
news:44883925@news.povray.org...
> Zeger's Greebles, Inc. sounds like a good company name :)


Post a reply to this message

From: Doctor John
Subject: Re: Zeger's greebles.inc
Date: 9 Jun 2006 06:00:34
Message: <448946c2$1@news.povray.org>
(((8(|) Doh!!
... also Mea Culpa! Mea Culpa! Mea Maxima Culpa!!
Don't know how I made the mistake (prob. tiredness - see off-topic for 
details), it's GreebledRoundPrism or children thats causing the problem. I 
still can't see why its causing the Singular Matrix error but a few days 
should allow me to find a workaround or even a solution.
Thanx for the extra code - I'll look at it in between World Cup games, work 
and moving house.

John
-- 
"Please refrain from fondling the nymphs and sprites - it makes them giggly
and skittish.
Thank you for your co-operation.
The Management"


Post a reply to this message

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