An add-on to fit primitive shapes to selected vertices. Current handles Sphere, Plane, and Cylinder.
Cylinder can be fit either to a single selection of vertices or two (added separately in the UI).
Initially developed for Bones and biomechanics, likely useful for other purposes.
Sphere - select verticies that either sit on the surface of a sphere, or define it's volume.
Plane - Will fit a plane through the centre of the selected verticies, aligned with the two major axes.
Cylinder - Will fit a cylinder to a selection of verticies that lie on the side of the cylinder. Note that principle component is uses to orient the cylinder, so if you select verticies across the cylinder, it will be oriented wrong.
2 condyle cylinder - will take two sets of verticies that lie on the cylinder surface and fit a cylinder. Idea for e.g. the distal end of limb bones.
Added local axes/pivot orientation for plane and cylinder.
This extension does not require special permissions.
I've taken a look into this for you. Next version will have a properly aligned local axis that's oriented with the object (Z normal for plane, Z along long-axis of cylinder, obviously not applicable to sphere).
However, turns out the maths for cube-fitting is really complex (more so than the shapes already covered), and possibly not doable in blender without relying on external dependancies (which I don't want to do).
I implemented a couple of algorithms for fitting cubes/cuboids and they were, to be frank, rubbish, and it'd be way quicker to just hand align a cube. I'll keep an eye out, but don't expect cube fitting anytime soon, sorry.
v1.2 with oriented local axes uploaded
it's nice but.. please, add cube as an option for shape, and local/global orientation parameter...