POV-Ray : Newsgroups : povray.binaries.images : my very first iso-surface (and second macro) :-) : Re: my very first iso-surface (and second macro) :-) Server Time
10 Aug 2024 09:13:11 EDT (-0400)
  Re: my very first iso-surface (and second macro) :-)  
From: Kurts
Date: 4 Sep 2004 08:07:50
Message: <kurtzlepirate-51CD78.14075004092004@news.povray.org>
In article <web.4139722b2521c5a8399d8d0@news.povray.org>,
 "Jaap" <jws### [at] yahoocom> wrote:

> my very first iso-surface (and second macro) :-)
> the thread is a single iso-surface, bold heads and nuts are CSG.
> 
> shown:
>  M3 x 25
>  M6 x 50
>  M10 x 30
>  M16 x 50
>  M64 x 150
> 
> #macro thread_macro( thrOD, totalLen, solidLen, thrSpoed )
>   // thrOD   : outer diameter, before "cutting" the thread.
>   // totalLen: result: <0,0,0> to <0,0,-totalLen>
>   // solidLen: <0,0,0> to <0,0,-solidLen> is not threaded.
>   // thrSpoed: displacement per revolution (spoed) (=25.4/tpi)
>   #declare thrAngle = 60;    // (degrees)
>   #declare chamOut  =  0.05; // chamfer outside (part of threadDepts)
>   #declare thrRad   = 0.5*thrOD;
>   #declare thrs     = 1/thrSpoed;
>   #declare thrDepts = 0.5*thrSpoed/tan(radians(thrAngle)*0.5);
>   isosurface {
>     function{ max(
>       sqrt(pow(x,2)+pow(y,2))-thrRad + // cilinder
>       max( min(thrDepts*max(chamOut,   // chamfered threads
>       abs(mod(2+z*thrs*2+atan2(x,y)/pi,2)-1)), // threads
>       max((z-solidLen)*0.25, 0)),      // = sollid part
>       thrDepts+z-totalLen)             // = chamfered end
>       ,2*thrOD-sqrt(pow(x,2)+pow(y,2)+
>       pow(totalLen+thrOD*1.965-z,2)) )}// = dimple in end
>     max_gradient 2.0
>     accuracy thrOD/1000
>     contained_by{box{<-thrRad,-thrRad,0>,<thrRad,thrRad,totalLen>}}
>     scale <1,1,-1>
>   }
> #end
> 
> jaap.
> ---------------------------------------------------------------------
> [Image]

working on the same thing from long time... but never get the correct result
your isosurface is top !!!

just one thing : how to remove the upper cone ? (from cylinder to thread)
i try to set 'chamOut' from 0.05 to 0 but not works.

a+
louis


Post a reply to this message

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