POV-Ray : Newsgroups : povray.advanced-users : Looking for a macro to transform a set of coplanar points Server Time
29 Jun 2024 02:15:07 EDT (-0400)
  Looking for a macro to transform a set of coplanar points (Message 1 to 3 of 3)  
From: tensor
Subject: Looking for a macro to transform a set of coplanar points
Date: 20 Apr 2010 17:05:01
Message: <web.4bce167d6ace3491c5768ac0@news.povray.org>
Hi,
I want to build a prism from an extruded polygon. I have a set of points in 3D
that represent the polygon boundary, they should all lie on the same plane. I
would guess this problem is encountered frequently. Is there a pre-existing a
macro that would find the average normal (to remove numerical noise) and
generate the transform matrix.

So, given a set of 3D points generate the polygon on the floor, extrude it, and
transform so it sits in space correctly.

I know how to do the math, just hoping someone has something pre-tested.

Thanks


Post a reply to this message

From: tensor
Subject: Re: Looking for a macro to transform a set of coplanar points
Date: 20 Apr 2010 19:10:01
Message: <web.4bce3426230787f2c5768ac0@news.povray.org>
"tensor" <nomail@nomail> wrote:
> Hi,
> I want to build a prism from an extruded polygon. I have a set of points in 3D
> that represent the polygon boundary, they should all lie on the same plane. I
> would guess this problem is encountered frequently. Is there a pre-existing a
> macro that would find the average normal (to remove numerical noise) and
> generate the transform matrix.
>
> So, given a set of 3D points generate the polygon on the floor, extrude it, and
> transform so it sits in space correctly.
>
> I know how to do the math, just hoping someone has something pre-tested.
>
> Thanks

Cancel this request. Thanks anyway. I'll write the macro myself, was hoping for
something quick.
Thanks


Post a reply to this message

From: Alain
Subject: Re: Looking for a macro to transform a set of coplanar points
Date: 11 Jun 2010 12:20:36
Message: <4c126254$1@news.povray.org>

> Hi,
> I want to build a prism from an extruded polygon. I have a set of points in 3D
> that represent the polygon boundary, they should all lie on the same plane. I
> would guess this problem is encountered frequently. Is there a pre-existing a
> macro that would find the average normal (to remove numerical noise) and
> generate the transform matrix.
>
> So, given a set of 3D points generate the polygon on the floor, extrude it, and
> transform so it sits in space correctly.
>
> I know how to do the math, just hoping someone has something pre-tested.
>
> Thanks
>
>
If all your points lies more or less on a reference plane, like the x-z 
plane, you can just remove the Y component:
#declare Point2D=<Point3D.x, point3D.z>

Alain


Post a reply to this message

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