POV-Ray : Newsgroups : povray.binaries.images : Basket-weaving (fun with spline objects) : Re: Basket-weaving (fun with spline objects) Server Time
20 Aug 2024 02:20:08 EDT (-0400)
  Re: Basket-weaving (fun with spline objects)  
From: Chris Colefax
Date: 15 Jan 2001 19:18:52
Message: <3a63936c@news.povray.org>
John M. Dlugosz <joh### [at] dlugoszcom> wrote:
> I think the green "imperfections" are just fine, mimicing the seam on real
> weaving.  The red marks just look funny.
>
> adding semi-random variations... how can we manage that with your macro?
> Iterate the basic shape and peterb a tad?  Use blobs so everything flows
> together nicely instead of torii which have to match the spec?

The Spline Macro File offers the framework in which to create your own,
completely custom spline-based object creation routines, without having to
worry about looping through and evaluating the spline itself (if you don't
want to).  This can include perturbing the shape of the spline and using
blobs, or using the torus_arc () sub macro with semi-random parameters.  Or,
you could algorithmically define a spline that followed the exact shape of
the weaving, e.g.:


   #declare SplinePoints = array[NumberOfStruts*2]

   #declare C = 0; #while (C < NumberOfStruts)
      #declare SplinePoints[C] = [alternating sides of adjacent struts];
   #declare C = C + 1;
      #declare SplinePoints[C] = [direction of weave];
   #declare C = C + 1; #end

   #declare WeaveSpline = create_spline (SplinePoints,
create_hermite_spline)

Using the hermite spline option means we can set a list of points and spline
directions/tangents.  In the loop that defines the points and tangents you
can add variations to either as you like.


Post a reply to this message

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