I just finished making the second version. This version allows you to change some ratios on the hexagon to make it more perfect or easy to use.
You can adjust two values(le/he). Look at the picture to see what these mean.
createhex(object number,le or he,he or le)
function findobject()
t=1
do
if object exist(t)=0 then exit
t=t+1
loop
endfunction t
function findmesh()
t=1
do
if mesh exist(t)=0 then exit
t=t+1
loop
endfunction t
function createhex(obj,he as float,le as float)
local ang as float
if le>he then o=le:le=he:he=o
make object triangle obj,0-he,0,0,0-le,0,he,0,0,0
nobj=findobject()
mesh=findmesh()
make object triangle nobj,0-le,0,he,le,0,he,0,0,0
make mesh from object mesh,nobj
delete object nobj
add limb obj,1,mesh
delete mesh mesh
make object triangle nobj,le,0,he,he,0,0,0,0,0
make mesh from object mesh,nobj
delete object nobj
add limb obj,2,mesh
delete mesh mesh
make object triangle nobj,he,0,0,le,0,0-he,0,0,0
make mesh from object mesh,nobj
delete object nobj
add limb obj,3,mesh
delete mesh mesh
make object triangle nobj,le,0,0-he,0-le,0,0-he,0,0,0
make mesh from object mesh,nobj
delete object nobj
add limb obj,4,mesh
delete mesh mesh
make object triangle nobj,0-le,0,0-he,0-he,0,0,0,0,0
make mesh from object mesh,nobj
delete object nobj
add limb obj,5,mesh
delete mesh mesh
make mesh from object mesh,obj
delete object obj
make object obj,mesh,0
offset limb obj,0,0,1,0
add limb obj,1,mesh
offset limb obj,1,0,0,0
rotate limb obj,1,180,0,0
delete mesh mesh
make object plain nobj,le*2,1
make mesh from object mesh,nobj
delete object nobj
make object nobj,mesh,0
offset limb nobj,0,0,0.5,he
add limb nobj,1,mesh
rotate limb nobj,1,0,180,0
offset limb nobj,1,0,0.5,0-he
delete mesh mesh
wobj=findobject()
make object plain wobj,sqrt(he^2+(he-le)^2)+0.05,1
make mesh from object mesh,wobj
delete object wobj
ang=90-wrapvalue(atanfull(he,he-le))
add limb nobj,2,mesh
rotate limb nobj,2,0,90-ang,0
offset limb nobj,2,(he-((he-le)/2.0)),0.5,he/2.0
add limb nobj,3,mesh
rotate limb nobj,3,0,90+ang,0
offset limb nobj,3,(he-((he-le)/2.0)),0.5,0-(he/2.0)
add limb nobj,4,mesh
rotate limb nobj,4,0,270-ang,0
offset limb nobj,4,0-(he-((he-le)/2.0)),0.5,0-(he/2.0)
add limb nobj,5,mesh
rotate limb nobj,5,0,270+ang,0
offset limb nobj,5,0-(he-((he-le)/2.0)),0.5,he/2.0
delete mesh mesh
make mesh from object mesh,nobj
delete object nobj
add limb obj,2,mesh
delete mesh mesh
endfunction
Note: this version wouldn't work on DBC
If everything was back to normal, it would happen again.