Working with Siemens JT Format
Contents
[
Hide
]
Importing JT 10 files and exporting scenes to JT 10 requires version 26.7 or greater.
Open Siemens JT File Format
Aspose.3D for Java lets you read Siemens JT files — versions 8, 9 and 10. JT files often store multiple level-of-detail (LOD) meshes for the same geometry so CAD viewers can trade detail for speed. The JtLoadOptions.setLevelOfDetail() method selects which LOD mesh to load, or loads them all.
// Load a Siemens JT file
Scene scene = Scene.fromFile("input.jt");
// Or load it with JT options, choosing the level of detail to import
JtLoadOptions loadOptions = new JtLoadOptions();
// Load all level-of-detail meshes defined in the JT file
loadOptions.setLevelOfDetail(JtLoadLevelOfDetail.ALL);
// Load PMI (Product Manufacturing Information) if present
loadOptions.setLoadPMI(true);
Scene loaded = new Scene();
loaded.open("input.jt", loadOptions);Save Siemens JT File Format
You can export a scene to Siemens JT 10 using the SIEMENSJT10 file format. The JtSaveOptions class controls normal export and vertex quantization, which trades precision for file size.
// Save the scene back to a JT 10 file
JtSaveOptions saveOptions = (JtSaveOptions)FileFormat.SIEMENSJT10.createSaveOptions();
saveOptions.setExportNormals(true);
// Quantize vertex positions to 16 bits to reduce file size
saveOptions.setVertexQuantizationBits(16);
scene.save("output.jt", saveOptions);
When you save a scene to JT, the file is always written in JT 10 format regardless of the JT version the source file used.