POV-Ray : Newsgroups : povray.unofficial.patches : Something fresh - symetry operator patch : Re: Something fresh - symetry operator patch Server Time
21 Jul 2024 03:26:07 EDT (-0400)
  Re: Something fresh - symetry operator patch  
From: Ron Parker
Date: 11 May 2001 09:19:38
Message: <slrn9fnpnf.m41.ron.parker@fwi.com>
On Fri, 11 May 2001 14:59:37 +0200, Wlodzimierz ABX Skiba wrote:
>Ron Parker wrote in message ...
>> On Fri, 11 May 2001 09:04:59 +0200, Wlodzimierz ABX Skiba wrote:
>> > x and x+y has meaning of vectors in POV (center of symetry)
>> > ox is not <1,0,0> but axis x
>>
>> But there's no difference.
>
>for geometry symmetry it is difference
>I wanted translate symmetry from math to syntax
>A=<3,2,3> symetry by x (<1,0,0>) -> A'=<-2,-2,-3>
>A=<4,2,3> symetry by axis ox -> A'=<4,-2,-3>

Ah, well the macro I gave mirrors the first vector about the axis defined 
by the second vector (unless the second vector is zero.)  To mirror around
a point, you'd need to do

#macro PtSym( Vec, Pt )
  (2*Pt-Vec)
#end

>> And that macro would happily do this part as well.
>
>and it is as easy to understand and code ?

Once someone else has written the macro, probably easier to understand, and
only a few more keystrokes to code.  Making it have the syntax of an operator
is fun, but it quickly leads to code that looks like line noise.  I can see
more use for having shorter versions of vnormalize, vcross, and vdot than I 
can for vector symmetry, but that's not likely to happen either (though maybe
one could make an argument for |V| to mean vnormalize...)

-- 
#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.