POV-Ray : Newsgroups : povray.general : Standard machine screw threads, via f_helix1 isosurface : Re: Standard machine screw threads, via f_helix1 isosurface Server Time
26 Apr 2024 22:25:08 EDT (-0400)
  Re: Standard machine screw threads, via f_helix1 isosurface  
From: Robert Munyer
Date: 9 Jun 2019 07:40:30
Message: <87blz76l7e.fsf@munyer.com>
Bald Eagle wrote:

>> #local D_maj = (4 * 13/1000 + 3/50) * 25.4;
>
> 13/1000, 3/50 ... These are "magic numbers" - what do they mean?

Those are numbers that were chosen more than 100 years ago, for
reasons that I don't claim to understand, by the people who set
up the gage number system that is still used for smaller American
thread sizes.  You don't need them for larger American sizes nor
for metric sizes.


>>         f_helix1 (x, y, - z, 1, Density * 2 * pi, sqrt (3/4) / Density,
>>                   D_maj / 2 - sqrt (147/256) / Density, sqrt (1/3), 2, 0)
>
> Same here - sqrt (3/4)?  sqrt (147/256)? :O   sqrt (1/3)?

These are also based on numbers that were chosen more than 100
years ago for reasons that I don't claim to understand, but these
have been processed by running the algebra and trigonometry in
f_helix1's source code backward!


> I'm thinking either use an array, and do something like
>
> ScrewArray [2] = { blah blah isosurface parameters}
>
> #declare M3_05 = 0;
> #declare Num4_40 = 1;
> and then you can
> #declare ScrewType = Num4_40;  // then use this to get ScrewArray [ScrewType]

Please note that D_maj and Density are the only values that would
need to be in that array.  Everything else is constant, regardless
of thread size, regardless of American thread vs. metric thread.


> It would be a nice little include file.

I have no plans to produce such an include file, but anyone who
wants to do so should feel free to do so.  I consider the code
that I've posted in this thread to be "public domain" code.


P.S.  It's possible to use "min" and "max" inside the isosurface
function, to replace the "union" and "intersection" outside of it.
I don't know whether this approach would render faster or slower.


Post a reply to this message

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