POV-Ray : Newsgroups : povray.general : Anyone have a good rusty nail or spike object? Server Time
19 Nov 2024 18:26:33 EST (-0500)
  Anyone have a good rusty nail or spike object? (Message 1 to 5 of 5)  
From: Shay
Subject: Anyone have a good rusty nail or spike object?
Date: 12 Jan 2002 08:58:32
Message: <3c404108$1@news.povray.org>
Need one for something simple I'm doing, but don't have time to work on it
today.


Post a reply to this message

From: TinCanMan
Subject: Re: Anyone have a good rusty nail or spike object?
Date: 14 Jan 2002 11:11:05
Message: <3c430319@news.povray.org>
I have a nail macro around here somewhere if you'd like to see it

-tgq


Post a reply to this message

From: Shay
Subject: Re: Anyone have a good rusty nail or spike object?
Date: 14 Jan 2002 12:46:31
Message: <3c431977$1@news.povray.org>
I would very much like to see it

TinCanMan <Tin### [at] hotmailcom> wrote in message
news:3c430319@news.povray.org...
> I have a nail macro around here somewhere if you'd like to see it
>
> -tgq
>
>


Post a reply to this message

From: TinCanMan
Subject: Re: Anyone have a good rusty nail or spike object?
Date: 14 Jan 2002 13:07:35
Message: <3c431e67$1@news.povray.org>
Try this macro, it makes a standard type of nail with an optional bend in
it:
Dia=diameter of nail
Len=length of nail
Bend=angle of bend in nail (0=none)
BLen=position of bend from tip of nail

i.e.:  object{Nail(5,50,30,25) material{MyMaterial}}

-tgq

//Start Macro

#macro Nail (Dia,Len,Bend,BLen)
  union{
    union{
      cylinder{0 y 1.5*Dia}
      cylinder{0 -(Len-BLen-1.5*Dia*pi*Bend/360)*y Dia/2}
      torus{0.25 Dia/2 scale<1,0.2,1> translate -2*y}
      torus{0.25 Dia/2 scale<1,0.2,1> translate -3*y}
      torus{0.25 Dia/2 scale<1,0.2,1> translate -4*y}
      translate <-1.5*Dia,Len-BLen-1.5*Dia*pi*Bend/360,0>
      rotate<0,0,-Bend>
      translate <1.5*Dia,BLen,0>
    }
    #if (mod(Bend,360)>0)
      difference{
        torus{1.5*Dia Dia/2 rotate<90,0,0>}
        plane{y 0}
        plane{-y 0 rotate<0,0,-Bend>}
        translate <1.5*Dia,BLen,0>
      }
    #end
    cylinder{<0,3*Dia,0> <0,BLen,0> Dia/2}
    difference{
      cylinder{<0,0,0> <0,3*Dia,0> Dia/2}
      plane{-z 0 rotate <12,  0,0>}
      plane{-z 0 rotate <10, 90,0>}
      plane{-z 0 rotate <12,180,0>}
      plane{-z 0 rotate <10,270,0>}
    }
  }
#end


//End Macro


Post a reply to this message

From: Shay
Subject: Re: Anyone have a good rusty nail or spike object?
Date: 15 Jan 2002 10:54:59
Message: <3c4450d3@news.povray.org>
Perfect. Thank you.

TinCanMan <Tin### [at] hotmailcom> wrote in message
news:3c431e67$1@news.povray.org...


Post a reply to this message

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