Also the needed information can differ a lot depending on what you want to do with it. In my approach I've choosen to describe shapes instead of connection types. So the software doesn't know anything about studs/pegs etc, it's only matching shapes against other shapes.
For example this is info I'm using for the 5.5 axle.
0 !LDCAD SNAP_CYL [gender=M] [caps=none] [secs=A 6 18 R 8 2 R 6 8 A 6 80] [center=true] [pos=-1 0 0] [ori=0 -1 0 1 0 0 0 0 1] [slide=true]
The engine will test this against other shapes, and if it fits it will snap to it along it's y axis. The above will go (partly) into a peghole because it's shape is simular (they share a radius 6 section, and the other sections are larger):
0 !LDCAD SNAP_CYL [gender=F] [caps=none] [secs=R 8 2 R 6 16 R 8 2] [center=true] [slide=true] [pos=0 0 0] [ori=1 0 0 0 1 0 0 0 1]
I've tried using as many primitive's possible for defining the info but I'm somewhat disappointed on that subject. It seems many primitives are 'misused' somewhat degrading their snap information on the higher level. For example the axle.dat primitive seems to be used for internals alot (Isn't is mend to be used open ended only?). Also some primitives are used mirrored (messing up orientation) although I managed to compensate for that somewhat. And finally there are a lot of parts that don't use primitives where they should, for example most tehcnic beams are missing the last peghole if only inherited info is used.
For example this is info I'm using for the 5.5 axle.
0 !LDCAD SNAP_CYL [gender=M] [caps=none] [secs=A 6 18 R 8 2 R 6 8 A 6 80] [center=true] [pos=-1 0 0] [ori=0 -1 0 1 0 0 0 0 1] [slide=true]
The engine will test this against other shapes, and if it fits it will snap to it along it's y axis. The above will go (partly) into a peghole because it's shape is simular (they share a radius 6 section, and the other sections are larger):
0 !LDCAD SNAP_CYL [gender=F] [caps=none] [secs=R 8 2 R 6 16 R 8 2] [center=true] [slide=true] [pos=0 0 0] [ori=1 0 0 0 1 0 0 0 1]
I've tried using as many primitive's possible for defining the info but I'm somewhat disappointed on that subject. It seems many primitives are 'misused' somewhat degrading their snap information on the higher level. For example the axle.dat primitive seems to be used for internals alot (Isn't is mend to be used open ended only?). Also some primitives are used mirrored (messing up orientation) although I managed to compensate for that somewhat. And finally there are a lot of parts that don't use primitives where they should, for example most tehcnic beams are missing the last peghole if only inherited info is used.