Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active December 23, 2021 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/51c4c8b69db4065cc39f58bdf923ef3c to your computer and use it in GitHub Desktop.
Save aspose-com-gists/51c4c8b69db4065cc39f58bdf923ef3c to your computer and use it in GitHub Desktop.
Convert 3D Object File OBJ to FBX or STL format in C# | Export OBJ File to STL or FBX
// Load input OBJ file with Scene class.
Scene scene = new Scene("scene.obj");
// Initialize FBXSaveOptions object with SaveFormat enum.
FBXSaveOptions options = new FBXSaveOptions(FileFormat.FBX7400ASCII);
// Convert OBJ to FBX file.
scene.Save("Test.fbx", options);
// Load input OBJ file with Scene class.
Scene scene = new Scene("scene.obj");
// Initialize STLSaveOptions class object.
STLSaveOptions saveSTLOpts = new Aspose.ThreeD.Formats.STLSaveOptions();
// Configure the look up paths to allow importer to find external dependencies.
saveSTLOpts.LookupPaths = new List<string>(new string[] { dataDir });
// Convert OBJ to STL file.
scene.Save("test.stl", saveSTLOpts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment