POV-Ray : Newsgroups : povray.unofficial.patches : Something fresh - symetry operator patch : Re: Something fresh - symetry operator patch Server Time
20 Jul 2024 21:25:33 EDT (-0400)
  Re: Something fresh - symetry operator patch  
From: Ron Parker
Date: 10 May 2001 13:07:12
Message: <slrn9flim2.khs.ron.parker@fwi.com>
On Thu, 10 May 2001 18:52:57 +0200, Wlodzimierz ABX Skiba wrote:
>I've created simple addition to expressions - vector symmetry operator "@".
>
>Syntax
>  Vector @ SymmetryRefference
>  SymmetryRefference : Vector | ox | oy | oz | xy | xz | yz
>
>Instead of explanation just examples of usage and old equivalents

Why a patch and not a macro?  

#macro VecSym(Vec, Sym)
  (vlength(Sym)?(2*vdot(Vec,Sym)/vlength(Sym)*Sym-Vec):(-Vec))
#end

Then you give it x instead of ox, y instead of oy, etc. and 
x+y instead of xy etc. 

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbf 1}hollow interior{media{emission 3-T}}}#end 
Z(-x-x.2x)camera{location z*-10rotate x*90normal{bumps.02scale.05}}


Post a reply to this message

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