POV-Ray : Newsgroups : povray.advanced-users : Having trouble with cone shape macro Server Time
31 Oct 2024 18:58:11 EDT (-0400)
  Having trouble with cone shape macro (Message 1 to 2 of 2)  
From: Owen
Subject: Having trouble with cone shape macro
Date: 5 Jan 2014 09:20:00
Message: <web.52c968f0e2da923d141938070@news.povray.org>
I'm trying to create a macro that joins two pre-defined tori together using a
cone, where the cone joins the tori at the appropriate tangents to create a
smooth finish, much like the existing "Connect_Spheres" macro.


having trouble getting it to work. The cone that fits within the tori and fills

is giving me trouble.

I've tried adapting the existing "Round_Cone" macro (which is not suitable for
what I want to achieve), but cannot get the results I need.

So far, the basic code I have is this:

#include "math.inc"

#macro Connect_Tori (BasePoint, BaseRadius, CapPoint, CapRadius, EdgeRadius)

  #local Axis = vnormalize (CapPoint - BasePoint);

  cone {
    BasePoint-(Axis*EdgeRadius), BaseRadius,
    CapPoint+(Axis*EdgeRadius), CapRadius
  }

#end

I've tried adapting code from the other two macros mentioned above but, like I
said, I just can't get it to do what I want.

The BasePoint and CapPoint vectors should be the same location as the predefined
tori, and the BaseRadius and CapRadius measurements should also be the same as
the predefined tori.

Any help in solving this would be very much appreciated.

Owen


Post a reply to this message

From: Bald Eagle
Subject: Re: Having trouble with cone shape macro
Date: 3 Aug 2014 17:15:01
Message: <web.53dea544c55553b55e7df57c0@news.povray.org>
"Owen" <nomail@nomail> wrote:
> I'm trying to create a macro that joins two pre-defined tori together using a
> cone, where the cone joins the tori at the appropriate tangents to create a
> smooth finish,

If you just want to connect the tangents, you could look at the
belt/chain/pulley problem and use the minor radii of the two tori to solve for
the linear portion of the belt.  That would give you the _exact_ "2" tangent
points of the tori and the cone.

I posted ALL the math in the binary images section not too long ago.

Hope that helps.


Post a reply to this message

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