Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created August 11, 2025 14:30
Show Gist options
  • Save aspose-com-gists/096bff401453941ad3d58bca1f7d1873 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/096bff401453941ad3d58bca1f7d1873 to your computer and use it in GitHub Desktop.
Convert 3MF File to STL in C#
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