Mapping a truncated octahedron skin conformally to a cone

78 Views Asked by At

TLDR: I would like a formula that can take a vertical coordinate in an unscaled flat profile and map it onto a vertical slice of the surface of a cone, such that things look uniform across the full surface of the cone.

I'm trying to make gears of a whole bunch of different types that have a truncated octahedron profile that is as uniform as possible for each individual tooth. What I'm stuck on at the moment is mapping them to cones (for bevel gears) and toruses (for ring gears).

This is a hollow truncated octahedron, and a filled version of it tiled along a horizontal plane. I'll call this a skin tiling on a horizontal plane, but presumably there's a better name:

hollow truncated octahedron with filled faces on all but four hexagonal sides solid truncated octahedron, tiled on a horizontal plane

Here is a skin tiling on a cylinder:

solid truncated octahedron, tiled onto the surface of a cylinder

The creation of this surface is somewhat complicated, but I don't think I need to explain that in order to explain my problem [Interested people can inspect the OpenSCAD code here if they want]. In order to convert from the planar structure to the cylindrical structure with radius $r$ and $n$ teeth per cylinder, I map the tiled X coordinate $t_x$ to the cylindrical angle $\theta$, and the tiled Y coordinate $t_y$ maps directly to the Z coordinate of the cylinder model $m_z$:

$\theta = \frac{2\pi}{n} t_x$

$M = [r sin(\theta), r cos(\theta), t_y]$

