POV-Ray : Newsgroups : povray.newusers : Mesh and polygons area : Re: Mesh and polygons area Server Time
29 Jul 2024 00:23:39 EDT (-0400)
  Re: Mesh and polygons area  
From: Le Forgeron
Date: 3 Nov 2007 05:27:20
Message: <472c4d08$1@news.povray.org>
Le 03.11.2007 10:23, Francesco nous fit lire :
> "Francesco" <nas### [at] gmailcom> wrote:
>> Calculating area triangle per triangle I can always suppose z=0 (translating
>> and rotating axis) as triangles are 2D. So I think the formula posted by >
>> Penelope20k is good.
>>
> 
> If I rotate axis the coordinates are different, so I am really confused : ))

Illumination is on its way... continue.

> 
> May be I could also use Eron's formula, Area= sqrt (s(s-a)(s-b)(s-c)).
> 
It's Heron... and why do you want to compute the length of the side,
when all you need from the 3 vertices are their coordinaates.
Heron's formula is fine when you only have the lengths.

Actually, from a mesh's triangle:

On one hand, two vectors differences, a cross product, three
squaring, a sum and a square root ending with a division.

On the other end, three vectors differences, nine squaring, three
sums, three square root, an intermediate variable (yet a sum and a
division), then three differences, a product of four element, and a
square root.

Of course, you can use Area = 1/4*sqrt( (a+b+c)(a+b-c)(b+c-a)(c+b-a) )
this will avoid the intermediate variable, but the costy part is
computing the length a, b and c anyway!

-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

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