|
|
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 something that might get you started. I had to swap the axes to
y-upwards because my POV intuition doesn't work in z-upwards mode.
A big problem is that the gradient becomes infinite at the vertical
edge, which means that it takes a nearly infinite amount of time to
render with eval, and doesn't render correctly with any finite value of
max_gradient.
I tried rendering it with a low max_gradient and masking the dodgy edge
with a thin box. That helped, but there are still some bad bits that are
still visible unless I make the box so large that it becomes noticeable.
#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 {<-30, 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};
isosurface {
function {
max (
fn_A(x,y,z),
y-f_th(x,y,z)*H/pi
)
}
contained_by {box{
< -1, -1, -1>,
< 1, 1, 1>}}
max_gradient 20
pigment{rgb .8}
}
// Try to hide the bits that have infinite gradient
box {<-0.0, -H, 0><0.002, H, -0.5>
pigment {rgb .8}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|