How to do screw threads?

How to do screw threads?

Post by Michael Buria » Sat, 04 Jan 2003 03:37:42



I've already done the main parts of a small vice with POVRay 3.5 and
the easy stuff (mainly boxes, cylinders) work great, but when it comes
to threads I'm stuck.

How can I do the thread of a drive shaft (which is a metric M8 thread),
as well as the threads of 4 socket-head cap screws (M6)?

I've played around with helix functions and isosurfaces and managed to
get some spiral like formed objects, but then when I wanted to do CSG
with it something went wrong.

I tried to subtract the green thread from the blue cylinder,
and although the thread itself is hollow in the center, the cylinder
was cut through entirely. Why?

Is there a better way to do threads?

#include "colors.inc"
#include "functions.inc"

camera { location <0, 5, -15>  direction <0, 0,  4.2> look_at <0,0,0>}

light_source {<0,3, -10> color rgb<1,1,1>}
light_source {<0,33, -10> color rgb<1,1,1>}

plane{
      y, -10
      texture{ pigment {checker  color Gray15 color Gray65}}
      scale 3
      rotate y*45
     }                          

#declare R0=0.9;
#declare R1=0.4;

difference{
  //shaft
  cylinder {  -3*y,  3*y, 0.7 pigment { color rgb<0,0,1>} hollow off }

  //thread
  isosurface
  {
    function {f_helix1(x,y,z,1,5,R1,R0,1,2,0) }
    pigment {color rgb<0,1,0>}
  }
  translate <-1.5,0,0>

Quote:}

//same thread, painted green to see how it looks like
isosurface
{
  function {f_helix1(x,y,z,1,5,R1,R0,1,2,0) } pigment {color rgb<0,1,0>}
  translate <1.5,0,0>
Quote:}

 
 
 

How to do screw threads?

Post by Mike William » Sat, 04 Jan 2003 09:38:38



Quote:>I've already done the main parts of a small vice with POVRay 3.5 and
>the easy stuff (mainly boxes, cylinders) work great, but when it comes
>to threads I'm stuck.

>How can I do the thread of a drive shaft (which is a metric M8 thread),
>as well as the threads of 4 socket-head cap screws (M6)?

>I've played around with helix functions and isosurfaces and managed to
>get some spiral like formed objects, but then when I wanted to do CSG
>with it something went wrong.

>I tried to subtract the green thread from the blue cylinder,
>and although the thread itself is hollow in the center, the cylinder
>was cut through entirely. Why?

You failed to set an appropriate value for "max_trace". In this case
"max_trace 3" will suffice.

While you're at it, "max_gradient 1.6" gets rid of the black artefacts
on the surface.

--
Mike Williams
Gentleman of Leisure

 
 
 

How to do screw threads?

Post by Michael Buria » Sat, 04 Jan 2003 21:25:12



>>I tried to subtract the green thread from the blue cylinder,
>>and although the thread itself is hollow in the center, the cylinder
>>was cut through entirely. Why?

> You failed to set an appropriate value for "max_trace". In this case
> "max_trace 3" will suffice.

> While you're at it, "max_gradient 1.6" gets rid of the black artefacts
> on the surface.

that did the trick, Thanks!