Documentation

Support

Asset Transformer SDK


User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

Part

Learn about Part components in Pixyz scenes, including their properties, how to retrieve geometry information, and methods for duplication.
Read time 2 minutesLast updated 21 hours ago

API reference Parts are components that contain geometry information, such as information related to CAD, meshes, lines, and UVs. "Part occurrences" is a term often used to refer to occurrences containing part components. Part properties:

Property

Type

Description

IdIdentA unique unsigned int identifier.
BRepShapeInitialEntityOriginal CAD geometry data before tessellation.
BRepShapeModifiedEntity
TessellatedShapeEntityMesh information.
TransformMatrix4Local transform matrix of this part component, storing local position, rotation and scale information.
Use definitions to retrieve geometry information from a Part component. This example shows how to retrieve the position of vertices of a mesh (Mesh) through its definition (MeshDefinition):
part = pxz.scene.getComponent(occurrence, pxz.scene.ComponentType.Part)# "part == 0" means that the occurrence doesn't have a part component.if (part > 0){ mesh = pxz.scene.getPartMesh(part) # "mesh == 0" means that no mesh is attached to the part. if (mesh > 0) { # Queries geometry information from meshes. meshDef = pxz.polygonal.getMeshDefinition(mesh) vertices = meshDef.vertices # … }}
To duplicate a part, use the core.cloneEntity method. This snippet shows how to create a new occurrence that shares the same part component as its input:
# Gets the components to be duplicated.partComponent = pxz.scene.getComponent(occ, pxz.scene.ComponentType.Part)# Creates an occurrence.lod = pxz.scene.createOccurrence("_LOD1")# Sets the part component of the cloned occurrence as the part component of the new occurrence.pxz.scene.setComponentOccurrence(pxz.core.cloneEntity(part), lod)pxz.scene.setParent(lod, occ)