POV-Ray : Newsgroups : povray.general : How do you create a weave? : Re: How do you create a weave? Server Time
13 Aug 2024 05:44:10 EDT (-0400)
  Re: How do you create a weave?  
From: Julius Klatte
Date: 27 Oct 1998 19:29:05
Message: <36366551.0@news.povray.org>
That shouldn't be too hard...I guess :)
Use spheres in a #while loop to simulate a spiral-sort of
shape, or sine-wave...
The problem is, that this will clutter your file with
thousands (depending on the amount of precision you'd like)
of objects. Might parse a while if you plan to make a fine
weave :-)

Here's an example:

#declare S=sphere { 0, 0.4 pigment { color rgb
<0.8,0.5,0.5> } }

#declare T=0
#while (T<100)
    #object { S translate <T/10, sin (pi*(T/12.5)),0> }
    #declare T=T+1
#end

This will create a string of 100 spheres in the form of a
sine wave, 10 units long (x), 1 unit amplitudo, so 2 units
high (y) with 4 sine waves (y function from 0 to 8*pi). Of
course, this is not a cylinder (as you ask for) but the
result should be better than lining up cylinders crosswise.

Hope this helps.

Julius

PS: You'll be able to find a thorough description of several
things like this and other stuff as well on my pov-pages
<http://members.tripod.com/~klatte/index.html>

*
"Always remember you're unique, just like everyone else."
http://surf.to/jkhome
jku### [at] hotmailcom
*

>Does anyone know how to create a "weave" using cylinders or
some other
>objects?  I am trying to create a woven object (like a
cane-back chair or
>window-screen.)  I have seen isosurface patches but they
are only good for a
>previous release of Pov-Ray.  Is there a simple way to
create a single woven
>cylinder (one that goes up and down like a sine wave) and
then I could
>simply combine those into a larger object by rotating and
translating.
>
>A side view of the cylinder might look like this:
>
>/\/\/\/\/\/\/\/\/\/\/\/\/\/\
>
>only not quite as high, but more "squished."


Post a reply to this message

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