POV-Ray : Newsgroups : povray.general : plane through 4 points : Re: plane through 4 points Server Time
25 Apr 2024 20:14:41 EDT (-0400)
  Re: plane through 4 points  
From: Bald Eagle
Date: 31 May 2019 13:55:07
Message: <web.5cf1698157960f354eec112d0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> Any 4 3D points ?

I guess that would be the obvious assumption - to code for the general case.

> Let's imagine they are disposed as the vertices of tetrahedron
> (regular), what would be the right (curved) sheet ?
> (I'm questionning the "bend where required" part, which seems obvious
> but is really not that obvious at all )

Right - they'd have to be specified.  I read this to mean that there would be a
simple single bend in the sheet, rather than a saddle or other complex shape.
So then I suppose if two triangles shared a face and they were non-planar, then
the sheet would pass through the unshared vertex of the first triangle, then
through the shared edge / vertices, and then "bend where required to make it
pass through the final unshared vertex.

> Can we assume that somehow the 4 points are ordered ?

We could, but it would probably be easier to just code it, and have the user
order them according to how they fit into the code.

> Does the sheet have to be infinite ? (that's what a plane is)
> or limited to the 4 points ?
>
> If you have 4 points, can you interpolate some additional ones to use a
> bicubic patch ?
> http://wiki.povray.org/content/Reference:Bicubic_Patch


And THAT sounds like a simple proposition, however remember that the points
specified for making a Bezier patch are only control points - the patch doesn't
pass through them.  And that's what took me far, far, far longer to work out -
and I only managed to do so with much help from TOK and clipka.

I have most of what I think should do the trick worked out, I just need to
"capture" the angles used by Reorient_Trans () or another function / macro so
that I can then undo the rotations later.

Here's what I'm doing so far:
3 points are used to calculate the centroid of that triangle (I have no error /
colinear / sanity checking)
The 4th is the point that will get curved through.
The 4th point is projected onto the plane that the triangle is in.
The vectors from that projected point extended back through both the centroid
and 4th point are used to define 2 control points for a cubic spline.

Since I have no idea where the points are in space, I
1. translate everything as a group so one control point is at the origin.
2. rotate everything so that the other control point is on the x-axis.
3  rotate the points on the rest of the "curve" so they are in the x-z plane.

Then I can declare a proper prism, using the x,z coordinates of the original 3
points (2 of which should now be coincident) and the 4th point.

(I hope I'm visualizing this correctly so far)
The prism should pass through all the non-control points, which are the original
4 points.

Then I just undo the rotations and translation of the prism, and that should be
what the OP wanted...


Post a reply to this message

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