POV-Ray : Newsgroups : povray.general : HELP - Rotating Railing Posts around Scaled Cylinder Edge : Re: HELP - Rotating Railing Posts around Scaled Cylinder Edge Server Time
27 Apr 2024 11:23:33 EDT (-0400)
  Re: HELP - Rotating Railing Posts around Scaled Cylinder Edge  
From: Sven Littkowski
Date: 30 Mar 2018 19:07:13
Message: <5abec321$1@news.povray.org>
Yes, it is. Big thanks!!!





On 29.03.2018 20:26, Tor Olav Kristensen wrote:
> #declare A = 2; // Semi-major axis
> #declare B = 1; // semi-minor axis
> 
> #declare R = 0.05;
> #declare T = 0.20;
> #declare D = 0.21;
> 
> cylinder {
>     -T*y, +T*y, 1
>     scale <A, 1, B>
>     pigment { color Blue }
> }
> 
> #declare Nil = 1e-9;
> #declare Spline1 =
>     spline {
>         linear_spline
>          0      , <+A, 0,    0>
>         10      , <+A, 0, +2*B>
>         20 - Nil, <-A, 0, +2*B>
>         20      , <-A, 0,   +B>  // or <-A, 0, -B>
>         20 + Nil, <-A, 0, -2*B>
>         30      , <+A, 0, -2*B>
>         40      , <+A, 0,    0>
>     }
> 
> #declare Spline2 =
>     spline {
>         linear_spline
>          0, <+A, 0, +2*B>
>         10, <-A, 0, +2*B>
>         20, <-A, 0,    0>
>         30, <-A, 0, -2*B>
>         40, <+A, 0, -2*B>
>     }
> 
> #declare Step = 1; // Also try 0.5 and 2
> #declare I = 0;
> #while (I < 40)
>     #declare p1 = Spline1(I);
>     #declare p2 = Spline2(I);
>     #declare E = (p1.x + A)*p2.z;
>     #declare F = (p2.x - A)*p1.z;
>     #declare pS = A/(E - F)*<E + F, 0, 2*p1.z*p2.z>;
>     cylinder {
>         -D*y, +D*y, R
>         translate pS
>         pigment { color White }
>     }
>     #declare I = I + Step;
> #end // while

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

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