POV-Ray : Newsgroups : povray.binaries.images : For Hugo. Irregular mesh smoothing idea. : Re: Yeaah! I got it to work!! Server Time
16 Aug 2024 14:24:41 EDT (-0400)
  Re: Yeaah! I got it to work!!  
From:
Date: 6 Mar 2002 10:17:35
Message: <0gcc8u8ql04s7f08tg2n55096mji8jhfa7@4ax.com>
On Wed, 6 Mar 2002 09:11:10 -0600, "Shay" <sah### [at] simcopartscom> wrote:
> For a mesh with different angles at the corners of a "square," an angle must
> be found for each triangle. There are two ways I can think of to do this.
> Both are slow, but one should shurely be faster than the other.

universal formula for area of triangle:

S=sqrt(p*(p-a)*(p-b)*(p-c))

where a,b,c are lengths of edges and p is half of perimeter = (a+b+c)/2

as you see you don't need angle at all

ABX
--
disc{z,-z 5#macro O()asc(substr("-+((1*(,1,/.-,*/(,&.323/'1"e,1))*.1-4#declare
e=e-1;#end#local e=26;pigment{#local g=function(_){ceil(_)-_}function#local//X
k=function{pattern{object{sphere_sweep{linear_spline 13#while(e>0)<O(),O()//AB
>.01#end}}}}{k(g(atan2(x,y)),g(ln((y+x)^2+1e-5)),0)}}finish{ambient 1}}//POV35


Post a reply to this message

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