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); | |