Use Cases

Overview

Aspose.3D is an open-source 3D file format library for Python that enables developers to create, manipulate, and convert 3D scenes and models programmatically. It supports modern 3D workflows by providing robust file I/O and scene graph handling.

The library offers full support for glTF (GL Transmission Format) with PBR material support, making it suitable for web and real-time rendering pipelines. Its hierarchical node structure allows intuitive organization of 3D scenes using parent-child relationships between nodes, enabling scalable scene management for complex models.

How It Works

Aspose.3D for Python provides programmatic control over 3D scenes and models through a structured object model centered on Scene, Node, and Entity. Developers can load existing formats like STL (widely used for 3D printing) or construct scenes from scratch using core primitives such as Mesh. The library supports mesh and entity management, enabling inspection and modification of vertex data, polygon topology, and spatial relationships within the scene hierarchy.

from aspose.threed import Scene
from aspose.threed.entities import Mesh

# Create a Mesh instance
mesh = Mesh()

# Access mesh data (control_points and edges are properties, not method calls)
vertices = mesh.control_points
edges = mesh.edges

Code Example

This example demonstrates loading a 3D model from an OBJ file with load options, then traversing its scene graph to inspect mesh geometry. It uses the correct Scene.from_file() API and accesses control_points as a property.

from aspose.threed import Scene
from aspose.threed.entities import Mesh
from aspose.threed.formats import ObjLoadOptions

# Import an OBJ file with load options
options = ObjLoadOptions()
options.enable_materials = True
options.flip_coordinate_system = False

scene = Scene.from_file("model.obj", options)

# Access imported data
for node in scene.root_node.child_nodes:
    if node.entity and isinstance(node.entity, Mesh):
        mesh = node.entity
        print(f"Mesh: {node.name}")
        print(f"  Vertices: {len(mesh.control_points)}")
        print(f"  Polygons: {mesh.polygon_count}")

See Also

Aspose.3D enables robust 3D Python development for visualization tools and interactive applications. Developers can create and manipulate 3D scenes, import and export OBJ files with full material, texture, and grouping support, and perform low-level vector math using built-in types like Vector4 and Matrix4.