# Part

> Learn about Part components in Pixyz scenes, including their properties, how to retrieve geometry information, and methods for duplication.

[API reference](/asset-transformer-sdk/2026.4/api/python/scene_types.md#part)

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](./occurrence) containing part components.

Part properties:

| Property          | Type                                                                      | Description                                                                                            |
| ----------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Id                | [Ident](/asset-transformer-sdk/2026.4/api/python/core_types.md#ident)     | A unique unsigned int identifier.                                                                      |
| BRepShapeInitial  | [Entity](/asset-transformer-sdk/2026.4/api/python/core_types.md#entity)   | Original CAD geometry data before tessellation.                                                        |
| BRepShapeModified | [Entity](/asset-transformer-sdk/2026.4/api/python/core_types.md#entity)   |                                                                                                        |
| TessellatedShape  | [Entity](/asset-transformer-sdk/2026.4/api/python/core_types.md#entity)   | Mesh information.                                                                                      |
| Transform         | [Matrix4](/asset-transformer-sdk/2026.4/api/python/geom_types.md#matrix4) | Local transform matrix of this part component, storing local position, rotation and scale information. |

> **Tip:**
>
> Use [scene.getPartOccurrences(root)](../../api/python/scene_functions#getpartoccurrences) to retrieve all part occurrences under the `root` occurrence.

Use definitions to retrieve geometry information from a Part component. This example shows how to retrieve the position of vertices of a mesh ([Mesh](../../api/python/polygonal_types#mesh)) through its definition ([MeshDefinition](../../api/python/polygonal_types#meshdefinition)):

```py title="Python"
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
        # …
    }
}
```

```cs title="C#"
uint part = pxz.Scene.GetComponent(occurrence, Scene.Native.ComponentType.Part);
// "part == 0" means that the occurrence doesn't have a part component.
if (part > 0)
{
    uint mesh = pxz.Scene.GetPartMesh(part);
    // "mesh == 0" means that no mesh is attached to the part.
    if (mesh > 0) 
    {
        // Queries geometry information from meshes.
        Polygonal.Native.MeshDefinition meshDef = pxz.Polygonal.GetMeshDefinition(mesh); 
        Geom.Native.Point3List vertices = meshDef.vertices;
        // …
    }
}
```

To duplicate a part, use the [core.cloneEntity](/asset-transformer-sdk/2026.4/api/python/core_functions.md#cloneentity) method. This snippet shows how to create a new occurrence that shares the same part component as its input:

```py title="Python"
# 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)
```

```cs title="C#"
// Gets the components to be duplicated.
uint partComponent = pxz.Scene.GetComponent(occ, Scene.Native.ComponentType.Part);

// Creates an occurrence.
uint 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);
```
