| 276 | |
| 277 | |
| 278 | protected void writeTriangle() { |
| 279 | writer.println("0"); |
| 280 | writer.println("3DFACE"); |
| 281 | |
| 282 | // write out the layer |
| 283 | writer.println("8"); |
| 284 | /* |
| 285 | if (i < MAX_TRI_LAYERS) { |
| 286 | if (layerList[i] >= 0) { |
| 287 | currentLayer = layerList[i]; |
| 288 | } |
| 289 | } |
| 290 | */ |
| 291 | writer.println(String.valueOf(currentLayer)); |
| 292 | |
| 293 | write("10", vertices[0][X]); |
| 294 | write("20", vertices[0][Y]); |
| 295 | write("30", vertices[0][Z]); |
| 296 | |
| 297 | write("11", vertices[1][X]); |
| 298 | write("21", vertices[1][Y]); |
| 299 | write("31", vertices[1][Z]); |
| 300 | |
| 301 | write("12", vertices[2][X]); |
| 302 | write("22", vertices[2][Y]); |
| 303 | write("32", vertices[2][Z]); |
| 304 | |
| 305 | // Without adding EPSILON, Rhino kinda freaks out. |
| 306 | // A face is actually a quad, not a triangle, |
| 307 | // so instead kinda fudging the final point here. |
| 308 | write("13", vertices[2][X] + EPSILON); |
| 309 | write("23", vertices[2][Y] + EPSILON); |
| 310 | write("33", vertices[2][Z] + EPSILON); |
| 311 | |
| 312 | vertexCount = 0; |
| 313 | } |
| 314 | |
| 315 | |
| 316 | // .............................................................. |