POV-Ray : Newsgroups : povray.newusers : Mesh and polygons area : Re: Mesh and polygons area Server Time
28 Jul 2024 18:15:24 EDT (-0400)
  Re: Mesh and polygons area  
From: Le Forgeron
Date: 3 Nov 2007 02:04:18
Message: <472c1d72$1@news.povray.org>
Le 03.11.2007 03:58, alphaQuad nous fit lire :
> "Penelope20k" <pen### [at] caramailfr> wrote:
>> Assuming that with a polygone you must know each points coordinates
>> then the area of triangle is
>>
>> Area = abs(   (xB*yA - xA*yB)  + (xC*yB -x B*yC)+( xA*yC - xC*yA ) ) /2
>>
>>

>>> Mesh are 3D by nature, you're stuck to the triangle per triangle
>>> solution, IMHO.
> 
> 
> what is that "triangle per triangle" method. Not that I can imagine a need for
> the area of a polyhedron.
> 

A mesh is just a collection of triangles, and you cannot assert any
properties for the mesh.
(they are not in the same plane, share no common edges... )
Therefore, you have to parse the whole mesh, one triangle at a time,
triangle after triangle!

> 
> 
> As for Penelope's 2D function, I get frustrated because triangles can be defined
> in 3D space and 2D is almost useless. Hence I tried to simply mentally
> extrapolate to 3D and failed.

That formula works (???) only in the plane of the triangle. A
triangle is always 2D.
back to the origin of that formula:
For an ABC triangle, the area is half the length of the cross
product of any two vectors of the triangle from the same origin.

area = | AB x AC | /2 = | BA x BC | /2 = | CA x CB | / 2
with | x | being length of vector x (not abs()!!!), and every AB a
vector.

Therefore the previous formula of penelope2k seems a bit wrong about
the computation...
because the distance we are interested in is only the euclidian
(slow) one!
(square root of the sum of the squared delta)
-- 
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.