POV-Ray : Newsgroups : povray.binaries.images : Zeger's greebles.inc : Zeger's greebles.inc Server Time
5 Nov 2024 20:19:35 EST (-0500)
  Zeger's greebles.inc  
From: Doctor John
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

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