POV-Ray : Newsgroups : povray.binaries.utilities : Wood program but still develop : Re: Wood program but still develop Server Time
6 Jul 2022 11:58:01 EDT (-0400)
  Re: Wood program but still develop  
From: And
Date: 27 May 2022 11:45:00
Message: <web.6290f1cc5b6ed24a93c4999aa81652d@news.povray.org>
"And" <49341109@ntnu.edu.tw> wrote:
> Different approach...maybe. Totally the concept, it is about... I draw the
> standard concentric circles(internal wood pattern) there, but I change the input
> coordinate (x, y, z) to (x/factor(..), y/factor(..), z), than it distortion the
> original space on x-y plane direction.
>
> The knot is the same. I distortion the pattern shape in a narrow range, (vs r
> theta and z)





#declare knot_theta_pos = 0.24*pi;
#declare knot_range = 0.41*pi; // 0.28*pi
#declare knot_h_pos = 1.36;

// simple temp r, not a formal one
#declare f_r_vs_t =
function(var_t, h) {
0.03* var_t
}




// r_of_it means the distant of p to the knot(stem) center line.
// but only approximate.
#declare f_knot_about =
function(var_t, r_of_it) {
select(
    r_of_it - knot_range/2,
    (f_r_vs_t(var_t, 0) +0.001*(cos(r_of_it*2*pi/knot_range) +
1)/2/pow(abs(r_of_it), 1.5)  )/f_r_vs_t(var_t, 0),
    1
)
}

#declare f_knot =
function(x, y, z) {
f_knot_about(time_mockup_function(x, y, z), sqrt(pow(f_theta(x,y) -
knot_theta_pos, 2) + pow((z - knot_h_pos)/f_r(x, y, z), 2)) )
}

// -----------------------------------------
#declare time_mockup_with_knot_function =
function (x, y ,z){
time_mockup_function(
x/f_knot(x, y, z),
y/f_knot(x, y, z),
z
)
}


Post a reply to this message

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