BricksViewer uses an XML file format to define part data. During the build process all .xml files in $BUILD_DIR/bricks/xml/ are loaded, have normals calculated, and are then serialized to $BUILD_DIR/build/bricks/ and given the ending .style. These serialized class files are then included in the bricksviewer.jar. During development of a part file, you may wish to make repeated changes to a part without rebuilding the jar. If the BricksViewer app doesn't find a given part in a serialized format in the jar file, it will look for an XML file in the same directory it was launched from. For additional details see the section on authoring a part file.
<substyle id="SolidStud" offy="11.0" offx="8.0" offz="8.0"/></shape>
...
<point id="0" x="-4.0" y="0.0" z="4.0"/>
...
<triangle v1="0" v2="20" v3="3"/>
...
shape
Attribute | Description | Required |
---|---|---|
id | The unique identifier for this part. This must match the id used in the LFXML file for parts or the id in the substyle for substyles. | Y |
normalType | How to calculate vertex normals for this part. Valid values:
|
N |
Attribute | Description | Required |
---|---|---|
id | The unique identifier of the part to load. | Y |
offx | The X offset of the subpart | N |
offy | The Y offset of the subpart | N |
offz | The Z offset of the subpart | N |
angle | The angle of rotation in degrees | N |
ax | The portion of the angle of rotation to apply to the x axis in the range 0.0-1.0 | N |
ay | The portion of the angle of rotation to apply to the y axis in the range 0.0-1.0 | N |
az | The portion of the angle of rotation to apply to the z axis in the range 0.0-1.0 | N |
Attribute | Description | Required |
---|---|---|
id | The unique (to the file) identifier of the point. | Y |
x | The X coordinate of the point | Y |
y | The Y coordinate of the point | Y |
z | The Z coordinate of the point | Y |
Attribute | Description | Required |
---|---|---|
v1 | The first point of the triangle | Y |
v2 | The second point of the triangle | Y |
v3 | The third point of the triangle | Y |
normalType | How to calculate vertex normals for this triangle. Valid values:
|
N |
Before starting the process of authoring a part file for inclusion in BricksViewer, please read the BSD license BricksViewer is distributed under and make sure you are comfortable with it.
Authoring a part file is a fairly straightforward process. For example, if you wish to add the part foo to BricksViewer, you would follow these steps:
Triangles must be defined counter clockwise to render correctly. If you are authoring a part file with the goal of having it included in in BricksViewer, please:
If you are fixing an existing part file, please submit the changes in patch format to the Patch Tracker at SourceForge under the category "Existing Part File".