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
7 Nov 2024 09:28:06 EST (-0500)
  Re: my very first iso-surface (and second macro) :-)  
From: Jaap
Date: 4 Sep 2004 15:50:00
Message: <web.413a1bb4f757768da8399d8d0@news.povray.org>
Kurts <kur### [at] yahoofr> wrote:
> 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.
>

chamOut only makes the thread less sharp.

it's the "thrDepts+z-totalLen" bit you want to remove:

    function{ max(
      sqrt(pow(x,2)+pow(y,2))-thrRad + // cilinder
      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
      ,2*thrOD-sqrt(pow(x,2)+pow(y,2)+
      pow(totalLen+thrOD*1.965-z,2)) )}// = dimple in end

you may also remove the dimpled end (sphere):
"2*thrOD-sqrt(pow(x,2)+pow(y,2)+pow(totalLen+thrOD*1.965-z,2))"

    function{
      sqrt(pow(x,2)+pow(y,2))-thrRad + // cilinder
      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

and remove the solid part:

    function{
      sqrt(pow(x,2)+pow(y,2))-thrRad + // cilinder
      thrDepts*max(chamOut,abs(mod(2+z*thrs*2+atan2(x,y)/pi,2)-1))}

i guess i should break it up in seperate functions before doing all
the min()/max() stuff.

replacing "thrDepts+z-totalLen"
with "thrRad+z-totalLen" will make a bold with a sharp point.

"atan2(x,y)/pi" is used to calculate how far we have completed a
revolution, witch is used to shift each thread exactly one thread
per revolution.

replacing "2+z*thrs*2+atan2(x,y)/pi" with
"10+z*thrs*2+2*atan2(x,y)/pi" should create a double thread.
the "10" is needed to keep things away from zero (the direction
of the thread will change if we cross sero with mod( ,2) )

jaap.


Post a reply to this message

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