Convert CGM to GLB via C#
Instantly convert CGM to GLB without needing AutoCAD® or any other rendering software.
How to Convert CGM to GLB Using C#
In order to convert CGM to GLB, we’ll use Aspose.CAD for .NET API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C# platform. Open NuGet package manager, search for Aspose.CAD and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.CAD
Steps to Convert CGM to GLB via C#
.NET programmers can easily load & convert CGM files to GLB in just a few lines of code.
- Load CGM file with Image.Load method
- Set an object of CadRasterizationOptions with page height & width
- Create an instance of GlbOptions class and set its VectorRasterizationOptions property
- Call Image.Save method while passing the resultant file path & object of GlbOptions
System Requirements
Before running the .NET conversion code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core.
- Development environment like Microsoft Visual Studio.
- Aspose.CAD for .NET DLL referenced in your project.
This sample code shows CGM to GLB C# Conversion
Free App to Convert CGM to GLB
CGM What is CGM File Format?
Computer Graphics Metafile (CGM) is free, platform-independent, international standard metafile format for storing and exchanging vector graphics (2D), raster graphics, and text. CGM uses an object-oriented approach and many function provisions for image production. CGM uses these object-oriented characteristics for remolding graphical elements to render an image. A metafile contains necessary information that defines other files. In CGM, a text-based source file contains all graphical elements that can be later compiled into a binary file. Basically, CGM is a way to facilitate 2D graphical data interchange, independent from any particular platform, or device.
Read MoreGLB What is GLB File Format?
GLB is the binary file format representation of 3D models saved in the GL Transmission Format (glTF). Information about 3D models such as node hierarchy, cameras, materials, animations and meshes in binary format. This binary format stores the glTF asset (JSON, .bin and images) in a binary blob. It also avoids the issue of increase in file size which happens in case of glTF. GLB file format results in compact file sizes, fast loading, complete 3D scene representation, and extensibility for further development. The format uses model/gltf-binary as MIME type.
Read MoreOther Supported Conversions
You can also convert CGM into many other file formats including few listed below.