POV-Ray : Newsgroups : povray.general : Connecting cylinders with chunks of a torus vs. sphere_sweep point cloud. : Re: Connecting cylinders with chunks of a torus vs. sphere_sweep point clou= Server Time
29 Jul 2024 10:26:41 EDT (-0400)
  Re: Connecting cylinders with chunks of a torus vs. sphere_sweep point clou=  
From: JimT
Date: 19 Oct 2011 10:00:01
Message: <web.4e9ed6b4be29af0be7517870@news.povray.org>
"[GDS|Entropy]" <nomail@nomail> wrote:
> Hello,
>
> I'm looking for a bit of input.
>
> My initial thought regarding the connection of arbitrarily placed cylinders with
> sections of a torus follows, which as you will see presented a number of
> annoying problems which seem to be resolved by my second idea.
>
As noted, connecting two arbitrarily placed cylinders by a torus segment isn't
possible except as a rather special case.

The simplest object that is guaranteed to connect two cylinders is a Bezier
spline which has four control points. p1 and p4 are the cylinder end centres. p2
is such that the vector p2-p1 is along the first cylinder axis. Similarly p4-p3
and the second cylinder axis.

I have a Bezier sweep macro. Joining cylinders of different radii is also
possible

There is some freedom in choosing |p2-p1| and |p4-p3| to make sure kinks and
loops don't appear.

The Bezier spline has the tetrahedron with vertices p1,p2,p3,p4 as its convex
hull, which might help with removing intersections.

However, generating a lot of connected cylinders and ensuring that nothing
intersects would be rather difficult - in general it isn't possible. Think of
six cylinders surrounding a seventh. Join opposite of cylinders (using the
|p2-p1|, |p4-p3| freedom to remove any intersections but keeping the joining
Bezier sweeps as close as possible). There would be no path from the centre
cylinder to any other.

Trying to allow for intersections (with no guarantee of success) by splitting
single Bezier sweeps into multiple sweeps would be possible.

I've never tried to work out whether two Bezier sweeps intersect. Feels like an
interesting problem, but it must have been looked at.

If you want the macro, I can send it.

JimT


Post a reply to this message

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