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:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.6290f1cc5b6ed24a93c4999aa81652d%40news.povray.org",
"headline": "Re: Wood program but still develop",
"dateCreated": "2022-05-27T15:45:00+00:00",
"datePublished": "2022-05-27T15:45:00+00:00",
"author": {
"@type": "Person",
"name": "And"
}
}
"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.
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) {