Hi Mario,
I finally did some reading on Wikipedia re: different types of joints, e.g. connections that can undergo motion. I think I can map your spec to all "lower" connection types (e.g. the simple ones) and we can see which ones are missing (and whether they are needed).
First, the connections you have:
Point connection = ball & socket joint. 3 degrees of freedom, all rotational. Example: tow-ball connectors
Vector connection = revolute joint. 1 rotational degree of freedom. Example: wheel on a wheel holder.
Rail connection = cylindrical joint. 2 degrees of freedom (one rotational, one translational). The rotation axis and the translation axis must be the same. Example: a technic axle through a technic hole.
There are a few types of connectors that you do not have that I think are useful for LDraw:
Prismatic. This is like a rail connector that cannot rotate. 1 degree of translational freedom. Example: a technic axle through a technic axle hole. For prismatic joints, you need more information than just two points to specify the connections, because the complete orientation of the joint matters. For example, if your technic brick with axle hole is rotated, the axle must rotate too or the connection is "wrong".
I think that -even- if your app does not care about motion, having prismatic joints (with the complete orientation of the connector) matters to ensure that oriented prisms like axle + axle-hole are matched properly.
Rigid connection - this isn't a "joint" on wikipedia. 0 degrees of freedom, e.g. the two parts are connected in exactly one way. Like the prismatic connection, you need more orientation information than you can get from two points.
HELP: I'm having trouble thinking of a -true- rigid connection off-hand. My original idea was the old (early 80s) 2-prong 4.5 plug into the 2x2 light brick. But that's sort of a prismatic joint - you can slide the plug in and out gradually. Surely there must be something that 'just snaps'?
Screw Joint. After the discussion of the evil worm gear, I was fascinated to see that Wikipedia simply lists this as a 1-degree-of-freedom lower pair joint. I have -no- idea how we'd ever specify a screw joint in LDraw, but I was heartened to know that they, um, exist. :-)
Finally, there are a few joints that I think are not useful:
Planar Joints - three degrees of freedom with a plate always in contact. If anyone can think of a part that does this, please let me know; I came up short.
It also seemed possible to me to have a 2-degree-of-freedom "universal" joint that can transfer torque, but as a part, the u-joint is really 3 parts with two revolute joints, and this is probably how we'd want to model it, not with a single "magic" connection.
In terms of possible modifications to your spec, I think I would propose the addition of prismatic and rigid connectors, both with some way to specify complete orientation. This would allow you to snap parts that either slide without rotating or snap in only one way.
In terms of how you specify the orientation, besides simply adding a third point (3 points = 2 vectors at right angles = a coordinate system, using a cross-product to find the third axis), the other choice would be to always have connectors be aligned to the XYZ coordinate system (e.g. ALL rails point up the Y axis, for example) and use a matrix to orient the connector as needed.
The "win" of this, I think, is that we already use transform matrices to orient parts, and it's necessary to take into account the entire set of transforms when dealing with connectors anyway, so this would simply give you one more matrix to multiply in, rather than special casing for which way the connector is oriented. I suppose that given 3-point representations of a connector, you could internally convert it to a matrix at load time.
Anyway, the good news is that it appears that your definitions are orthogonal as joints (e.g. you're not doing the same thing with two connector families) and you've already covered almost all of the cases. :-)
If anyone can think of some crazy connection type or motion that I didn't list, please shout loudly! Of course, this doesn't touch belts, gears, or any of that crazy technic stuff. ;-)
Cheers
Ben
I finally did some reading on Wikipedia re: different types of joints, e.g. connections that can undergo motion. I think I can map your spec to all "lower" connection types (e.g. the simple ones) and we can see which ones are missing (and whether they are needed).
First, the connections you have:
Point connection = ball & socket joint. 3 degrees of freedom, all rotational. Example: tow-ball connectors
Vector connection = revolute joint. 1 rotational degree of freedom. Example: wheel on a wheel holder.
Rail connection = cylindrical joint. 2 degrees of freedom (one rotational, one translational). The rotation axis and the translation axis must be the same. Example: a technic axle through a technic hole.
There are a few types of connectors that you do not have that I think are useful for LDraw:
Prismatic. This is like a rail connector that cannot rotate. 1 degree of translational freedom. Example: a technic axle through a technic axle hole. For prismatic joints, you need more information than just two points to specify the connections, because the complete orientation of the joint matters. For example, if your technic brick with axle hole is rotated, the axle must rotate too or the connection is "wrong".
I think that -even- if your app does not care about motion, having prismatic joints (with the complete orientation of the connector) matters to ensure that oriented prisms like axle + axle-hole are matched properly.
Rigid connection - this isn't a "joint" on wikipedia. 0 degrees of freedom, e.g. the two parts are connected in exactly one way. Like the prismatic connection, you need more orientation information than you can get from two points.
HELP: I'm having trouble thinking of a -true- rigid connection off-hand. My original idea was the old (early 80s) 2-prong 4.5 plug into the 2x2 light brick. But that's sort of a prismatic joint - you can slide the plug in and out gradually. Surely there must be something that 'just snaps'?
Screw Joint. After the discussion of the evil worm gear, I was fascinated to see that Wikipedia simply lists this as a 1-degree-of-freedom lower pair joint. I have -no- idea how we'd ever specify a screw joint in LDraw, but I was heartened to know that they, um, exist. :-)
Finally, there are a few joints that I think are not useful:
Planar Joints - three degrees of freedom with a plate always in contact. If anyone can think of a part that does this, please let me know; I came up short.
It also seemed possible to me to have a 2-degree-of-freedom "universal" joint that can transfer torque, but as a part, the u-joint is really 3 parts with two revolute joints, and this is probably how we'd want to model it, not with a single "magic" connection.
In terms of possible modifications to your spec, I think I would propose the addition of prismatic and rigid connectors, both with some way to specify complete orientation. This would allow you to snap parts that either slide without rotating or snap in only one way.
In terms of how you specify the orientation, besides simply adding a third point (3 points = 2 vectors at right angles = a coordinate system, using a cross-product to find the third axis), the other choice would be to always have connectors be aligned to the XYZ coordinate system (e.g. ALL rails point up the Y axis, for example) and use a matrix to orient the connector as needed.
The "win" of this, I think, is that we already use transform matrices to orient parts, and it's necessary to take into account the entire set of transforms when dealing with connectors anyway, so this would simply give you one more matrix to multiply in, rather than special casing for which way the connector is oriented. I suppose that given 3-point representations of a connector, you could internally convert it to a matrix at load time.
Anyway, the good news is that it appears that your definitions are orthogonal as joints (e.g. you're not doing the same thing with two connector families) and you've already covered almost all of the cases. :-)
If anyone can think of some crazy connection type or motion that I didn't list, please shout loudly! Of course, this doesn't touch belts, gears, or any of that crazy technic stuff. ;-)
Cheers
Ben