POV-Ray : Newsgroups : povray.advanced-users : Thatch strand assistance, please Server Time
1 Nov 2024 15:27:56 EDT (-0400)
  Thatch strand assistance, please (Message 1 to 1 of 1)  
From: David Wallace
Subject: Thatch strand assistance, please
Date: 17 Mar 2002 05:52:41
Message: <3c947579@news.povray.org>
I am trying to create a strand of thatch with an isosurface-based cylinder
which wraps around a turbulated line (the center is determined using polar
coordinates and two patterns).  This is what I have so far:

#declare fntR1 = function { pattern { crackle solid } }
#declare fntRad = function { .2+.8*fntR1(x,y,z) }
#declare fntP1 = function { pattern { bozo turbulence .2 } }
#declare fntPhi = function { 2*pi*fntP1(x,y,z) }
#declare fntStrand = function(x,y,z) {
(fntRad(x,y,z)*(cos(fntPhi(x,y,z))+y))^2+(fntRad(x,y,z)*(sin(fntPhi(x,y,z))+
z))^2 }

#macro tStrand(rad,len) isosurface {
 #local wid = len*.5;
 #local crad = rad*3;
 function { fntStrand(x,y*rad,z*rad) }
 threshold 1
 max_gradient 6
 contained_by { box { <-wid, -crad, -crad>, <wid, crad, crad> } }
 accuracy 0.001
} #end

I'm starting to wonder what kind of variable substitution I should use (say,
use pattern function substitution in the fntStrand definition).

Can someone please fix this?


Post a reply to this message

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