POV-Ray : Newsgroups : povray.general : Calculating a plane through a bunch of points : Re: Calculating a plane through a bunch of points Server Time
20 Sep 2024 19:05:56 EDT (-0400)
  Re: Calculating a plane through a bunch of points  
From: Nekar Xenos
Date: 11 Oct 2014 16:51:30
Message: <op.xnk2vvleufxv4h@xena.home>
On Sat, 11 Oct 2014 18:18:40 +0200, Ger <No.### [at] thankyou> wrote:

>
> I have a set of points, 2 rows side by side of 5 points each. The x and  
> z values are set in a grid pattern, the y-values vary. I would like to  
> calculate a plane that averages all
> points in such a way that some points will be above the plane and some  
> will be below it. The plane itself needs to tilt on the x and z axis in  
> such a way that it gets as close as
> possible to all points. So it's not going to be a simple plane{ y, 0  
> translate y * shiftvalue}
>
> How would I go about doing this?

I would think you would have to script something that makes all possible  
triangles from those points. Then calculate each triangle's normal and  
calculate the average normal of all these triangles.
Now you can create a plane and rotate it perpendicular to the average  
normal and then translate it by the average of the coordinates of the  
original points.

-- 
-Nekar Xenos-


Post a reply to this message

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