Here's some code to make a hexagonal object, with none of that tricky algebra/geometry/trig stuff involved.
` This code makes a hexagonal object, with sides.
` It could also be adapted to make a pentagon, or other polygons.
` Use these two values to adjust the width and height of the hex.
nHexRadius = 50
nHexHeight = 10
` The spheres are placeholders for the triangle vertexes.
for o = 1 to 6
make object sphere o,5
yrotate object o,30+((o-1)*60)
move object o,nHexRadius
next o
` Use the sphere locations to build all the triangles.
for ob = 1 to 6
o2 = ob + 1
if o2 = 7 then o2 = 1
x1 = object position x(ob)
z1 = object position z(ob)
x2 = object position x(o2)
z2 = object position z(o2)
make object triangle ob+6,0,0,0,x1,0,z1,x2,0,z2
make object triangle ob+12,x1,0,z1,x1,-nHexHeight,z1,x2,0,z2
make object triangle ob+18,x1,-nHexHeight,z1,x2,-nHexHeight,z2,x2,0,z2
next ob
` Delete the spheres.
for ob = 1 to 6
delete object ob
next ob
` Add the triangles into one object.
for ob = 8 to 24
make mesh from object ob,ob
delete object ob
add limb 7,ob-7,ob
next ob
` Make 'em all shiny.
set object normals 7
do
yrotate object 7,wrapvalue(object angle y(7)+.01)
loop