Here is a [partial] skin tiling onto the surface of a sphere. As the radius of vertical rings of the sphere reduces, the scale of the truncated octahedron also reduces, resulting in a tiled pattern that has a smooth scaling and always has the same number of teeth around the ring (i.e. it's conformal):

solid truncated octahedron, tiled onto the surface of a sphere

I had quite a lot more trouble working this one out, until I found the answer on the Wikipedia page for the mercator projection. What I ended up needing was an inverse mercator transformation to map a vertically-infinite plane onto the surface of a sphere (because the radius of the sphere collapses to zero at the poles):

$\theta = \frac{2\pi}{n} t_x$

$\phi = 2 \times tan^-1(e^\frac{t_y}{r}) - \pi/2$

$M = [r sin(\theta) cos(\phi), r cos(\theta) cos(\phi), t_y sin(\phi)]$

I thought that once I had the sphere equation, everything else I wanted would just fall out... but this doesn't seem to be the case. I don't know if I'm missing something really obvious, or if this is actually a hard problem.

So... what I'm currently trying to wrap my head around is a skin tiling onto a cone:

a cone with a large radius of 11.629 units, a small radius of 5 units, and a height of 10 units

I understand that the equation should involve something that tends to an infinite scale at the smaller radius, so I expect it would have some similarity to the spherical transform, but nothing like that's come out in what I've tried. Here's what is my best attempt so far:

truncated octahedron mapped to a cone; the lower octahedrons are too wide, and the upper octahedrons are too narrow

I got this by attempting to work backwards from relationships between the model Z coordinate $m_z$ and the cone surface distance $g$ (assuming a cone with contact angle $\rho$ (relative to the vertical), integrating the scale distortion at a particular Z height, then finding the roots of the resultant quadratic:

$r_z = r_0 - m_z tan(\rho)$

$r_z = r_0 - g sin(\rho)$

$t_y = \frac{1}{r_0} \int{r_0 - g sin(\rho)}{dg}$

$t_y = \frac{1}{r_0}(r_0 g - \frac{1}{2} g^2 sin(\rho)$)

$g = \frac{r_0 \pm \sqrt{r_0^2 - 2 sin(\rho) t_y r_0}}{sin(\rho)}$

$m_z = g cos(\rho)$

But, as you can hopefully see in the image, this results in a substantially distorted mapping, where the bits at the bottom of the cone are too stretched out, and the bits at the top of the cone are too tall and narrow.

Can anyone help me out in working out where I've gone wrong?

2

There are 2 best solutions below

0
On

After writing this question out, I re-read this bit:

I expect it would have some similarity to the spherical transform

On a hunch, I tried plugging in the same equation:

$\rho = 2 \cdot tan^-1(e^\frac{t_y}{r}) - \frac{\pi}{2}$

$m_z = \frac{2 \cdot\pi \rho}{n}$

The skinned cone is substantially improved, but there's still distortion happening. I set the model to 10 levels of gear teeth to make the distortion really obvious:

skinned cone with 5 gear levels skinned cone with 10 gear levels

I've now found what appears to be a conformal mapping for $\rho = \frac{\pi}{2}$, taking inspiration from the Logarithmic spiral concept mentioned in @jean-marie's answer. I suspect that this will help a lot in leading me to the correct solution:

flat disc with truncated octahedral rings placed inside each other

$m_z = 0$

$r = r_0 \cdot e^\frac{-t_y}{n}$

I suspect what I'll end up with is something that scales between the $\rho = 0$ solution and the $\rho = \frac{\pi}{2}$ solution based on the angle $\rho$.

Update: solved!

I added a thin red cylinder at the reference diameter $r_0$ (in the middle of the gears) to make it a little bit more obvious what's going on:

truncated octahedron tile wrapped onto a cylinder with angle 10º from vertical truncated octahedron tile wrapped onto a cylinder with angle 10º from vertical

What I needed to do was modify the exponent of the logarithmic spiral function so that it transitioned from 0 at a vertical angle of 0 to 1 at a vertical angle of $\frac{\pi}{2}$. The sine function, in other words. I then took the result of that, subtracted it from the reference radius $r_0$, and played around with scaling by other trigonometric functions until I found the right one (i.e. tan):

$r = r_0 \cdot e^{\frac{-t_y}{n} \cdot sin(\rho)}$

$m_z = \frac{r_0 - r}{tan(\rho)}$

5
On

enter image description here

enter image description here

Matlab program for the second figure :

 clear all;close all,hold on;axis equal;
 r=1; % radius of basis
 h=3;axis([-r,r,-r,r,0,h]); $ h=height of apex
 n=20; % number of base points
 v=1; % controls the height
 q=0.2; % controls the spirals' narrowness of the spirals
 s=@(t)(exp(-q*t));
 view([31,20]);
 d=2*pi/n;
 t=0:pi/12:v*pi;L=length(t);
 z=zeros(1,L);
 for k=1:n; % index of base points
    for b=-1:2:1; % b=1/-1 for direct/retrograde spirals resp.
       c=[k/n,0,1-k/n]; % RVB color
       u=b*(t+k*d); % angular shift
       plot3([z,r*s(t).*cos(u)],...
       [z,r*s(t).*sin(u)],...
       [z,(1-s(t))*h],'color',c);
       plot([z,s(t).*cos(u)],...
       [z,s(t).*sin(u)],'color','k');
    end;
 end;

The kind of 3D spirals you get on the sphere are known to be "loxodromic curves" , i.e., curve(s) a ship follows if she keeps a constant bearing (= constant angle with respect to meridian lines). See here.

You could consider in the same way loxodromic curves on the cone... which are the images of logarithmic spirals when you unfold your cone on a flat surface, an operation preserving angles Indeed, keeping a constant bearing amounts, on the flattened version, to have a curve making a constant angle with the radius, which is a definition of the logarithmic spiral with polar equation :

$$r=ae^{-b \theta}\tag{1}$$

This can be done by using function $s$ defined by $s(t)=\exp(-a*t)$ and its complement $1-s(t)$ as resp. weights for $A$ (the apex of the cone) and $C_k, \ k=1,\cdots n$, points on the basis circle. In a didactic purpose, space spirals are projected onto the horizontal plane, placing in evidence the two families of spirals (direct and retrograde).

Remark : loxodromic curves are not geodesic curves as described for example here.