GLB to FBX

The GLB format is among the popular 3D file formats for 3D scenes & models and in order to view them, we need to use Microsoft Paint 3D, Microsoft Remix 3D, Trimble 3D Warehouse, or any program that supports glTF files. But on the other end, PDF file format is one of the widely supported formats for information sharing and many modern web browsers can display PDF files. Therefore, considering this ease, in this article, we are going to discuss the details on how to convert GLB to PDF using Python language and also, the steps to convert FBX to PDF using Python.

3D to PDF Conversion API

Our REST based solution named Aspose.3D Cloud provides the features to generate, read, and manipulate 3D documents. Now in order to utilize these features in Python application, we need to try using Aspose.3D Cloud SDK for Python. So the first step is to install the SDK which is available for download at PIP and GitHub. Please execute the following command on the command line terminal to install the SDK:

pip install aspose3dcloud

Now obtain your personalized ClientID and ClientSecret details by visiting Aspose.Cloud dashboard.

Convert GLB to PDF using Python

Please follow the steps given below to load the GLB file from cloud storage and convert it to PDF format.

  • Create an instance of ThreeDCloudApi while passing Client ID and Client secret as arguments
  • Define the input GLB name, output format as PDF and resultant file names information
  • Finally, call the post_convert_by_format(…) method of ThreeDCloudApi class to perform the conversion operation

Convert FBX to PDF using Python

In order to convert the FBX file stored in cloud storage to PDF format and the resultant file is also stored in cloud storage.

  • Create an instance of ThreeDCloudApi while passing Client ID and Client secret as arguments
  • Specify name of input FBX name, output format as PDF and resultant file names information
  • Now, call the post_convert_by_format(…) method of ThreeDCloudApi class to perform the conversion operation

The sample files used in above examples can be downloaded from Wolf-Blender-2.82a.glb and Wolf-Blender-Converted.fbx.

GLB to PDF using cURL Command

Aspose.3D Cloud is developed as per REST architecture, so in this section, we are going to learn the steps to convert GLB to PDF using cURL commands. However, the first step in this process is the generation of a JWT access token based on your client credentials. Please execute the following command to generate the token.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Once we have the JWT token, we need to execute the following command to convert GLB to PDF format.

curl -v -X POST "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Wolf-Blender-2.82a(2).glb&newformat=PDF&newfilename=Converted.pdf&IsOverwrite=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>" \
-d{}

FBX to PDF using cURL Command

Please execute the following command to load the FBX file from Cloud storage and transform it to PDF format. The resultant file is then saved to cloud storage.

curl -v -X POST "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Wolf-Blender-Converted(1).fbx&newformat=PDF&newfilename=Converted.pdf&IsOverwrite=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>" \
-d{}

Conclusion

In this article, we have explored the details to convert 3D to PDF, GLB to PDF and FBX to PDF using Python code snippets. At the same time, we have also learnt the steps to convert FBX to PDF using Python code snippet. Develop 3D PDF maker by following the steps where we convert GLB and FBX to PDF using cURL commands. Furthermore, the API also offers the feature to convert FBX to OBJ, OBJ to FBX, or save FBX to STL format. Use the API to convert your sample Mercedes glb or glb 250 etc files to the desired output format.

Please note that the Developer Guide is a great source of information to learn about amazing capabilities being offered by the SDK. In case you encounter any issues while using the API, please contact us via the free support forum.

We also advise you to visit the following link to further learn about: