POV-Ray : Newsgroups : povray.beta-test : vector operators in macros : vector operators in macros Server Time
29 Jul 2024 08:21:07 EDT (-0400)
  vector operators in macros  
From: David Wallace
Date: 1 Jul 2002 16:11:31
Message: <3d20b773@news.povray.org>
Duron 800MHz, 512 MB DDR, WinPOV RC6

POV seems to reject the use of the vector dot operator in macros:

#macro fnChamfer(s,c)
    max(abs(x)-(s).x, abs(y)-(s).y, abs(z)-(s).z,
abs(x)+abs(y)-(s).x-(s).y+c, abs(x)+abs(z)-(s).x-(s).z+c,
abs(y)+abs(z)-(s).y-(s).z+c)
#end

If my knowledge of macros is correct, then when I give POV the following
lines:

#declare lbSiz = <1.75, .75, .5>;
#declare lbCut = .15;

#declare lBrick = isosurface {
 function { fnChamfer(lbSiz*.5,lbCut) }
 max_gradient 10
 accuracy 0.005
 contained_by { box { -lbSiz*.5, lbSiz*.5 } }
}

I should get a valid object.  If the "s" variable proved not to be a valid
vector, the error would come upon parsing the substituted function{}
statement.  Instead POV rejects the abs(y)-(s).y at the macro definition,
indicating type checking at that point.  What is happening here?


Post a reply to this message

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