POV-Ray : Newsgroups : povray.binaries.programming : toroidal pattern Server Time
22 Dec 2024 04:21:25 EST (-0500)
  toroidal pattern (Message 1 to 3 of 3)  
From: PoD
Subject: toroidal pattern
Date: 11 Jul 1999 19:15:44
Message: <378925CE.1AB68CD0@merlin.net.au>
Here's a diff from the official 3.1g to implement toroidal pattern.
It returns the distance of the intersection point from a unit circle
lying on the x,z plane.  Good for smoke rings.

I've noticed that the superpatch already has a toroidal token, so if you
apply it to that, just remove the lines that define that token.

Cheers, PoD.


Post a reply to this message


Attachments:
Download 'us-ascii' (2 KB)

From: PoD
Subject: Re: toroidal pattern (superpatch version)
Date: 12 Jul 1999 18:08:49
Message: <378A67A2.70AA137B@merlin.net.au>
Here's the diff to add toroidal pattern to superpatch.

Cheers, PoD.


Post a reply to this message


Attachments:
Download 'us-ascii' (2 KB)

From: Zan Trajkov
Subject: Re: toroidal pattern (superpatch version)
Date: 13 Jul 1999 03:13:07
Message: <378AE832.2BEFFA34@sicom-ol.de>
Hi,
I have included yesterday your toroidal-pattern in my personal compile of the
superpatch. It works fine...
BTW :
It's my first patched Version of Povray/Superpatch which I compile self!
Just for fun I wrote a superellipsoid-pattern, to become more sense programming and
including patches in POV.
Source code follows later.

Zan

PoD schrieb:

> Here's the diff to add toroidal pattern to superpatch.
>
> Cheers, PoD.
>
>   ------------------------------------------------------------------------
> diff sp/parstxtr.c sp-toroid/parstxtr.c
> 1076a1077,1081
> >      CASE (TOROIDAL_TOKEN)
> >        New->Type = TOROIDAL_PATTERN;
> >        EXIT
> >      END_CASE
> >
> diff sp/pattern.c sp-toroid/pattern.c
> 81a82
> > static DBL toroidal (VECTOR EPoint); /* PoD */
> 1417a1419,1437
> > /* PoD */
> > static DBL toroidal (VECTOR EPoint)
> > {
> >   register DBL value;
> >   register DBL d2;
> >
> >   /*distance from circle = sqrt( y*y + (sqrt(x*x+z*z)-1)*(sqrt(x*x+z*z)-1) )*/
> >   /* thanks to John VanSickle and Peter Popov for the formula */
> >
> >   d2 = sqrt(EPoint[X]*EPoint[X]+EPoint[Z]*EPoint[Z]) - 1.0;
> >   if( fabs(EPoint[Y]) >= 1 || d2 >= 1.0 )
> >       return(DBL)0;
> >   value = sqrt( EPoint[Y]*EPoint[Y] + d2*d2 );
> >   CLIP_DENSITY(value);
> >
> >   return(value);
> > }
> > /* PoD */
> >
> 1572a1593
> >     case TOROIDAL_PATTERN:   value = toroidal      (TPoint);      break; /* PoD */
> diff sp/pattern.h sp-toroid/pattern.h
> 89a90
> >   TOROIDAL_PATTERN,     /* PoD */
> Common subdirectories: sp/unix and sp-toroid/unix
> Common subdirectories: sp/windows and sp-toroid/windows


Post a reply to this message

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