POV-Ray : Newsgroups : povray.binaries.images : Isosurface cylindrical ramp?, cam lift hinge : Re: Isosurface cylindrical ramp?, cam lift hinge Server Time
9 Aug 2024 09:07:52 EDT (-0400)
  Re: Isosurface cylindrical ramp?, cam lift hinge  
From: Mike Williams
Date: 6 Mar 2005 23:47:49
Message: <yqeP1CAtz9KCFwWq@econym.demon.co.uk>
Wasn't it Mike Williams who wrote:
>Wasn't it StephenS who wrote:
>>I would like to add the cam part to my hinge. A ramp that wraps around the
>>pin. I'm thinking that a cylinder isosurface whose height changes with the
>>angle should work. Looking up the parts on f_ph and f_th don't seem to help
>>me understand them any better. I can get a cylinder but the change in height
>>is giving me a head ache. Some help would be appreciated :-)
>>
>>Stephen
>>
>

Here's a version that doesn't have the problem of infinite gradients.
I've split the isosurface into two parts each of which POV considers to
have finite gradients. The actual gradients that it thinks it finds are
still a bit weird because the edges are still pathological, so you'll
get warnings suggesting max_gradient values that vary considerably.

#version 3.6;
global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 50}
background {rgb 1}
light_source {<-50, 100, -30> color rgb 1}

#include "functions.inc"

camera {location <-5,10,-10> look_at 0 angle 10}

#declare H=0.5;

#local fn_A=function{sqrt(x*x+ z*z) - .5};

union {
  isosurface {
    function {
      max (
        fn_A(x,y,z),
        y-abs(f_th(x,y,z)*H/pi)
      )
    }
    contained_by {box{< 0, -1, -1>,<  1,   1,  1>}}
    max_gradient 2
  }

  isosurface {
    function {
      max (
        fn_A(x,y,z),
        y+abs(f_th(x,y,z)*H/pi)
      )
    }
    contained_by {box{< -1, -1, -1>,<  0,   1,  1>}}
    max_gradient 2
  }

  cylinder {-y,y,0.35}

  pigment{rgb .8}
  
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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