POV-Ray : Newsgroups : povray.binaries.images : B-DNA : Re: B-DNA - testing the macro Server Time
20 May 2024 00:21:14 EDT (-0400)
  Re: B-DNA - testing the macro  
From: Bald Eagle
Date: 9 Feb 2024 08:25:00
Message: <web.65c6278b139a83601f9dae3025979125@news.povray.org>
The other thing that might not be immediately obvious, but will help in the
overall understanding of the macro's general use is that you only need to
identify 3 points in/on an object in order to line it up with another
instantiation of itself.

Anything.  Triangles, cubes, meshes, parametrics, splines, point clouds, or even
entire included scenes.

Let's say you're modeling something in pieces, and you have a spot on a CSG
object where you need to place the next piece.  It needs to fit in some specific
alignment, but it's always easier to model things near the origin, lying flat on
a plane, etc.

What you can do is take the points on the csg object that you modeled, and
concatenate all of the transforms that you used to put the object containing
that point where it currently is.  Apply that transform to an <x, y, z> vector
using vtransform, and you have the exact coordinates of those points.

Now you can take one of those points and place it on the origin, and either with
math or macros arrange the other two points to lie flat on the plane.  Get those
3 coordinates.

Knowing that the triangle on the plane will now fit perfectly into/onto your csg
object, you can model your piece, and then use Reorient_Triangle to just move it
where it needs to go.

Likely we could use a macro that will just grab that csg triangle and move it to
the plane at the origin and return the 3 coordinates as a tuple.

- BW


Post a reply to this message


Attachments:
Download 'pointcloudregistration.png' (48 KB)

Preview of image 'pointcloudregistration.png'
pointcloudregistration.png


 

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