Paul Bourke’s website is a great place to learn and discover the hidden gems of geometry. lately I’ve spent some time reading and understanding those two:
http://local.wasp.uwa.edu.au/~pbourke/geometry/superellipse/
http://local.wasp.uwa.edu.au/~pbourke/geometry/torus/
which gave me 2 parametric ‘primitives’ Torus and Chamfer.
in a way it is a much simpler version of Eugene’s SuperShape3d :
“only” 5 params: radiusX, radiusY, section Radius / height and N1, N2
with those you can create all kinds of shapes:
torus, ring, frame, chamfered frame, chamfer box, chamfer cyl, spindle, crystals… potatoes… you name it ! :)
1 / the Torus formula:
here’s a list of the combiantions of N1 / N2
2 / SuperEllipse/ChamferBoxCyl formula:
again a list of combiantions of N1 / N2
unfortunately, if the torus is pretty well organized ( it can almost be mapped as such ), the chamfer thingie is a mess.
the way they are built is absolutely unoptimized ( 4 points are built instead of one ) and because of the way sin/cos are put to powers, the order of the faces is not easy to determine ( it’s possible though ).
Away3d already have a chamfer box, I haven’t checked the other engines carefully, but it would give us 2 new flexible primitives to play with instead of boxes and spheres :)
hope you like it :)
my beloved readers wrote…