STL-Zeichnungen
Contents
[
Hide
]STL in das PNG-Format exportieren
Aspose.CAD für Java ermöglicht es Entwicklern, eine STL-Datei in PNG zu exportieren. Nachfolgend ist der Code dargestellt, der zeigt, wie auf die STL-Datei zugegriffen und diese unter Verwendung von CadRasterizationOption und PngOptions in PNG konvertiert wird.
Beispielcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataDir = Utils.getDataDir(ExportSTLToPNG.class) + "ExportingSTL/"; | |
String fileName = dataDir + "example.stl"; | |
CadImage cadImage = (CadImage)Image.load(fileName); | |
CadRasterizationOptions vectorOptions = new CadRasterizationOptions(); | |
vectorOptions.setPageWidth(1500); | |
vectorOptions.setPageHeight(1500); | |
PngOptions pngOptions = new PngOptions(); | |
//pngOptions.setVectorRasterizationOptions(rasterizationOptions); | |
String outPath = dataDir + "galeon.stl.png"; | |
cadImage.save(outPath, pngOptions); | |