نقاشیهای STL
Contents
[
Hide
]صادر کردن STL به فرمت PNG
Aspose.CAD for Java به توسعهدهندگان اجازه میدهد تا یک فایل STL را به PNG صادر کنند. در زیر کدی را مشاهده میکنید که نحوه دسترسی به فایل STL و تبدیل آن به PNG با استفاده از CadRasterizationOption و PngOptions را نشان میدهد.
کد نمونه
This file contains hidden or 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); | |