Created
August 11, 2025 14:30
-
-
Save aspose-com-gists/096bff401453941ad3d58bca1f7d1873 to your computer and use it in GitHub Desktop.
Convert 3MF File to STL in C#
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
using Aspose.ThreeD; | |
using Aspose.ThreeD.Formats; | |
namespace AsposeThreeD | |
{ | |
class Graphics | |
{ | |
// Convert 3MF to STL in C# | |
static void Main(string[] args) | |
{ | |
// Set the directory path. | |
String dataDir = "data"; | |
// Create an instance of the Scene class. | |
Scene scene = new Scene(); | |
// Invoke the Open method to load the Source 3MF file. | |
scene.Open(dataDir + "torus_sliced.3mf"); | |
// Instantiate an object of the StlSaveOptions class to access the options for exporting scene as STL file. | |
var stlSaveOptions = new StlSaveOptions(); | |
// Call the Save method to save the output as a STL file. | |
scene.Save(dataDir + "sample.stl", stlSaveOptions); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment