POV-Ray : Newsgroups : povray.object-collection : 3D Loop : Re: 3D Loop Server Time
23 Apr 2024 15:51:50 EDT (-0400)
  Re: 3D Loop  
From: LanuHum
Date: 15 May 2015 12:40:00
Message: <web.55561fe6d258875a7a3e03fe0@news.povray.org>
Lars Rohwedder <rok### [at] gmxde> wrote:
> Inspired by this object:
>
>
http://www.shutterstock.com/pic-94505617/stock-photo--d-infinity-shape-d-render-illustration.html
>

>
> I would like to change the whole object into a single "sphere_sweep" and
> I'd like to have a closed formula that calculates the positions of all
> spheres at once, with "smooth" transitions between the 3 3/4 torii, so
> no cylindrical parts between them.
>

>
> Any ideas, suggestions?

Python in the Blender creates it so:

def Torus_Knot(self):
    p = self.torus_p
    q = self.torus_q
    w = self.torus_w
    res = self.torus_res
    h = self.torus_h
    u = self.torus_u
    v = self.torus_v
    rounds = self.torus_rounds

    newPoints = []
    angle = 2*rounds
    step = angle/(res-1)
    scale = h
    height = w

    for i in range(res-1):
        t = ( i*step*pi)

        x = (2 * scale + cos((q*t)/p*v)) * cos(t * u)
        y = (2 * scale + cos((q*t)/p*v)) * sin(t * u)
        z = sin(q*t/p) * height

        newPoints.extend([x,y,z,1])

    return newPoints

From the received verts cubic_spline is created


Post a reply to this message

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