POV-Ray : Newsgroups : povray.text.scene-files : Latice work Macros and examples Server Time
28 Jul 2024 16:22:55 EDT (-0400)
  Latice work Macros and examples (Message 1 to 3 of 3)  
From: Steve
Subject: Latice work Macros and examples
Date: 1 Nov 1999 17:34:38
Message: <381E10A6.E39B11D8@ndirect.co.uk>
Textures must be declared before the macro call, but you can
change that if you wnat to.

The paramaters VVertical and HHorizontal refer to the amount
of pov units you want to fill, so if you use

object{Laticework(10,10,0.5,T_Wood31)}  

the finished product will cover an area <-5,-5,-0.25>,
<5,5,0.25>.  obviously you can translate and rotate after
calling.  

The version that uses cylinders instead of a box for the
center piece is CylLatice which is also icluded
below.

Enjoy
Steve


// ***************************************  Laticework 
***********************************

#macro
Laticework(VVertical,HHorizontal,Thickness,LaticeTexture)
  #declare LongBox
=                                                                       
  union{
       
box{<-1.5,-0.25,-(Thickness/2)>,<1.5,0.25,Thickness/2>}                               
                                       
        box{<-0.5,-0.5,-(Thickness/2)>,<0.5,0.5,Thickness/2>
rotate z*45}
       
       }//End of
union                                                                  
                         
  #declare LaticePiece=
  union{
        object{LongBox}
        object{LongBox translate y*2.5}
        object{LongBox rotate z*-90 translate <1.25,1.25,0>}
        object{LongBox rotate z*-90 translate
<-1.25,1.25,0>}
       
        rotate z*45
        scale<0.25,0.25,1>
        
       }                    

  union{
        #local Accross=0;
        #local MoveIt=0.875;
        
        #while(Accross<HHorizontal)
  
          #local UpDown=0;
  
          #while(UpDown<VVertical)           
            object{LaticePiece translate <Accross,UpDown,0>}
            #local UpDown=UpDown+MoveIt;
          #end    
      
          #local Accross=Accross+MoveIt;

        #end //End of outer While.
       
        texture{LaticeTexture}      
        translate<-(HHorizontal/2),-(VVertical/2),0>
       } //End of union.

#end  //End of macro. 

//**************************  CylLatice  
************************************************

#macro
CylLaticework(VVertical,HHorizontal,Thickness,LaticeTexture)
  #declare LongBox
=                                                                       
  union{
       
box{<-1.5,-0.25,-(Thickness/2)>,<1.5,0.25,Thickness/2>}                               
               
        cylinder{<0,0,-(Thickness/2)>,<0,0,Thickness/2>,0.5}
        
       }//End of
union                                                                  
                         
  #declare LaticePiece=
  union{
        object{LongBox}
        object{LongBox translate y*2.5}
        object{LongBox rotate z*-90 translate <1.25,1.25,0>}
        object{LongBox rotate z*-90 translate
<-1.25,1.25,0>}
       
        rotate z*45
        scale<0.25,0.25,1>
        
       }                    

  union{
        #local Accross=0;
        #local MoveIt=0.875;
        
        #while(Accross<HHorizontal)
  
          #local UpDown=0;
  
          #while(UpDown<VVertical)           
            object{LaticePiece translate <Accross,UpDown,0>}
            #local UpDown=UpDown+MoveIt;
          #end    
      
          #local Accross=Accross+MoveIt;

        #end //End of outer While.
        
        texture{LaticeTexture}      
        translate<-(HHorizontal/2),-(VVertical/2),0>
       } //End of union.

#end  //End of macro. 




-- 
Cheers
Steve              email mailto:sjl### [at] ndirectcouk

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.ndirect.co.uk/~sjlen/

or  http://start.at/zero-pps


Post a reply to this message

From: ingo
Subject: Re: Latice work Macros and examples
Date: 2 Nov 1999 12:13:10
Message: <8E72BD482seed7@212.120.113.81>
Steve wrote:

>Textures must be declared before the macro call, but you can
>change that if you wnat to.
>

Thanks Steve.

For some inspiration for lattice designing I can recommend this 
book:

Cinese Lattice Designs
by Daniel Sheets Dye
ISBN  0-486-23096-1
Dover Publications, Inc. New York
~ $13.95
It has over 1200 illustrations.

Ingo


Post a reply to this message

From: Steve
Subject: Re: Latice work Macros and examples
Date: 3 Nov 1999 09:11:39
Message: <382032BC.4F9BC5BB@ndirect.co.uk>
Thanks ingo, I've made a note of this and will try to get it
from the library.

ingo wrote:
> 
> Steve wrote:
> 
> >Textures must be declared before the macro call, but you can
> >change that if you wnat to.
> >
> 
> Thanks Steve.
> 
> For some inspiration for lattice designing I can recommend this
> book:
> 
> Cinese Lattice Designs
> by Daniel Sheets Dye
> ISBN  0-486-23096-1
> Dover Publications, Inc. New York
> ~ $13.95
> It has over 1200 illustrations.
> 
> Ingo

-- 
Cheers
Steve              email mailto:sjl### [at] ndirectcouk

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.ndirect.co.uk/~sjlen/

or  http://start.at/zero-pps


Post a reply to this message

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