POV-Ray : Newsgroups : povray.binaries.images : my very first iso-surface (and second macro) :-) Server Time
14 Nov 2024 02:24:21 EST (-0500)
  my very first iso-surface (and second macro) :-) (Message 1 to 9 of 9)  
From: Jaap
Subject: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 03:45:00
Message: <web.4139722b2521c5a8399d8d0@news.povray.org>
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.


Post a reply to this message


Attachments:
Download 'parts3.png' (158 KB)

Preview of image 'parts3.png'
parts3.png


 

From: =Bob=
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 04:08:32
Message: <41397800$1@news.povray.org>
Wow! That looks wonderful. How long to parse & render?
=Bob=


Post a reply to this message

From: Jaap
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 04:25:00
Message: <web.41397b70f757768da8399d8d0@news.povray.org>
"=Bob=" <robertUNDERSCOREdobbinsATmailDOTtdsDOTnet> wrote:
> Wow! That looks wonderful. How long to parse & render?

Er.., just let me re-render it...

render time with pov 3.6: (-j +FN +a0.1)

Isosurface roots:           3554000
Peak memory used:            493921 bytes
Parse Time:    0 hours  0 minutes  1 seconds (1 seconds)
Render Time:   0 hours  6 minutes  7 seconds (367 seconds)
Total Time:    0 hours  6 minutes  8 seconds (368 seconds)

without the big M64 x 150 bold:

Isosurface roots:           1001127
Peak memory used:            485385 bytes
Parse Time:    0 hours  0 minutes  0 seconds (0 seconds)
Render Time:   0 hours  1 minutes 45 seconds (105 seconds)
Total Time:    0 hours  1 minutes 45 seconds (105 seconds)

jaap.


Post a reply to this message

From: =Bob=
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 04:28:30
Message: <41397cae@news.povray.org>
"Jaap" <jws### [at] yahoocom> wrote in message
news:web.41397b70f757768da8399d8d0@news.povray.org...
: "=Bob=" <robertUNDERSCOREdobbinsATmailDOTtdsDOTnet> wrote:
: > Wow! That looks wonderful. How long to parse & render?
:
: Er.., just let me re-render it...
: render time with pov 3.6: (-j +FN +a0.1)
:
: Isosurface roots:           3554000
: Peak memory used:            493921 bytes
: Parse Time:    0 hours  0 minutes  1 seconds (1 seconds)
: Render Time:   0 hours  6 minutes  7 seconds (367 seconds)
: Total Time:    0 hours  6 minutes  8 seconds (368 seconds)
:
: without the big M64 x 150 bold:
:
: Isosurface roots:           1001127
: Peak memory used:            485385 bytes
: Parse Time:    0 hours  0 minutes  0 seconds (0 seconds)
: Render Time:   0 hours  1 minutes 45 seconds (105 seconds)
: Total Time:    0 hours  1 minutes 45 seconds (105 seconds)
:
: jaap.

Thanks! I also took a minute and set up a scene with
your macro. Goes pretty fast! Looks great!
=Bob=


Post a reply to this message

From: Kurts
Subject: Re: my very first iso-surface (and second macro) :-)
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

From: Jaap
Subject: Re: my very first iso-surface (and second macro) :-)
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

From: Jaap
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 16:00:00
Message: <web.413a1e4ff757768da8399d8d0@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.

i just realized what you want, you may change the 0.25 to 10 to make the
cone from the solid half to the threaded half realy steep.

jaap.


Post a reply to this message

From: Arlo J
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 4 Sep 2004 18:42:12
Message: <413a44c4@news.povray.org>
Jaap wrote:
> my very first iso-surface (and second macro) :-)
> the thread is a single iso-surface, bold heads and nuts are CSG.

Nice! I'd love to see radiosity render of some of these once you get 
some good textures together. :)

Arlo


Post a reply to this message

From: Kurts
Subject: Re: my very first iso-surface (and second macro) :-)
Date: 5 Sep 2004 03:33:18
Message: <kurtzlepirate-115527.09331705092004@news.povray.org>
In article <web.413a1e4ff757768da8399d8d0@news.povray.org>,
 "Jaap" <jws### [at] yahoocom> wrote:

> 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.
> 
> i just realized what you want, you may change the 0.25 to 10 to make the
> cone from the solid half to the threaded half realy steep.
> 
> jaap.
> 
> 
> 

  yes it is !!!

  very, very good job.

  thanks


Post a reply to this message

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