POV-Ray : Newsgroups : povray.binaries.programming : toroidal pattern : Re: toroidal pattern (superpatch version) Server Time
29 Mar 2024 06:09:27 EDT (-0400)
  Re: toroidal pattern (superpatch version)  
From: Zan Trajkov
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.