|Default Value:||By default there is no connection at all.|
|Description:||A list of connection point. There is no limit to the list and each connection point has several parameters to tune.|
The type field is string id representing the type of the connection. In BlueBrick only connections of the same type can connect to each other. The available types and the color used to represent them in BlueBrick are defined in an XML configuration file named "ConnectionTypeList.xml" and located in the "config" folder of the BlueBrick install folder. Read the "Connection Type" configuration file section for more details.
The position field is the coordinate of the connection in stud units, relative to the center of the part. First you have to determine the distance of your connector to the center of your part, in studs. In the example below the distance is 8 studs to all sides. You don't need to specify the center of the part because BlueBrick does this automatically. When BlueBrick rotates the parts, it is a lot more simple and efficient to rotate it at its center. This is why BlueBrick uses this system to make the coordinates for the connection points:
Note that the Y axis is oriented downward (positive value toward the bottom). Usually it is easy to find the center of your part based on the LEGO© geometry of the part. For example for the 9V track crossing above, it is obvious to see that the 4 connection points are at 8 studs from the center. But if you have a complex part such as the 9V rail point below, you can find the center of the part based on the part picture itself. And then, from this center you can compute the positions of the connection points.
The computation of the position is the most difficult thing when your part does not have a simple geometry, but most of the time it stays quite simple. The next parameter is the angle field. This describe the orientation in degrees of the connection point compare to the direction of the right border. Be careful, since the Y Axis is inverted in the part coordinate system, the sign of the angle is inverted compared to the trigonometric direction.
The Angle to Previous field and Angle to Next field are quite similar to the previous parameter. It indicates the difference in degrees between this connection point and the previous or next one in the list. The previous point of the first point is the last point and the next point of the last point is the first point, such as you obtain a circular list. So be careful if you reorganize the order of the connection point you will have to reset these two parameter.
The order of the connection points is used by BlueBrick when you rotate a part that is connected to another. BlueBrick rotates the part in such a way to connect it to the next connection point in the list. Of course, if one part has a different type of connection point (such as a rail crossing in which you have road and rail connection point), you have a different circular list. There is one list per connection type.
The Next connection preference field is a 0-based index pointing to a connection inside the list. This parameter tells BlueBrick witch connection point should be selected automatically after the user has placed the part and connected it. If you take the straight 9V track as an example, when the user connects this track by its left connection point, you want to have the right connection point selected automatically so that you can add subsequent pieces very easily. The same applies if you connect this part with the right connection point, as then you want to have the left one selected automatically.
Normally a connection should not refer to itself as the preference for the next selected connection point (unless there is only one connection point in this part), else you will see the parts stack to each other in BlueBrick. If you take the example of a 9V switch point, you can see that if you connect this part from the left connecion point, the bottom right will then be selected and if you connect it from any right connection point, the left one will be selected.
<ConnexionList> ┌─► <connexion> │ ┌─── <nextConnexionPreference>1</nextConnexionPreference> │ │ </connexion> │ └►<connexion> ├──── <nextConnexionPreference>0</nextConnexionPreference> │ </connexion> │ <connexion> └──── <nextConnexionPreference>0</nextConnexionPreference> </connexion> </ConnexionList>
Finally the Electric Plug field is used for track with electric circuits (9V and 12V) so you can omit this field for most parts. The field contains an integer that can be positive or negative. Different values indicates different independant circuits which are not connected electrically on the part. For example if you take the rail-cross part 32087, or a level crossing with two parallel railways, one line will be identified with the numbers +1/-1, and the other line with the numbers +2/-2.
The connections with the positive values are electricaly connected to the connections with the same negative values. That means a connection with an electric plug +1 is connected to all the connections with an electric plug -1 and vice and versa. But of cource +1 is not connected to -2, neither to another +1. See the image below for some example: