POV-Ray : Newsgroups : povray.general : There must be a better way to do threads : Re: There must be a better way to do threads Server Time
3 Aug 2024 08:09:05 EDT (-0400)
  Re: There must be a better way to do threads  
From: Alf Peake
Date: 25 Mar 2004 10:34:24
Message: <4062fc00@news.povray.org>
Hi Jack

Have you tried pov's helix function (the thread shape does not have to
be round)?

Try playing with this:

//Start extract
#include "functions.inc"

// Bolt - thread is made 4 times larger.
#declare Thread =
isosurface {
  function{ f_helix1(x,y,z, 1, 40, 0.12, 0.28, 0.7, 2, 0) }
  contained_by{ box{ <-0.5,-3,-0.5>,<0.5,-0.6,0.5> } }
  accuracy 0.0001
  max_gradient 1.7
}

#declare Bolt =
difference{
   union{
      cylinder{ 0, y*0.3, 0.3 } // Head
      object{ Thread scale 0.25 }
      cylinder{ -y*0.75, -y*0.1, 0.07 }
      cylinder{ <0,-0.15,0>, <0,0.05,0>, 0.1 }
   }
   torus{ 0.1, 0.04 translate -y*0.15 }
   box{ <-0.05,0.2,-0.4>, <0.05,0.35,0.4> }
}
// End extract

You can see an example of these here:
http://www.peake42.freeserve.co.uk/pix1/tape.jpg

There is also a "Nut and Bolt" macro out there somewhere (also try
p.b.s-f and p.t.s-f).


-- 
Alf

http://www.peake42.freeserve.co.uk/
http://www.qsl.net/gw3srg/


Post a reply to this message

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