POV-Ray : Newsgroups : povray.advanced-users : IHow do i squirl an Object? : Re: IHow do i squirl an Object? Server Time
28 Jul 2024 18:24:10 EDT (-0400)
  Re: IHow do i squirl an Object?  
From: David Wallace
Date: 3 Aug 2004 01:20:05
Message: <410f2085@news.povray.org>
<nomail@nomail> wrote in message
news:web.4103e6bad7961a28c014e2840@news.povray.org...
> Difficult to explain without images ;-)
>
> Please have a look at
> http://rustedtech.homelinux.net/fileadmin/Files/Twisting.png (only 3.9kB).
> This is an ontop view of my needs.
>
> What i am searching for is a function to bend from the inner circle to the
> outer circle, not along an axis (what makes "bend.inc" inkompatible for my
> needs).
>
> Has anyone got an idea how i can do this, or, even better, a macro?
>
> Greets, qeldroma
>
>

What I think you are looking for can be done with a parametric surface:

// Parametric variable form

#declare uMin = 0; // Minimum u value
#declare uMax = pi; // Maximum u value
#declare uNum = 73; // Number of points in u direction
#declare uWrap = 0; // u wraps around if != 0
#declare uSeed = 9135; // Random number seed for u parameter

#declare vMin = 0; // Minimum v value
#declare vMax = radians(355); // Maximum v value
#declare vNum = 72; // Number of points in v direction
#declare vWrap = 1; // v wraps around if != 0
#declare vSeed = 2252; // Random number seed for v parameter

#declare IsRnd = false; // True if random number used
#declare IsUV = true; // True if uv-mapping used
#declare Smooth = 0; // Smooth flag

#declare Detail = "Partial"
/* Detail values
  Verbose = Line by line details
  Partial = Operations only
  Other = Filename only
*/

/* For all macro functions
 i = Current value of u parameter
 j = Current value of v parameter
 p = Current value of u variance (0...1)
 q = Current value of v variance (0...1)
*/

// Optional functions

// point function
#macro pnt(i, j, p, q)
    #local ptBase = <sin(i)*cos(j),cos(i),sin(i)*sin(j)*10>;
    #local ptRad = vlength(ptBase);
    #local ptAng = 90/ptRad;
    vrotate(ptBase,y*ptAng)
#end

This should come close to making one of your two twisted bars.


Post a reply to this message

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