POV-Ray : Newsgroups : povray.binaries.images : quartz (9.02kb png) : Re: quartz (9.02kb png) Server Time
5 Nov 2024 10:22:35 EST (-0500)
  Re: quartz (9.02kb png)  
From: Tim Attwood
Date: 23 Aug 2007 00:02:08
Message: <46cd06c0$1@news.povray.org>
Cool, I saw your hexagon and was messing with
Miller indices, and I found this site
http://www.gly.uga.edu/schroeder/geol6550/millerindices.html
which seems to explain simple Miller indices OK.

Still haven't looked at Miller-Bravais indices.

This is what I ended up with, but it's mostly untested.

#macro ThreePointPlane(P1, P2, P3)
   #local n = vnormalize(vcross(P1-P2,P3-P2));
   #local k = vdot(n,P1);
   plane {n,k}
#end

#macro MillerPlane(l,m,n)
   #if (l!=0) #local lp = <1/l,0,0>; #else #if (m!=0) #local lp = <1,0,1/m>;
      #else #local lp = <1,1/n,0>; #end #end
   #if (m!=0) #local mp = <0,0,1/m>; #else #if (l!=0) #local mp = <1/l,0,1>;
      #else #local mp = <0,1/n,1>; #end #end
   #if (n!=0) #local np = <0,1/n,0>; #else #if (l!=0) #local np = <1/l,1,0>;
      #else #local np = <0,1,1/m>; #end #end
   #local test = ThreePointPlane(lp,mp,np);
   #local isInside = inside(test,<0,0,0>);
   #if (isInside = 0) object {test} #else object {test inverse} #end
#end


Post a reply to this message

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