|
![](/i/fill.gif) |
I've been trying to create a macro that would seamlessly connect two
toruses, just like John VanSickle's Connect macro does for spheres. I can't
seem to get it right, however, so I'd be very grateful if someone with more
math skills than me could help me.
Here's something to work with:
#macro TorusConnect(SP,SMaR,SMiR,EP,EMaR,EMiR)
#local D=vlength(EP-SP);
#local Rd=(SMaR+SMiR)-(EMaR+EMiR);
#local D2=sqrt(D*D-Rd*Rd);
cone { SP+(EP-SP)/D*(SMiR-EMiR)*(SMaR+SMiR)/D, (SMaR+SMiR)*D2/D,
EP+(EP-SP)/D*(SMiR-EMiR)*(SMaR+SMiR)/D, (EMaR+EMiR)*D2/D }
#end
This, obviously, doesn't work but it does come quite close; it just leaves a
tiny edge at the connection point.
Post a reply to this message
|
![](/i/fill.gif) |