POV-Ray : Newsgroups : povray.general : There must be a better way to do threads : There must be a better way to do threads Server Time
2 Nov 2024 09:19:51 EDT (-0400)
  There must be a better way to do threads  
From: Jack Twilley
Date: 25 Mar 2004 09:18:05
Message: <86brml810l.fsf@duchess.twilley.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've googled for examples on threads (on bolts and the like) and I've
written a macro that looks like this:

#macro do_threads (turns, start, length, outer, inner, perturn)
union {
  #local index = 0;
  #local total = 360*turns;
  #while (index < total)
    #local zee = start+index*length/total;
    cone {
      <outer, 0, zee> length/turns <inner, 0, zee> 0
      rotate index*z
    }
    #local index = index + 360/perturn;
  #end
}
#end

This macro creates a jillion (well, perturn*turns) cones to simulate a
triangular spiral prism.  It works, but it's ugly and slow as a dog.
Please tell me that there's a better way.  I stared at the docs for
lathe and prism, and I couldn't see anything useful there.

Help?

Jack.
- -- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAYuneGPFSfAB/ezgRAoMGAJ0aaJINe5OpXNP7UMxa9j1/coNovACgnBUu
MlX93neI9Bx0USOF+Tt13pE=
=Jafi
-----END PGP SIGNATURE-----


Post a reply to this message

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