# Algo

> Python API functions

### assembleCAD

Assemble faces of CAD shapes.

```python
algo.assembleCAD(occurrences, tolerance=0.1, removeDuplicatedFaces=True)
```

Parameters

| Type                                           | Name                  | Description                                |
| ---------------------------------------------- | --------------------- | ------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences           | Occurrences of components to assemble.     |
| [Distance](./geom_types#distance)              | tolerance             | Assembling tolerance.                      |
| [Boolean](./core_types#boolean)                | removeDuplicatedFaces | If True, duplicated faces will be removed. |

### backToInitialBRep

Create the BRep shape from a Tessellated shape with Domain Patch Attributes (after tessellate).

```python
algo.backToInitialBRep(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### bakeImpostor

Bakes impostors textures.

```python
algo.bakeImpostor(occurrence, XFrames, YFrames, hemi=False, resolution=1024, padding=0, roughness=False, metallic=False, ao=False) -> algo.OctahedralImpostor
```

Parameters

| Type                                   | Name       | Description |
| -------------------------------------- | ---------- | ----------- |
| [Occurrence](./scene_types#occurrence) | occurrence |             |
| [Int](./core_types#int)                | XFrames    |             |
| [Int](./core_types#int)                | YFrames    |             |
| [Bool](./core_types#bool)              | hemi       |             |
| [Int](./core_types#int)                | resolution |             |
| [Int](./core_types#int)                | padding    |             |
| [Boolean](./core_types#boolean)        | roughness  |             |
| [Boolean](./core_types#boolean)        | metallic   |             |
| [Boolean](./core_types#boolean)        | ao         |             |

Returns

| Type                                                  | Name          | Description                             |
| ----------------------------------------------------- | ------------- | --------------------------------------- |
| [OctahedralImpostor](./algo_types#octahedralimpostor) | octahedralImp | The structure containing impostor data. |

### bakeVertexAttributes

Bake vertex attributes on meshes from other meshes.

```python
algo.bakeVertexAttributes(destinationOccurrences, sourceOccurrences=[], skinnedMesh=True, positions=False, useCurrentPositionAsTPose=False)
```

Parameters

| Type                                           | Name                      | Description                                                              |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | destinationOccurrences    | Occurrences of the meshes where to store the baked vertex attributes.    |
| [OccurrenceList](./scene_types#occurrencelist) | sourceOccurrences         | Occurrences of components from which to bake vertex attributes.          |
| [Boolean](./core_types#boolean)                | skinnedMesh               | Enabling skinned mesh baking (joint assignation for animation transfer). |
| [Boolean](./core_types#boolean)                | positions                 | Enabling vertex position baking.                                         |
| [Boolean](./core_types#boolean)                | useCurrentPositionAsTPose | Use the current position as the T-Pose.                                  |

### calculateNormalsInPointClouds

> **Important:**
>
> This function is tagged as experimental.

Calculate the normal of each point of a Point Cloud.

```python
algo.calculateNormalsInPointClouds(occurrences)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |

### configureFunctionLogger

```python
algo.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
```

Parameters

| Type                            | Name                | Description |
| ------------------------------- | ------------------- | ----------- |
| [String](./core_types#string)   | functionName        |             |
| [Boolean](./core_types#boolean) | enableFunction      |             |
| [Boolean](./core_types#boolean) | enableParameters    |             |
| [Boolean](./core_types#boolean) | enableExecutionTime |             |

### crackCADMoebiusStrip

Detect Moebius strip and crack them if there is somme of them in the selection.

```python
algo.crackCADMoebiusStrip(occurrences)
```

Parameters

| Type                                           | Name        | Description                         |
| ---------------------------------------------- | ----------- | ----------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to check. |

### crackEdges

> **Warning:**
>
> This function is deprecated.

Crack polygonal edges according to given criteria (deprecated, use crackMeshEdges instead).

```python
algo.crackEdges(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useNonManifoldFilter=False)
```

Parameters

| Type                                           | Name                 | Description                                                                                 |
| ---------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Occurrences of components to process.                                                       |
| [Boolean](./core_types#boolean)                | useAttributesFilter  | Filters by attribute.                                                                       |
| [Angle](./geom_types#angle)                    | sharpAngleFilter     | Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. |
| [Boolean](./core_types#boolean)                | useNonManifoldFilter | Filters by manifold-ness.                                                                   |

### crackMeshEdges

Crack polygonal edges according to given criteria.

```python
algo.crackMeshEdges(occurrences, normal=False, uvs=False, uvChannels=None, loi=False, patches=False, nman=False)
```

Parameters

| Type                                           | Name        | Description                                                                           |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process.                                                 |
| [Boolean](./core_types#boolean)                | normal      | Crack on sharp normals.                                                               |
| [Boolean](./core_types#boolean)                | uvs         | Crack on UV seams.                                                                    |
| [IntList](./core_types#intlist)                | uvChannels  | If empty and uvs=true, crack all UV channel, else only channel specified in the list. |
| [Boolean](./core_types#boolean)                | loi         | Crack on identifier Lines of Interests.                                               |
| [Boolean](./core_types#boolean)                | patches     | Crack on patch borders.                                                               |
| [Boolean](./core_types#boolean)                | nman        | Crack on non-manifolds.                                                               |

### createFreeEdgesFromPatches

Create free edges from patch borders.

```python
algo.createFreeEdgesFromPatches(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### createIdentifiedPatchesFromPatches

Create identified patch from existing patch (this is useful before cloning for baking).

```python
algo.createIdentifiedPatchesFromPatches(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### createIndexMapFromOccurrences

Create an IndexMap and add an UVSet so that each mesh will have UVs refering to one different pixel of the index map and that pixel will have the value i for occurrences\[i]. Warning: all occurrences will be singularized.

```python
algo.createIndexMapFromOccurrences(occurrences, uvChannel=1, createTexture1D=False) -> material.Image
```

Parameters

| Type                                           | Name            | Description                                                                                                                                           |
| ---------------------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences     |                                                                                                                                                       |
| [Int](./core_types#int)                        | uvChannel       |                                                                                                                                                       |
| [Bool](./core_types#bool)                      | createTexture1D | If true, the texture will have a resolution of 1 x occurrences.size, else a square power of two image will be created to fit occurrences.size pixels. |

Returns

| Type                            | Name     | Description |
| ------------------------------- | -------- | ----------- |
| [Image](./material_types#image) | indexMap |             |

### createNormals

Create normal attributes on tessellations.

```python
algo.createNormals(occurrences, sharpEdge=45, override=True, useAreaWeighting=False)
```

Parameters

| Type                                           | Name             | Description                                                                                                                   |
| ---------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences      | Occurrences of components to create attributes.                                                                               |
| [Angle](./geom_types#angle)                    | sharpEdge        | Edges with an angle between their polygons greater than sharpEdge will be considered sharp. If negative, smooth normals only. |
| [Boolean](./core_types#boolean)                | override         | If true, override existing normals, else only create normals on meshes without normals.                                       |
| [Boolean](./core_types#boolean)                | useAreaWeighting | If true, normal computation will be weighted using polygon areas.                                                             |

### createPointCloudKDTree

Create a KD-Tree from some point clouds occurrence, the given occurrences are deleted (even if they contains triangles) and the KD-Tree is represented in a new occurrence sub tree.

```python
algo.createPointCloudKDTree(occurrences, depth, addToScene=True) -> scene.Occurrence
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to process.               |
| [Int](./core_types#int)                        | depth       | Kd tree depth.                        |
| [Bool](./core_types#bool)                      | addToScene  | Add the KD-Tree to the current scene. |

Returns

| Type                                   | Name | Description              |
| -------------------------------------- | ---- | ------------------------ |
| [Occurrence](./scene_types#occurrence) | root | KD-Tree root occurrence. |

### createTangents

Create tangent attributes on tessellations.

```python
algo.createTangents(occurrences, uvChannel=0, override=True)
```

Parameters

| Type                                           | Name        | Description                                                                                |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to create attributes.                                            |
| [Int](./core_types#int)                        | uvChannel   | UV channel to use for the tangents creation.                                               |
| [Boolean](./core_types#boolean)                | override    | If true, override existing tangents, else only create tangents on meshes without tangents. |

### createVertexColorFromMaterials

Bake vertex colors using main material color. May duplicate some vertices.

```python
algo.createVertexColorFromMaterials(occurrenceList)
```

Parameters

| Type                                           | Name           | Description |
| ---------------------------------------------- | -------------- | ----------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrenceList |             |

### createVisibilityPatchesFromPatch

Create visibility patches from existing patches.

```python
algo.createVisibilityPatchesFromPatch(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### decimate

Reduce the polygon count by removing some vertices.

```python
algo.decimate(occurrences, surfacicTolerance=1, lineicTolerance=0.1, normalTolerance=5, texCoordTolerance=-1, releaseConstraintOnSmallArea=False)
```

Parameters

| Type                                           | Name                         | Description                                                                                                      |
| ---------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences                  | Occurrences of components to process.                                                                            |
| [Distance](./geom_types#distance)              | surfacicTolerance            | Maximum distance between surfacic vertices and resulting simplified surfaces.                                    |
| [Distance](./geom_types#distance)              | lineicTolerance              | Maximum distance between lineic vertices and resulting simplified lines.                                         |
| [Angle](./geom_types#angle)                    | normalTolerance              | Maximum angle between original normals and those interpolated on the simplified surface.                         |
| [Distance](./geom_types#distance)              | texCoordTolerance            | Maximum distance (in 3D space) between original texcoords and those interpolated on the simplified surface.      |
| [Boolean](./core_types#boolean)                | releaseConstraintOnSmallArea | If True, release constraint of normal and/or texcoord tolerance on small areas (according to surfacicTolerance). |

### decimateEdgeCollapse

> **Important:**
>
> This function is tagged as experimental.

Reduce the polygon count by collapsing some edges to obtain an simplified mesh.

```python
algo.decimateEdgeCollapse(occurrences, surfacicTolerance=0.1, boundaryWeight=1., normalWeight=1., UVWeight=1., sharpNormalWeight=1., UVSeamWeight=10., normalMaxDeviation=-1, forbidUVOverlaps=True, UVMaxDeviation=-1, UVSeamMaxDeviation=-1, protectTopology=False, qualityTradeoff=0)
```

Parameters

| Type                                                      | Name               | Description                                                                                                                                                        |
| --------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist)            | occurrences        | Occurrences of components to process.                                                                                                                              |
| [Distance](./geom_types#distance)                         | surfacicTolerance  | Error max between the simplified mesh et the old one.                                                                                                              |
| [Double](./core_types#double)                             | boundaryWeight     | Boundary importance during the decimation.                                                                                                                         |
| [Double](./core_types#double)                             | normalWeight       | Normal importance during the decimation.                                                                                                                           |
| [Double](./core_types#double)                             | UVWeight           | UV importance during the decimation.                                                                                                                               |
| [Double](./core_types#double)                             | sharpNormalWeight  | Importance of sharp edges during the decimation.                                                                                                                   |
| [Double](./core_types#double)                             | UVSeamWeight       | Importance of UV seams during the decimation.                                                                                                                      |
| [Angle](./geom_types#angle)                               | normalMaxDeviation | Constraint the normals deviation on decimated model.                                                                                                               |
| [Boolean](./core_types#boolean)                           | forbidUVOverlaps   | Forbid UV to fold over and overlap during the decimation.                                                                                                          |
| [Double](./core_types#double)                             | UVMaxDeviation     | Constraint the uv deviation on decimated model.                                                                                                                    |
| [Double](./core_types#double)                             | UVSeamMaxDeviation | Constraint the uv seams deviation on decimated model.                                                                                                              |
| [Boolean](./core_types#boolean)                           | protectTopology    | If false, the topology of the mesh can change and some edges can become non-manifold. But the visual quality will be better on model with complex topology.        |
| [QualitySpeedTradeoff](./algo_types#qualityspeedtradeoff) | qualityTradeoff    | For big models it is recommended to choose PreferSpeed tradeoff. In PreferSpeed mode, quadrics are computed only on position (and not on other vertex attributes). |

### decimatePointClouds

Decimate Point Cloud Occurrences according to tolerance .

```python
algo.decimatePointClouds(occurrences, tolerance=500)
```

Parameters

| Type                                           | Name        | Description                      |
| ---------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.     |
| [Distance](./geom_types#distance)              | tolerance   | Avarage distance between points. |

### decimateTarget

Reduce the polygon count by collapsing some edges to obtain a target triangle count (iterative version that use less memory).

```python
algo.decimateTarget(occurrences, targetStrategy, UVImportance=0, protectTopology=False, iterativeThreshold=5000000, processMeshIndependently=False, maxQuadricAge=-1)
```

Parameters

| Type                                                            | Name                     | Description                                                                                                                            |
| --------------------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                  | occurrences              | List of occurrences to process.                                                                                                        |
| [DecimateOptionsSelector](./algo_types#decimateoptionsselector) | targetStrategy           | Select between targetCount or ratio to define the number of triangles left after the decimation process.                               |
| [UVImportanceEnum](./algo_types#uvimportanceenum)               | UVImportance             | Select importance of texture coordinates.                                                                                              |
| [Boolean](./core_types#boolean)                                 | protectTopology          | If False, the topology of the mesh can change and some edges can become non-manifold.                                                  |
| [ULong](./core_types#ulong)                                     | iterativeThreshold       | Number of triangles above which the iterative algorithm is used to limit the memory usage (disabled if processMeshIndependently=True). |
| [Boolean](./core_types#boolean)                                 | processMeshIndependently | If true, each mesh will be processed independently and the triangleCount or ratio will apply by mesh (disable iterative method).       |
| [Int](./core_types#int)                                         | maxQuadricAge            | If >0, define the maximum memory (number of collapse) of a vertex before a new evaluation of its quadric.                              |

### deleteAttribute

Delete attribute on a tessellated mesh.

```python
algo.deleteAttribute(occurrence, type)
```

Parameters

| Type                                        | Name       | Description                          |
| ------------------------------------------- | ---------- | ------------------------------------ |
| [Occurrence](./scene_types#occurrence)      | occurrence | Occurrence to delete attribute from. |
| [AttributeType](./algo_types#attributetype) | type       | Attribute type.                      |

### deleteBRepShapes

Delete BRep representation on parts.

```python
algo.deleteBRepShapes(occurrences, onlyTessellated=True)
```

Parameters

| Type                                           | Name            | Description                                                                |
| ---------------------------------------------- | --------------- | -------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences     | Occurrences of components to process.                                      |
| [Boolean](./core_types#boolean)                | onlyTessellated | If True, delete only BRep represensation on part with a tessellated shape. |

### deleteFreeVertices

Delete all free vertices of the mesh of given parts.

```python
algo.deleteFreeVertices(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### deleteLines

Delete all free line of the mesh of given parts.

```python
algo.deleteLines(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### deleteNormals

Remove normal attributes on tessellations.

```python
algo.deleteNormals(occurrences)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to delete. |

### deletePatches

Delete patches attributes on tessellations.

```python
algo.deletePatches(occurrences, keepOnePatchByMaterial=True)
```

Parameters

| Type                                           | Name                   | Description                                                                                                         |
| ---------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences            | Occurrences of components to process.                                                                               |
| [Boolean](./core_types#boolean)                | keepOnePatchByMaterial | If set, one patch by material will be kept, else all patches will be deleted and materials on patches will be lost. |

### deletePolygons

Delete all polygons of the mesh of given parts.

```python
algo.deletePolygons(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### deleteTangents

Remove tangent attributes on tessellations.

```python
algo.deleteTangents(occurrences)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to delete. |

### deleteTextureCoordinates

Delete texture coordinates on tessellations.

```python
algo.deleteTextureCoordinates(occurrences, channel=-1)
```

Parameters

| Type                                           | Name        | Description                                                         |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process.                               |
| [Int](./core_types#int)                        | channel     | Choose Texture coordinates channel to delete (-1 for all channels). |

### deleteVisibilityPatches

Delete the visibility patches of given occurrences.

```python
algo.deleteVisibilityPatches(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

### evalDecimateErrorForTarget

Returns the max error to set to reach a given target.

```python
algo.evalDecimateErrorForTarget(occurrences, TargetStrategy, boundaryWeight=1., normalWeight=1., UVWeight=1., sharpNormalWeight=1., UVSeamWeight=10., forbidUVFoldovers=True, protectTopology=False) -> core.Double
```

Parameters

| Type                                                            | Name              | Description                                                                                                                                                            |
| --------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                  | occurrences       | List of occurrences to process.                                                                                                                                        |
| [DecimateOptionsSelector](./algo_types#decimateoptionsselector) | TargetStrategy    | Select between targetCount or ratio to define the number of triangles left after the decimation process.                                                               |
| [Double](./core_types#double)                                   | boundaryWeight    | Defines how important the edges defining the mesh boundaries (free edges) are during the decimation process, to preserve them from distortion.                         |
| [Double](./core_types#double)                                   | normalWeight      | Defines how important vertex normals are during the decimation process, to preserve the smoothing of the mesh from being damaged.                                      |
| [Double](./core_types#double)                                   | UVWeight          | Defines how important UVs (texture coordinates) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs).      |
| [Double](./core_types#double)                                   | sharpNormalWeight | Defines how important sharp edges (or hard edges) are during the decimation process, to preserve them from being distorted.                                            |
| [Double](./core_types#double)                                   | UVSeamWeight      | Defines how important UV seams (UV islands contours) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs). |
| [Boolean](./core_types#boolean)                                 | forbidUVFoldovers | Forbids UVs to fold over and overlap each other during the decimation.                                                                                                 |
| [Boolean](./core_types#boolean)                                 | protectTopology   | If False, the topology of the mesh can change and some edges can become non-manifold; but the visual quality will be better on model with complex topology.            |

Returns

| Type                          | Name     | Description                                                  |
| ----------------------------- | -------- | ------------------------------------------------------------ |
| [Double](./core_types#double) | errorMax | Max error that can be used in decimateEdgeCollapse function. |

### extractNeutralAxis

Extract neutral axis from tessellations.

```python
algo.extractNeutralAxis(occurrences, maxDiameter=100, removeOriginalMesh=True)
```

Parameters

| Type                                           | Name               | Description                                                  |
| ---------------------------------------------- | ------------------ | ------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Occurrences of components to process.                        |
| [Distance](./geom_types#distance)              | maxDiameter        | Maximum diameter of beams.                                   |
| [Boolean](./core_types#boolean)                | removeOriginalMesh | Remove or not the original mesh at the end of the algorithm. |

### filletMesh

> **Important:**
>
> This function is tagged as experimental.

Fillet a mesh according to its Lines of Interest.

```python
algo.filletMesh(occurrences, value, filletingMode=0, subdivisionNb=0, createFlatChamfer=False, material=None, uvChannel=-1)
```

Parameters

| Type                                           | Name              | Description                                                                                    |
| ---------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences       | Input occurrences.                                                                             |
| [Double](./core_types#double)                  | value             | Value (mm).                                                                                    |
| [FilletingMode](./algo_types#filletingmode)    | filletingMode     | Filleting mode.                                                                                |
| [Int](./core_types#int)                        | subdivisionNb     | Number of subdivision.                                                                         |
| [Boolean](./core_types#boolean)                | createFlatChamfer | If there is 0 subdivision, should the fillet be a planar flat chamfer?.                        |
| [Material](./material_types#material)          | material          | Material to apply to created fillets. Default: use a random neighbor material.                 |
| [Int](./core_types#int)                        | uvChannel         | UV Channel for the created fillet polygons. Defaults: Use an existing channel if there is one. |

### filterHiddenPolygons

Remove hidden polygons using voxels and cavities.

```python
algo.filterHiddenPolygons(occurrences, voxelSize=50)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [Distance](./geom_types#distance)              | voxelSize   | Size of voxels.              |

### filterMeshVertexColors

Smooth mesh vertex colors by applying to adjacent vertices a combination of different Gaussian filters for feature preservation.

```python
algo.filterMeshVertexColors(occurrences, sigmaPos=5.0, sigmaValue=0.2, sigmaNormal=15.0)
```

Parameters

| Type                                           | Name        | Description                                                                                                 |
| ---------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Mesh occurrences the filter must be applied on.                                                             |
| [Double](./core_types#double)                  | sigmaPos    | Variance of the Gaussian filter applied to distances between adjacent vertex positions.                     |
| [Double](./core_types#double)                  | sigmaValue  | Variance of the Gaussian filter applied to differences between adjacent vertex colors (in \[0, 1]).         |
| [Double](./core_types#double)                  | sigmaNormal | Variance of the Gaussian filter applied to angular differences between adjacent vertex normals (in degree). |

### findBestPivotBetweenOccurrences

Try to compute the pivot point between 2 sets of occurrences.

```python
algo.findBestPivotBetweenOccurrences(assembly1, assembly2, precision=-1) -> geom.Matrix4
```

Parameters

| Type                                           | Name      | Description                                          |
| ---------------------------------------------- | --------- | ---------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | assembly1 | Set occurrences 1.                                   |
| [OccurrenceList](./scene_types#occurrencelist) | assembly2 | Set occurrences 2.                                   |
| [Double](./core_types#double)                  | precision | Precision used to determine if elements are similar. |

Returns

| Type                            | Name   | Description                                                                  |
| ------------------------------- | ------ | ---------------------------------------------------------------------------- |
| [Matrix4](./geom_types#matrix4) | matrix | Best pivot between the two assembly. If impossible, return the null Matrix4. |

### getAllAxisFromCADModel

Return all the main axis contained in the CAD models given.

```python
algo.getAllAxisFromCADModel(occurrences) -> scene.OccurrenceList, geom.Matrix4ListList
```

Parameters

| Type                                           | Name        | Description                         |
| ---------------------------------------------- | ----------- | ----------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to check. |

Returns

| Type                                            | Name        | Description                              |
| ----------------------------------------------- | ----------- | ---------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)  | occurrences | Occurrence part that contained CAD part. |
| [Matrix4ListList](./geom_types#matrix4listlist) | axis        | The main axis from the CAD models.       |

### getMeshVertexColors

Returns arrays containing the vertex colors of all meshes being children of the provided occurrence list.

```python
algo.getMeshVertexColors(occurrences) -> core.ColorAlphaListList
```

Parameters

| Type                                           | Name        | Description                                 |
| ---------------------------------------------- | ----------- | ------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences from which meshes are gathered. |

Returns

| Type                                                  | Name         | Description                                      |
| ----------------------------------------------------- | ------------ | ------------------------------------------------ |
| [ColorAlphaListList](./core_types#coloralphalistlist) | vertexColors | List of vertex color arrays for each occurrence. |

### getOptimalTextureResolution

> **Important:**
>
> This function is tagged as experimental.

Returns the optimal resolution based on a number of texels per 3D space units (e.g : mm).

```python
algo.getOptimalTextureResolution(occurrences, texelPerMm=2) -> core.Int
```

Parameters

| Type                                           | Name        | Description                                                 |
| ---------------------------------------------- | ----------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences on which to compute optimal texture resolution. |
| [Double](./core_types#double)                  | texelPerMm  | Number of texel per millimeter in a 3D space.               |

Returns

| Type                    | Name              | Description |
| ----------------------- | ----------------- | ----------- |
| [Int](./core_types#int) | textureResolution |             |

### getTessellations

Returns all the tessellation of the given occurrences (only returns editable mesh, see algo.toEditableMesh).

```python
algo.getTessellations(occurrences) -> polygonal.TessellationList
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

Returns

| Type                                                   | Name          | Description                                    |
| ------------------------------------------------------ | ------------- | ---------------------------------------------- |
| [TessellationList](./polygonal_types#tessellationlist) | tessellations | All the tessellation of the given occurrences. |

### getUV3dRatio

> **Important:**
>
> This function is tagged as experimental.

Returns the ratio of size between UV and 3D (max value, actually at the 90th percentil).

```python
algo.getUV3dRatio(occurrences) -> core.Double
```

Parameters

| Type                                           | Name        | Description                                                 |
| ---------------------------------------------- | ----------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences on which to compute optimal texture resolution. |

Returns

| Type                          | Name  | Description                                                                                      |
| ----------------------------- | ----- | ------------------------------------------------------------------------------------------------ |
| [Double](./core_types#double) | ratio | Equivalent size of 1 in the UV space in 3D (e.g. Ratio/resolution give the 3D size of a texel)). |

### getVisibilityStats

Returns the visibility statistics for some occurrences.

```python
algo.getVisibilityStats(occurrences) -> core.Int, core.Int
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

Returns

| Type                    | Name              | Description |
| ----------------------- | ----------------- | ----------- |
| [Int](./core_types#int) | visibleCountFront |             |
| [Int](./core_types#int) | visibleCountBack  |             |

### getVisualComparisonFootprint

Compute the visual footprint of the difference between two sets of occurrences.

```python
algo.getVisualComparisonFootprint(originalOccurrences, comparedOccurrences, resolution=512, viewpointCount=256, threshold=0.2, onHemisphereOnly=False) -> core.Double
```

Parameters

| Type                                           | Name                | Description                                                                   |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | originalOccurrences | Set of occurrences representing the ground truth.                             |
| [OccurrenceList](./scene_types#occurrencelist) | comparedOccurrences | Set of occurrences to compare with the ground truth.                          |
| [Int](./core_types#int)                        | resolution          | Resolution of the viewer.                                                     |
| [Int](./core_types#int)                        | viewpointCount      | Number of viewpoints generated around the bounding sphere of all occurrences. |
| [Double](./core_types#double)                  | threshold           | Tolerance for pixel comparison.                                               |
| [Bool](./core_types#bool)                      | onHemisphereOnly    | Create viewpoints only in the Y+ hemisphere of the bounding sphere.           |

Returns

| Type                          | Name      | Description                                    |
| ----------------------------- | --------- | ---------------------------------------------- |
| [Double](./core_types#double) | footprint | The visual footprint error in mm (worldspace). |

### identifyLinesOfInterest

Identify LoI according to given criteria. It will create a new LoI attribute on the mesh that can be used afterward by some functions.

```python
algo.identifyLinesOfInterest(occurrences, normal=False, uvs=False, uvChannels=None, border=False, patches=False, nman=False)
```

Parameters

| Type                                           | Name        | Description                                                                                    |
| ---------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process.                                                          |
| [Boolean](./core_types#boolean)                | normal      | Add LoI on sharp normals.                                                                      |
| [Boolean](./core_types#boolean)                | uvs         | Add LoI on UV seams.                                                                           |
| [IntList](./core_types#intlist)                | uvChannels  | If empty and uvs=true, add LoI using all UV channels, else only channel specified in the list. |
| [Boolean](./core_types#boolean)                | border      | Add LoI on boundary edges.                                                                     |
| [Boolean](./core_types#boolean)                | patches     | Add LoI on submesh borders.                                                                    |
| [Boolean](./core_types#boolean)                | nman        | Add LoI on non-manifolds edges.                                                                |

### identifyPatches

Create patches (submeshes) on meshes (needed by some functions).

```python
algo.identifyPatches(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useBoundaryFilter=True, useNonManifoldFilter=True, useLineEdgeFilter=True, useQuadLineFilter=False)
```

Parameters

| Type                                           | Name                 | Description                                                                                 |
| ---------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Occurrences of components to process.                                                       |
| [Boolean](./core_types#boolean)                | useAttributesFilter  | Filters by attributes.                                                                      |
| [Angle](./geom_types#angle)                    | sharpAngleFilter     | Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. |
| [Boolean](./core_types#boolean)                | useBoundaryFilter    | Filters by boundaries.                                                                      |
| [Boolean](./core_types#boolean)                | useNonManifoldFilter | Filters by manifold-ness.                                                                   |
| [Boolean](./core_types#boolean)                | useLineEdgeFilter    | Filters by edge.                                                                            |
| [Boolean](./core_types#boolean)                | useQuadLineFilter    | Filters by quad lines.                                                                      |

### identifySharpEdges

> **Important:**
>
> This function is tagged as experimental.

Mark as Lines Of Interest the sharp edges .

```python
algo.identifySharpEdges(occurrences, minSharpAngle=90, maxSharpAngle=180, convexity=2, onlyExplicitSharp=False)
```

Parameters

| Type                                            | Name              | Description                                                                                               |
| ----------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)  | occurrences       | Input occurrences.                                                                                        |
| [Angle](./geom_types#angle)                     | minSharpAngle     | The angle between the normals - all edges sharpest than this will be filleted.                            |
| [Angle](./geom_types#angle)                     | maxSharpAngle     | All edges sharpest than this won't be filleted.                                                           |
| [ConvexityFilter](./algo_types#convexityfilter) | convexity         | Fillet sharp edges that are convex, concave or both.                                                      |
| [Boolean](./core_types#boolean)                 | onlyExplicitSharp | If toggled, if the explicit normals of an edge says the transition is smooth, the edge won't be selected. |

### invertTangents

Invert tangents orientation (usefull to switch between right-handed/left-handed normal maps.

```python
algo.invertTangents(occurrences, invertW=True)
```

Parameters

| Type                                           | Name        | Description                                                                      |
| ---------------------------------------------- | ----------- | -------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to invert tangents on.                                               |
| [Boolean](./core_types#boolean)                | invertW     | If true, only inverse the w components of tangent. Else, inverse the xyz vector. |

### lineToTexture

> **Important:**
>
> This function is tagged as experimental.

Generate a textured quadrangle over an existing mesh of coplanar lines.

```python
algo.lineToTexture(lines, useColor, resolution=512, thickness=5)
```

Parameters

| Type                                           | Name       | Description                           |
| ---------------------------------------------- | ---------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | lines      | Lines to select.                      |
| [UseColorOption](./algo_types#usecoloroption)  | useColor   | Set color policy.                     |
| [Int](./core_types#int)                        | resolution | Texture resolution.                   |
| [Int](./core_types#int)                        | thickness  | The thickness of the lines in pixels. |

### listFeatures

List features from tessellations.

```python
algo.listFeatures(occurrences, throughHoles=True, blindHoles=False, maxDiameter=-1) -> algo.OccurrenceFeaturesList
```

Parameters

| Type                                           | Name         | Description                                                    |
| ---------------------------------------------- | ------------ | -------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences  | Occurrences of components to process.                          |
| [Boolean](./core_types#boolean)                | throughHoles | List through holes.                                            |
| [Boolean](./core_types#boolean)                | blindHoles   | List blind holes.                                              |
| [Distance](./geom_types#distance)              | maxDiameter  | Maximum diameter of the holes to be list (-1=no max diameter). |

Returns

| Type                                                          | Name     | Description                     |
| ------------------------------------------------------------- | -------- | ------------------------------- |
| [OccurrenceFeaturesList](./algo_types#occurrencefeatureslist) | features | List of features by occurrence. |

### loopSubdivMesh

Apply Loop Subdivision on Triangle-only Mesh.

```python
algo.loopSubdivMesh(occurrences, depth=1)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |
| [Int](./core_types#int)                        | depth       | Subdivision depth.                    |

### mergeVertices

Merge near vertices according to the given distance.

```python
algo.mergeVertices(occurrences, maxDistance, mask)
```

Parameters

| Type                                                           | Name        | Description                                    |
| -------------------------------------------------------------- | ----------- | ---------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                 | occurrences | Occurrences of components to process.          |
| [Distance](./geom_types#distance)                              | maxDistance | Maximum distance between two vertex to merge.  |
| [TopologyCategoryMask](./polygonal_types#topologycategorymask) | mask        | Topological category of the vertices to merge. |

### meshBooleanOperation

> **Important:**
>
> This function is tagged as experimental.

Computes the boolean operation between the meshes of two occurrence lists.

```python
algo.meshBooleanOperation(occurrencesA, occurrencesB, operation) -> scene.Occurrence
```

Parameters

| Type                                                      | Name         | Description               |
| --------------------------------------------------------- | ------------ | ------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)            | occurrencesA | Occurrences A.            |
| [OccurrenceList](./scene_types#occurrencelist)            | occurrencesB | Occurrences B.            |
| [MeshBooleanOperation](./algo_types#meshbooleanoperation) | operation    | The operation to perform. |

Returns

| Type                                   | Name       | Description                          |
| -------------------------------------- | ---------- | ------------------------------------ |
| [Occurrence](./scene_types#occurrence) | occurrence | A new Occurrence bearing the result. |

### meshComparison

> **Important:**
>
> This function is tagged as experimental.

Compare two meshes.

```python
algo.meshComparison(mesh_1, mesh_2) -> geom.Distance
```

Parameters

| Type                                   | Name    | Description |
| -------------------------------------- | ------- | ----------- |
| [Occurrence](./scene_types#occurrence) | mesh\_1 |             |
| [Occurrence](./scene_types#occurrence) | mesh\_2 |             |

Returns

| Type                              | Name     | Description                 |
| --------------------------------- | -------- | --------------------------- |
| [Distance](./geom_types#distance) | distance | Disance between two meshes. |

### meshComparisonBatch

> **Important:**
>
> This function is tagged as experimental.

Compare each couple of meshes and returns the maximum for each couple.

```python
algo.meshComparisonBatch(meshes1, meshes2) -> geom.DistanceList
```

Parameters

| Type                                           | Name    | Description |
| ---------------------------------------------- | ------- | ----------- |
| [OccurrenceList](./scene_types#occurrencelist) | meshes1 |             |
| [OccurrenceList](./scene_types#occurrencelist) | meshes2 |             |

Returns

| Type                                      | Name      | Description                            |
| ----------------------------------------- | --------- | -------------------------------------- |
| [DistanceList](./geom_types#distancelist) | distances | Disance between each couple of meshes. |

### meshIntersections

> **Important:**
>
> This function is tagged as experimental.

Computes the list of polylines at the intersections of the meshes of two occurrence lists.

```python
algo.meshIntersections(occurrencesA, occurrencesB) -> geom.Point3ListList
```

Parameters

| Type                                           | Name         | Description    |
| ---------------------------------------------- | ------------ | -------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrencesA | Occurrences A. |
| [OccurrenceList](./scene_types#occurrencelist) | occurrencesB | Occurrences B. |

Returns

| Type                                          | Name          | Description        |
| --------------------------------------------- | ------------- | ------------------ |
| [Point3ListList](./geom_types#point3listlist) | intersections | The intersections. |

### noiseMesh

Apply noise to vertex positions along their normals.

```python
algo.noiseMesh(occurrences, maxAmplitude=1)
```

Parameters

| Type                                           | Name         | Description                                                |
| ---------------------------------------------- | ------------ | ---------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences  | Part occurrencess to noise.                                |
| [Distance](./geom_types#distance)              | maxAmplitude | Maximum distance between original vertex and noisy vertex. |

### optimizeCADLoops

Optimize CAD Face loops by merging useless loop edges.

```python
algo.optimizeCADLoops(occurrences)
```

Parameters

| Type                                           | Name        | Description                            |
| ---------------------------------------------- | ----------- | -------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to optimize. |

### optimizeForRendering

Optimize mesh for rendering (lossless, only reindexing).

```python
algo.optimizeForRendering(occurrences)
```

Parameters

| Type                                           | Name        | Description                            |
| ---------------------------------------------- | ----------- | -------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to optimize. |

### optimizeSubMeshes

Sort sub meshes by materials.

```python
algo.optimizeSubMeshes(occurrences)
```

Parameters

| Type                                           | Name        | Description                   |
| ---------------------------------------------- | ----------- | ----------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrencess to process. |

### optimizeTextureSize

> **Important:**
>
> This function is tagged as experimental.

Resizes scene textures based on a number of texels per 3D space units (e.g: mm).

```python
algo.optimizeTextureSize(root, texelPerMm=2)
```

Parameters

| Type                                   | Name       | Description                                    |
| -------------------------------------- | ---------- | ---------------------------------------------- |
| [Occurrence](./scene_types#occurrence) | root       | Root from which texture resizing will process. |
| [Double](./core_types#double)          | texelPerMm | Number of texel per millimeter in a 3D space.  |

### removeHoles

Remove some features from tessellations.

```python
algo.removeHoles(occurrences, throughHoles=True, blindHoles=False, surfacicHoles=False, maxDiameter=-1, fillWithMaterial=0)
```

Parameters

| Type                                           | Name             | Description                                                       |
| ---------------------------------------------- | ---------------- | ----------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences      | Occurrences of components to process.                             |
| [Boolean](./core_types#boolean)                | throughHoles     | Remove through holes.                                             |
| [Boolean](./core_types#boolean)                | blindHoles       | Remove blind holes.                                               |
| [Boolean](./core_types#boolean)                | surfacicHoles    | Remove surfacic holes.                                            |
| [Distance](./geom_types#distance)              | maxDiameter      | Maximum diameter of the holes to be removed (-1=no max diameter). |
| [Material](./material_types#material)          | fillWithMaterial | If set, the given material will be used to fill the holes.        |

### repairCAD

Repair CAD shapes, assemble faces, remove duplicated faces, optimize loops and repair topology.

```python
algo.repairCAD(occurrences, tolerance=0.1, orient=True)
```

Parameters

| Type                                           | Name        | Description                         |
| ---------------------------------------------- | ----------- | ----------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to clean. |
| [Distance](./geom_types#distance)              | tolerance   | Tolerance.                          |
| [Boolean](./core_types#boolean)                | orient      | If true reorient the model.         |

### segmentMesh

> **Important:**
>
> This function is tagged as experimental.

Segment Mesh into clusters guided by edge sharpnesses.

```python
algo.segmentMesh(occurrences, overwriteLoI=True)
```

Parameters

| Type                                           | Name         | Description                                                        |
| ---------------------------------------------- | ------------ | ------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences  | Occurrences of components to process.                              |
| [Boolean](./core_types#boolean)                | overwriteLoI | Overwrite the lines-of-interest parameters if true, else add them. |

### setFeatureComponentMaxIndex

Remap Index map of each FeatureComponent of selected occurrences.

```python
algo.setFeatureComponentMaxIndex(occurrences, maxIndex)
```

Parameters

| Type                                           | Name        | Description |
| ---------------------------------------------- | ----------- | ----------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences |             |
| [Int](./core_types#int)                        | maxIndex    |             |

### setMeshVertexColors

Specify vertex colors for all meshes being children of the provided occurrence list.

```python
algo.setMeshVertexColors(occurrences, vertexColors)
```

Parameters

| Type                                                  | Name         | Description                                      |
| ----------------------------------------------------- | ------------ | ------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist)        | occurrences  | Occurrences from which meshes are gathered.      |
| [ColorAlphaListList](./core_types#coloralphalistlist) | vertexColors | List of vertex color arrays for each occurrence. |

### smoothMesh

```python
algo.smoothMesh(occurrences, mode, maxIterations=100, lockSignificantEdges=True)
```

Parameters

| Type                                           | Name                 | Description                                                                        |
| ---------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Occurrences of components to process.                                              |
| [CostEvaluation](./algo_types#costevaluation)  | mode                 | Computation of cost.                                                               |
| [Int](./core_types#int)                        | maxIterations        | Maximum number of swapping iteration.                                              |
| [Boolean](./core_types#boolean)                | lockSignificantEdges | Forbid to swap significant edges (e.g. UV seams, sharp edges, patch borders, ...). |

### splitUVForAtlas

```python
algo.splitUVForAtlas(occurrences)
```

Parameters

| Type                                           | Name        | Description        |
| ---------------------------------------------- | ----------- | ------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Input occurrences. |

### sweep

> **Important:**
>
> This function is tagged as experimental.

Extrudes a circular section along an underlying polyline (curve).

```python
algo.sweep(occurrences, radius=1, sides=10, createNormals=True, keepLines=False, generateUV=True)
```

Parameters

| Type                                           | Name          | Description                           |
| ---------------------------------------------- | ------------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences   | Occurrences of components to check.   |
| [Distance](./geom_types#distance)              | radius        | Radius of cylinders.                  |
| [Int](./core_types#int)                        | sides         | Number of points to create cylinders. |
| [Boolean](./core_types#boolean)                | createNormals |                                       |
| [Boolean](./core_types#boolean)                | keepLines     |                                       |
| [Boolean](./core_types#boolean)                | generateUV    |                                       |

### tessellate

Create a tessellated representation from a CAD representation for each given part.

```python
algo.tessellate(occurrences, maxSag=0.2, maxLength=-1, maxAngle=-1, createNormals=True, uvMode=0, uvChannel=1, uvPadding=0.0, createTangents=False, createFreeEdges=False, keepBRepShape=True, overrideExistingTessellation=False)
```

Parameters

| Type                                              | Name                         | Description                                                                                                                                    |
| ------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences                  | Occurrences of components to tessellate.                                                                                                       |
| [Distance](./geom_types#distance)                 | maxSag                       | Maximum distance between the geometry and the tessellation.                                                                                    |
| [Distance](./geom_types#distance)                 | maxLength                    | Maximum length of elements.                                                                                                                    |
| [Angle](./geom_types#angle)                       | maxAngle                     | Maximum angle between normals of two adjacent elements.                                                                                        |
| [Boolean](./core_types#boolean)                   | createNormals                | If true, normals will be generated.                                                                                                            |
| [UVGenerationMode](./algo_types#uvgenerationmode) | uvMode                       | Select the texture coordinates generation mode.                                                                                                |
| [Int](./core_types#int)                           | uvChannel                    | The UV channel of the generated texture coordinates (if any).                                                                                  |
| [Double](./core_types#double)                     | uvPadding                    | The UV padding between UV island in UV coordinate space (between 0-1). This parameter is handled as an heuristic so it might not be respected. |
| [Boolean](./core_types#boolean)                   | createTangents               | If true, tangents will be generated.                                                                                                           |
| [Boolean](./core_types#boolean)                   | createFreeEdges              | If true, free edges will be created for each patch borders.                                                                                    |
| [Boolean](./core_types#boolean)                   | keepBRepShape                | If true, BRep shapes will be kept for Back to Brep or Retessellate.                                                                            |
| [Boolean](./core_types#boolean)                   | overrideExistingTessellation | If true, already tessellated parts will be re-tessellated.                                                                                     |

### tessellatePointClouds

> **Important:**
>
> This function is tagged as experimental.

Tessellate point clouds to replace the geometry with a polygonal connect mesh.

```python
algo.tessellatePointClouds(occurrences, kNeighbors=20, keepPoints=False, colorize=True)
```

Parameters

| Type                                           | Name        | Description                                                        |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences |                                                                    |
| [Int](./core_types#int)                        | kNeighbors  | The number of neighbor points used to compute normals.             |
| [Boolean](./core_types#boolean)                | keepPoints  | Keep points after meshing if enabled.                              |
| [Boolean](./core_types#boolean)                | colorize    | If enabled, vertex colors will be generated on the resulting mesh. |

### tessellateRelativelyToAABB

Creates a tessellated representation from a CAD representation for each given part. It multiplies the length of the diagonal of the bounding box by the sagRatio. If the output value is above maxSag, then maxSag is used as tessellation value. Else if the output value is below maxSag, it is used as tessellation value.

```python
algo.tessellateRelativelyToAABB(occurrences, maxSag=0.2, sagRatio=0.001, maxLength=-1, maxAngle=-1, createNormals=True, uvMode=0, uvChannel=1, uvPadding=0.0, createTangents=False, createFreeEdges=False, keepBRepShape=True, overrideExistingTessellation=False)
```

Parameters

| Type                                              | Name                         | Description                                                                                                                                    |
| ------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences                  | Occurrences of components to tessellate.                                                                                                       |
| [Distance](./geom_types#distance)                 | maxSag                       | Maximum distance between the geometry and the tessellation.                                                                                    |
| [Double](./core_types#double)                     | sagRatio                     | Maximum ratio distance between the geometry and the tessellation.                                                                              |
| [Distance](./geom_types#distance)                 | maxLength                    | Maximum length of elements.                                                                                                                    |
| [Angle](./geom_types#angle)                       | maxAngle                     | Maximum angle between normals of two adjacent elements.                                                                                        |
| [Boolean](./core_types#boolean)                   | createNormals                | If true, normals will be generated.                                                                                                            |
| [UVGenerationMode](./algo_types#uvgenerationmode) | uvMode                       | Select the texture coordinates generation mode.                                                                                                |
| [Int](./core_types#int)                           | uvChannel                    | The UV channel of the generated texture coordinates (if any).                                                                                  |
| [Double](./core_types#double)                     | uvPadding                    | The UV padding between UV island in UV coordinate space (between 0-1). This parameter is handled as an heuristic so it might not be respected. |
| [Boolean](./core_types#boolean)                   | createTangents               | If true, tangents will be generated.                                                                                                           |
| [Boolean](./core_types#boolean)                   | createFreeEdges              | If true, free edges will be created for each patch borders.                                                                                    |
| [Boolean](./core_types#boolean)                   | keepBRepShape                | If true, BRep shapes will be kept for Back to Brep or Retessellate.                                                                            |
| [Boolean](./core_types#boolean)                   | overrideExistingTessellation | If true, already tessellated parts will be re-tessellated.                                                                                     |

### transferUV

Transfer UV from a mesh to another mesh.

```python
algo.transferUV(source, destination, sourceChannel=0, destinationChannel=0, tolerance=0.001)
```

Parameters

| Type                                   | Name               | Description                               |
| -------------------------------------- | ------------------ | ----------------------------------------- |
| [Occurrence](./scene_types#occurrence) | source             | Occurrence of the source mesh.            |
| [Occurrence](./scene_types#occurrence) | destination        | Occurrence of the destination mesh.       |
| [Int](./core_types#int)                | sourceChannel      | Source UV channel to bake.                |
| [Int](./core_types#int)                | destinationChannel | Destination UV channel to bake to.        |
| [Distance](./geom_types#distance)      | tolerance          | Geometric tolerance for point projection. |

### voxelizePointClouds

Explode point clouds to voxels.

```python
algo.voxelizePointClouds(occurrences, voxelSize=500)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [Distance](./geom_types#distance)              | voxelSize   | Size of voxels.              |

## Baking

### bakeAOMap

Ray tracing based ambient occlusion computation.

```python
algo.bakeAOMap(sessionId, samples=32, bentNormals=False, defaultColor=core.ColorAlpha(0, 0, 0, 0)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                                                                                   |
| ------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                                                                            |
| [Int](./core_types#int)                     | samples      | Number of rays cast for occlusion detection (must be a power of two in the range \[8, 4096]). |
| [Boolean](./core_types#boolean)             | bentNormals  | If true, bent normals are baked in addition to AO.                                            |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels.                                                        |

Returns

| Type                                    | Name   | Description                                                                                                                                                                                                                 |
| --------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps: one per destination if shareMaps is false, two if bentNormals is true. In that case, maps are returned in an interleaved manner: \[destOccAO0, destOccBentNorm0, destOccAO1, destOccBentNorm1, ...]). |

See also:

* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeDepthMap

Depth map baking.

```python
algo.bakeDepthMap(sessionId, normalizeValue=1.0, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name           | Description                                                |
| ------------------------------------------- | -------------- | ---------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId      | Baking session Id.                                         |
| [Double](./core_types#double)               | normalizeValue | Divisor applied to depth values before storage to texture. |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor   | Color used for filling unbaked texels.                     |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeDiffuseMap

Diffuse map baking.

```python
algo.bakeDiffuseMap(sessionId, withTransparency=False, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name             | Description                                                   |
| ------------------------------------------- | ---------------- | ------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId        | Baking session Id.                                            |
| [Boolean](./core_types#boolean)             | withTransparency | If true, surface transparency is stored in the alpha channel. |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor     | Color used for filling unbaked texels.                        |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeDisplacementMap

Displacement map baking.

```python
algo.bakeDisplacementMap(sessionId, normalize=True, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                                            |
| ------------------------------------------- | ------------ | ------------------------------------------------------ |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                                     |
| [Boolean](./core_types#boolean)             | normalize    | If true, displacement vectors are remapped to \[-1,1]. |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels.                 |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeEmissiveMap

Emissive map baking.

```python
algo.bakeEmissiveMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeFeatureMap

Feature map baking.

```python
algo.bakeFeatureMap(sessionId, defaultColor=core.ColorAlpha(1, 1, 1, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeMaterialAOMap

AO baking from the source material.

```python
algo.bakeMaterialAOMap(sessionId, defaultColor=core.ColorAlpha(1, 1, 1, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeMaterialIdMap

Color map baking based on source material Ids.

```python
algo.bakeMaterialIdMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeMaterialPropertyMap

Baking of custom material properties.

```python
algo.bakeMaterialPropertyMap(sessionId, propertyName=String(), nComponents=3, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                                                                    |
| ------------------------------------------- | ------------ | ------------------------------------------------------------------------------ |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                                                             |
| [String](./core_types#string)               | propertyName | Name of the material property to bake (must be a color, a coeff or a texture). |
| [Int](./core_types#int)                     | nComponents  | Expected number of components per pixel for the resulting maps.                |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels.                                         |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeMetallicMap

Metallic map baking.

```python
algo.bakeMetallicMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeNormalMap

Normal map baking.

```python
algo.bakeNormalMap(sessionId, sourceSpace=2, destinationSpace=2, defaultColor=core.ColorAlpha(1, 1, 1, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name             | Description                                                |
| ------------------------------------------- | ---------------- | ---------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId        | Baking session Id.                                         |
| [Space](./algo_types#space)                 | sourceSpace      | The space in which source normal vectors are defined.      |
| [Space](./algo_types#space)                 | destinationSpace | The space in which destination normal vectors are defined. |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor     | Color used for filling unbaked texels.                     |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeOccurrencePropertyMap

Occurrence property map baking.

```python
algo.bakeOccurrencePropertyMap(sessionId, propertyName=String(), nComponents=3, defaultColor=core.ColorAlpha(1, 1, 1, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                                                                      |
| ------------------------------------------- | ------------ | -------------------------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                                                               |
| [String](./core_types#string)               | propertyName | Name of the occurrence property to bake (must be a color, a coeff or a texture). |
| [Int](./core_types#int)                     | nComponents  | Expected number of components per pixel for the resulting maps.                  |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels.                                           |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeOpacityMap

Opacity map baking.

```python
algo.bakeOpacityMap(sessionId, defaultColor=core.ColorAlpha(1, 1, 1, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakePartIdMap

Color map baking based on the source part Ids.

```python
algo.bakePartIdMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakePositionMap

Position map baking.

```python
algo.bakePositionMap(sessionId, local=False, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                                                           |
| ------------------------------------------- | ------------ | --------------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                                                    |
| [Boolean](./core_types#boolean)             | local        | If true, position is baked in local space, otherwise in global space. |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels.                                |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeRoughnessMap

Roughness map baking.

```python
algo.bakeRoughnessMap(sessionId, defaultColor=core.ColorAlpha(0.5, 0.5, 0.5, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeSpecularMap

Specular map baking.

```python
algo.bakeSpecularMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeUVMap

Source UV coordinates baking.

```python
algo.bakeUVMap(sessionId, uvChannel=0, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [Int](./core_types#int)                     | uvChannel    | The channel from which UVs are baked.  |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeValidityMap

Validity map baking, distinguishing baked pixels from non baked pixels.

```python
algo.bakeValidityMap(sessionId, validValue=1., invalidValue=0.) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [Double](./core_types#double)               | validValue   | Value used for filling baked texels.   |
| [Double](./core_types#double)               | invalidValue | Value used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### bakeVertexColorMap

Vertex color map baking.

```python
algo.bakeVertexColorMap(sessionId, defaultColor=core.ColorAlpha(0, 0, 0, 1)) -> material.ImageList
```

Parameters

| Type                                        | Name         | Description                            |
| ------------------------------------------- | ------------ | -------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_types#coloralpha)       | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                                    | Name   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| [ImageList](./material_types#imagelist) | images | Resulting baked maps (one per destination if shareMaps is false). |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### beginBakingSession

Start a new baking session. This must be called prior to any of the bake\*Something\*Map function.

```python
algo.beginBakingSession(destinationOccurrences, sourceOccurrences=[], uvChannel=0, resolution=1024, rayOffset=0, rayMaxDist=-1, opacityThreshold=-1, useCurrentPosition=False, shareMaps=True, sourceElements=0) -> algo.BakingSession
```

Parameters

| Type                                           | Name                   | Description                                                                                                         |
| ---------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | destinationOccurrences | Occurrences of the meshes where to store the baked map.                                                             |
| [OccurrenceList](./scene_types#occurrencelist) | sourceOccurrences      | Occurrences of components from which to bake maps (if empty use destination).                                       |
| [Int](./core_types#int)                        | uvChannel              | UV channel of destOccurrence to use for the map generation.                                                         |
| [Int](./core_types#int)                        | resolution             | Map resolution.                                                                                                     |
| [Distance](./geom_types#distance)              | rayOffset              | Offset from source mesh.                                                                                            |
| [Distance](./geom_types#distance)              | rayMaxDist             | Maximum search distance for ray tracing during baking computation (-1 means infinity).                              |
| [Coeff](./core_types#coeff)                    | opacityThreshold       | If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. |
| [Boolean](./core_types#boolean)                | useCurrentPosition     | Use the current position instead of the T-Pose of the input occurrence.                                             |
| [Boolean](./core_types#boolean)                | shareMaps              | If true, all the destinationOccurrences will share the same maps.                                                   |
| [ElementFilter](./algo_types#elementfilter)    | sourceElements         | Defines the type of elements from which baking is performed (polygons or points).                                   |

Returns

| Type                                        | Name          | Description                        |
| ------------------------------------------- | ------------- | ---------------------------------- |
| [BakingSession](./algo_types#bakingsession) | bakingsession | Created baking session identifier. |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### beginVertexBakingSession

Start a new baking session. This must be called prior to any of the bake\*Something\*Map function.

```python
algo.beginVertexBakingSession(destinationOccurrences, sourceOccurrences=[], rayOffset=0, rayMaxDist=-1, opacityThreshold=-1, useCurrentPosition=False, sourceElements=0) -> algo.BakingSession
```

Parameters

| Type                                           | Name                   | Description                                                                                                         |
| ---------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | destinationOccurrences | Occurrences of the meshes where to store the baked map.                                                             |
| [OccurrenceList](./scene_types#occurrencelist) | sourceOccurrences      | Occurrences of components from which to bake maps (if empty use destination).                                       |
| [Distance](./geom_types#distance)              | rayOffset              | Offset from source mesh.                                                                                            |
| [Distance](./geom_types#distance)              | rayMaxDist             | Maximum search distance for ray tracing during baking computation (-1 means infinity).                              |
| [Coeff](./core_types#coeff)                    | opacityThreshold       | If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. |
| [Boolean](./core_types#boolean)                | useCurrentPosition     | Use the current position instead of the T-Pose of the input occurrence.                                             |
| [ElementFilter](./algo_types#elementfilter)    | sourceElements         | Defines the type of elements from which baking is performed (polygons or points).                                   |

Returns

| Type                                        | Name          | Description                        |
| ------------------------------------------- | ------------- | ---------------------------------- |
| [BakingSession](./algo_types#bakingsession) | bakingsession | Created baking session identifier. |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### combineMaterials

Combine materials found on occurrences subtrees into one baked material and assign it to part occurrences.

```python
algo.combineMaterials(occurrences, bakingOptions, overrideExistingUVs=True, singularizeOnAO=False)
```

Parameters

| Type                                           | Name                | Description                                                                                                              |
| ---------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Root occurrences to process.                                                                                             |
| [BakeOption](./algo_types#bakeoption)          | bakingOptions       | Baking options.                                                                                                          |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If true, use axis-aligned bounding box mapping to regenerate new UVs, instead of repacking existing ones from channel 0. |
| [Boolean](./core_types#boolean)                | singularizeOnAO     | If true, singularize all instances in the selected subtree if we want to bake AO in the texture.                         |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### endBakingSession

End and destroy an existing baking session.

```python
algo.endBakingSession(sessionId)
```

Parameters

| Type                                        | Name      | Description                      |
| ------------------------------------------- | --------- | -------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId | Id of the baking session to end. |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### fetchBakedMap

Returns information about one texel of a baked map (occurrence, polygon ID, parametric coordinates, material ID). Must be called inside a (begin/end)BakingSession block.

```python
algo.fetchBakedMap(sessionId, x, y, mapId=0) -> algo.BakedValue
```

Parameters

| Type                                        | Name      | Description                                       |
| ------------------------------------------- | --------- | ------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId | Baking session Id.                                |
| [UInt](./core_types#uint)                   | x         | X coordinate of the map pixel to fetch.           |
| [UInt](./core_types#uint)                   | y         | Y coordinate of the map pixel to fetch.           |
| [UInt](./core_types#uint)                   | mapId     | Id of the map to fetch, if several are available. |

Returns

| Type                                  | Name        | Description |
| ------------------------------------- | ----------- | ----------- |
| [BakedValue](./algo_types#bakedvalue) | bakingPixel |             |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### fetchBakedVertex

Returns information about a baked vertex (occurrence, polygon ID, parametric coordinates, material ID). Must be called inside a (begin/end)BakingSession block.

```python
algo.fetchBakedVertex(sessionId, n, dstId=0) -> algo.BakedValue
```

Parameters

| Type                                        | Name      | Description                                                                      |
| ------------------------------------------- | --------- | -------------------------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId | Baking session Id.                                                               |
| [UInt](./core_types#uint)                   | n         | ID of the vertex to check.                                                       |
| [UInt](./core_types#uint)                   | dstId     | Id of the destination occurrence the vertex belongs to, if several are provided. |

Returns

| Type                                  | Name        | Description |
| ------------------------------------- | ----------- | ----------- |
| [BakedValue](./algo_types#bakedvalue) | bakingPixel |             |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.setBakingSessionPadding](./algo_functions#setbakingsessionpadding)

### setBakingSessionPadding

Change the dilation applied to maps baked from the given session. All maps baked after the call to this function will be affected by the new value. The default value of a newly created session is 2.

```python
algo.setBakingSessionPadding(sessionId, padding)
```

Parameters

| Type                                        | Name      | Description                                                                |
| ------------------------------------------- | --------- | -------------------------------------------------------------------------- |
| [BakingSession](./algo_types#bakingsession) | sessionId | Baking session Id.                                                         |
| [Int](./core_types#int)                     | padding   | Number of pixels to fill around baked islands. -1 means infinite dilation. |

See also:

* [algo.bakeAOMap](./algo_functions#bakeaomap)
* [algo.bakeDepthMap](./algo_functions#bakedepthmap)
* [algo.bakeDiffuseMap](./algo_functions#bakediffusemap)
* [algo.bakeDisplacementMap](./algo_functions#bakedisplacementmap)
* [algo.bakeEmissiveMap](./algo_functions#bakeemissivemap)
* [algo.bakeFeatureMap](./algo_functions#bakefeaturemap)
* [algo.bakeMaterialAOMap](./algo_functions#bakematerialaomap)
* [algo.bakeMaterialIdMap](./algo_functions#bakematerialidmap)
* [algo.bakeMaterialPropertyMap](./algo_functions#bakematerialpropertymap)
* [algo.bakeMetallicMap](./algo_functions#bakemetallicmap)
* [algo.bakeNormalMap](./algo_functions#bakenormalmap)
* [algo.bakeOccurrencePropertyMap](./algo_functions#bakeoccurrencepropertymap)
* [algo.bakeOpacityMap](./algo_functions#bakeopacitymap)
* [algo.bakePartIdMap](./algo_functions#bakepartidmap)
* [algo.bakePositionMap](./algo_functions#bakepositionmap)
* [algo.bakeRoughnessMap](./algo_functions#bakeroughnessmap)
* [algo.bakeSpecularMap](./algo_functions#bakespecularmap)
* [algo.bakeUVMap](./algo_functions#bakeuvmap)
* [algo.bakeValidityMap](./algo_functions#bakevaliditymap)
* [algo.bakeVertexColorMap](./algo_functions#bakevertexcolormap)
* [algo.beginBakingSession](./algo_functions#beginbakingsession)
* [algo.beginVertexBakingSession](./algo_functions#beginvertexbakingsession)
* [algo.combineMaterials](./algo_functions#combinematerials)
* [algo.endBakingSession](./algo_functions#endbakingsession)
* [algo.fetchBakedMap](./algo_functions#fetchbakedmap)
* [algo.fetchBakedVertex](./algo_functions#fetchbakedvertex)

## Decomposition

### convexDecomposition

> **Important:**
>
> This function is tagged as experimental.

Explode each mesh to approximated convex decomposition.

```python
algo.convexDecomposition(occurrences, maxCount=1024, vertexCount=64, approximate=True, resolution=100000, concavity=0.001) -> scene.OccurrenceList
```

Parameters

| Type                                           | Name        | Description                                 |
| ---------------------------------------------- | ----------- | ------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                |
| [Int](./core_types#int)                        | maxCount    | Maximum number of convex hull to generated. |
| [Int](./core_types#int)                        | vertexCount | Maximum number of vertices per convex hull. |
| [Boolean](./core_types#boolean)                | approximate | Approximate method.                         |
| [Int](./core_types#int)                        | resolution  | Resolution.                                 |
| [Double](./core_types#double)                  | concavity   | Concavity.                                  |

Returns

| Type                                           | Name           | Description                                       |
| ---------------------------------------------- | -------------- | ------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | newOccurrences | Resulting occurrences of the convexDecomposition. |

See also:

* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeBodies

Explode all CAD Parts by body. New parts will be placed as children of input part occurrences.

```python
algo.explodeBodies(occurrences, groupOpenShells=False)
```

Parameters

| Type                                           | Name            | Description                        |
| ---------------------------------------------- | --------------- | ---------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences     | Part occurrences to process.       |
| [Boolean](./core_types#boolean)                | groupOpenShells | Group all open shells in one part. |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeByMaterials

Explode all parts by material. New parts will be placed as children of input part occurrences.

```python
algo.explodeByMaterials(occurrences)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeByTopoDimension

Separate polygons, lines and points into different occurrences.

```python
algo.explodeByTopoDimension(occurrences) -> scene.OccurrenceList
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |

Returns

| Type                                           | Name           | Description                                                                       |
| ---------------------------------------------- | -------------- | --------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | newOccurrences | List of created occurrences containing only one type : polygons, lines or points. |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeByVertexCount

Explode part occurrences to respect a maximum vertex count.

```python
algo.explodeByVertexCount(occurrences, maxVertexCount=65534, maxTriangleCount=65534, countMergedVerticesOnce=True)
```

Parameters

| Type                                           | Name                    | Description                                                                                                          |
| ---------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences             | Part occurrences to process.                                                                                         |
| [Int](./core_types#int)                        | maxVertexCount          | The maximum number of vertices by part.                                                                              |
| [Int](./core_types#int)                        | maxTriangleCount        | The maximum number of triangles by part (quadrangles count twice).                                                   |
| [Boolean](./core_types#boolean)                | countMergedVerticesOnce | If true, one vertex used in several triangles with different normals will be counted once (for Unity must be False). |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeByVoxel

> **Important:**
>
> This function is tagged as experimental.

Explode parts by voxel. New parts will be placed as children of input part occurrences.

```python
algo.explodeByVoxel(occurrences, voxelSize=500)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [Distance](./geom_types#distance)              | voxelSize   | Voxel size.                  |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodeConnectedMeshes

Explode connected set of polygons to part occurrences. New parts will be placed as children of input part occurrences.

```python
algo.explodeConnectedMeshes(occurrences, explodeNonManifoldEdges=False)
```

Parameters

| Type                                           | Name                    | Description                                          |
| ---------------------------------------------- | ----------------------- | ---------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences             | Part occurrences to process.                         |
| [Boolean](./core_types#boolean)                | explodeNonManifoldEdges | Split connected components along non-manifold edges. |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodePatches](./algo_functions#explodepatches)

### explodePatches

Explode all parts by patch.

```python
algo.explodePatches(occurrences)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |

See also:

* [algo.convexDecomposition](./algo_functions#convexdecomposition)
* [algo.explodeBodies](./algo_functions#explodebodies)
* [algo.explodeByMaterials](./algo_functions#explodebymaterials)
* [algo.explodeByTopoDimension](./algo_functions#explodebytopodimension)
* [algo.explodeByVertexCount](./algo_functions#explodebyvertexcount)
* [algo.explodeByVoxel](./algo_functions#explodebyvoxel)
* [algo.explodeConnectedMeshes](./algo_functions#explodeconnectedmeshes)

## Occlusion Detection

### createVisibilityInformation

Create visilibity information on part occurrences viewed from a set of camera automatically placed on a sphere around the scene.

```python
algo.createVisibilityInformation(occurrences, level=0, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, root=0, onHemisphereOnly=False)
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)  | level                     | Level of geometries to create visibility information on: Parts, Patches or Polygons.        |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Int](./core_types#int)                        | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Occurrence](./scene_types#occurrence)         | root                      | Specify another root for occluder scene.                                                    |
| [Bool](./core_types#bool)                      | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

See also:

* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### createVisibilityInformationAdvanced

Create visilibity information on part occurrences viewed from a set of voxel based view points.

```python
algo.createVisibilityInformationAdvanced(occurrences, level=0, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, root=0)
```

Parameters

| Type                                              | Name                      | Description                                                                                 |
| ------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)     | level                     | Level of geometries to create visibility information on: Parts, Patches or Polygons.        |
| [Distance](./geom_types#distance)                 | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [Volume](./geom_types#volume)                     | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [Int](./core_types#int)                           | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_types#innerouteroption) | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [Boolean](./core_types#boolean)                   | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Occurrence](./scene_types#occurrence)            | root                      | Specify another root for occluder scene.                                                    |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### createVisibilityInformationFromViewPoints

Create visilibity information on parts viewed from a given set of camera.

```python
algo.createVisibilityInformationFromViewPoints(occurrences, cameraPositions, cameraDirections, cameraUps, resolution=1024, fovX=90, considerTransparentOpaque=False, root=0)
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [Point3List](./geom_types#point3list)          | cameraPositions           | List of camera positions.                                                                   |
| [Point3List](./geom_types#point3list)          | cameraDirections          | List of camera directions.                                                                  |
| [Point3List](./geom_types#point3list)          | cameraUps                 | List of camera up vectors.                                                                  |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Occurrence](./scene_types#occurrence)         | root                      | Specify another root for occluder scene.                                                    |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### findOccludedPartOccurrences

Get part occurrences not viewed from a sphere around the scene.

```python
algo.findOccludedPartOccurrences(occurrences, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, root=0, onHemisphereOnly=False) -> scene.OccurrenceList
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Int](./core_types#int)                        | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Occurrence](./scene_types#occurrence)         | root                      | Specify another root for occluder scene.                                                    |
| [Bool](./core_types#bool)                      | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

Returns

| Type                                           | Name     | Description                                   |
| ---------------------------------------------- | -------- | --------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | filtered | The list of occurrences meeting the criteria. |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### findOccludedPartOccurrencesAdvanced

Get part occurrences not viewed from a set of voxel based view points.

```python
algo.findOccludedPartOccurrencesAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, root=0) -> scene.OccurrenceList
```

Parameters

| Type                                              | Name                      | Description                                                                                 |
| ------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences               | Occurrences of components to process.                                                       |
| [Distance](./geom_types#distance)                 | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [Volume](./geom_types#volume)                     | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [Int](./core_types#int)                           | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_types#innerouteroption) | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [Boolean](./core_types#boolean)                   | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Occurrence](./scene_types#occurrence)            | root                      | Specify another root for occluder scene.                                                    |

Returns

| Type                                           | Name     | Description                                   |
| ---------------------------------------------- | -------- | --------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | filtered | The list of occurrences meeting the criteria. |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### removeOccludedGeometries

Delete part occurrences, patches or polygons not viewed from a sphere around the scene.

```python
algo.removeOccludedGeometries(occurrences, level=0, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[], onHemisphereOnly=False) -> core.BoolList
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)  | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Int](./core_types#int)                        | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Int](./core_types#int)                        | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_types#occurrencelist) | occluders                 | Specify other occurrences for occluder scene.                                               |
| [Bool](./core_types#bool)                      | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

Returns

| Type                              | Name              | Description                                                                                      |
| --------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------ |
| [BoolList](./core_types#boollist) | viewedOccurrences | For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True). |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### removeOccludedGeometriesAdvanced

Delete part occurrences, patches or polygons not seen from voxel based view points.

```python
algo.removeOccludedGeometriesAdvanced(occurrences, level=0, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
```

Parameters

| Type                                              | Name                      | Description                                                                                 |
| ------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)     | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [Distance](./geom_types#distance)                 | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [Volume](./geom_types#volume)                     | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [Int](./core_types#int)                           | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_types#innerouteroption) | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [Boolean](./core_types#boolean)                   | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Int](./core_types#int)                           | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_types#occurrencelist)    | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                              | Name              | Description                                                                                      |
| --------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------ |
| [BoolList](./core_types#boollist) | viewedOccurrences | For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True). |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### removeOccludedGeometriesFromPoints

Delete part occurrences, patches or polygons not viewed from spheres generated with a set of camera position.

```python
algo.removeOccludedGeometriesFromPoints(occurrences, level=0, positions, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)  | level                     | Level of parts to remove : Parts, Patches or Polygons.                                      |
| [Point3List](./geom_types#point3list)          | positions                 | List of positions.                                                                          |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Int](./core_types#int)                        | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Int](./core_types#int)                        | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_types#occurrencelist) | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                              | Name              | Description                                                                                      |
| --------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------ |
| [BoolList](./core_types#boollist) | viewedOccurrences | For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True). |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromViewPoints](./algo_functions#removeoccludedgeometriesfromviewpoints)

### removeOccludedGeometriesFromViewPoints

Delete part occurrences, patches or polygons not viewed from a set of camera position/orientation.

```python
algo.removeOccludedGeometriesFromViewPoints(occurrences, level=0, positions, directions, ups, resolution=1024, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
```

Parameters

| Type                                           | Name                      | Description                                                                                 |
| ---------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_types#selectionlevel)  | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [Point3List](./geom_types#point3list)          | positions                 | List of positions.                                                                          |
| [Point3List](./geom_types#point3list)          | directions                | List of directions.                                                                         |
| [Point3List](./geom_types#point3list)          | ups                       | List of up vectors.                                                                         |
| [Int](./core_types#int)                        | resolution                | Resolution of the visibility viewer.                                                        |
| [Double](./core_types#double)                  | fovX                      | Horizontal field of view (in degree).                                                       |
| [Boolean](./core_types#boolean)                | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [Int](./core_types#int)                        | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_types#occurrencelist) | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                              | Name              | Description                                                                                      |
| --------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------ |
| [BoolList](./core_types#boollist) | viewedOccurrences | For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True). |

See also:

* [algo.createVisibilityInformation](./algo_functions#createvisibilityinformation)
* [algo.createVisibilityInformationAdvanced](./algo_functions#createvisibilityinformationadvanced)
* [algo.createVisibilityInformationFromViewPoints](./algo_functions#createvisibilityinformationfromviewpoints)
* [algo.findOccludedPartOccurrences](./algo_functions#findoccludedpartoccurrences)
* [algo.findOccludedPartOccurrencesAdvanced](./algo_functions#findoccludedpartoccurrencesadvanced)
* [algo.removeOccludedGeometries](./algo_functions#removeoccludedgeometries)
* [algo.removeOccludedGeometriesAdvanced](./algo_functions#removeoccludedgeometriesadvanced)
* [algo.removeOccludedGeometriesFromPoints](./algo_functions#removeoccludedgeometriesfrompoints)

## Reconstruction

### createOcclusionMesh

> **Important:**
>
> This function is tagged as experimental.

Compute an occluder or an occludee with the occurrences selected.

```python
algo.createOcclusionMesh(occurrences, type=1, voxelSize=50, gap=1) -> scene.Occurrence
```

Parameters

| Type                                           | Name        | Description                            |
| ---------------------------------------------- | ----------- | -------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.           |
| [CreateOccluder](./algo_types#createoccluder)  | type        | Type of what we create.                |
| [Distance](./geom_types#distance)              | voxelSize   | Size of voxels.                        |
| [Int](./core_types#int)                        | gap         | Dilation iterations on the voxel grid. |

Returns

| Type                                   | Name          | Description                |
| -------------------------------------- | ------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | occlusionPart | Resulting part occurrence. |

See also:

* [algo.dualContouring](./algo_functions#dualcontouring)
* [algo.marchingCubes](./algo_functions#marchingcubes)
* [algo.proxyMesh](./algo_functions#proxymesh)
* [algo.retopologize](./algo_functions#retopologize)
* [algo.voxelize](./algo_functions#voxelize)

### dualContouring

> **Important:**
>
> This function is tagged as experimental.

Replace the tessellations of the selected parts by a retopology based on a dual-contouring.

```python
algo.dualContouring(occurrences, filteringSize=200, voxelSize=50, tolerance=0.01, sameSizeOnAllAxis=False) -> scene.Occurrence
```

Parameters

| Type                                           | Name              | Description                                                                |
| ---------------------------------------------- | ----------------- | -------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences       | Occurrences of part to process.                                            |
| [Distance](./geom_types#distance)              | filteringSize     | Filtering size - must be a multiple of 2 of voxelSize.                     |
| [Distance](./geom_types#distance)              | voxelSize         | Voxel size used for the reconstruction.                                    |
| [Double](./core_types#double)                  | tolerance         | Tolerance for the quadric error used for the simplification of the octree. |
| [Boolean](./core_types#boolean)                | sameSizeOnAllAxis | If true, use the maximum axis length of the AABB for all axis.             |

Returns

| Type                                   | Name              | Description                |
| -------------------------------------- | ----------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | dualContouredPart | Resulting part occurrence. |

See also:

* [algo.createOcclusionMesh](./algo_functions#createocclusionmesh)
* [algo.marchingCubes](./algo_functions#marchingcubes)
* [algo.proxyMesh](./algo_functions#proxymesh)
* [algo.retopologize](./algo_functions#retopologize)
* [algo.voxelize](./algo_functions#voxelize)

### marchingCubes

Replace the tessellations of the selected parts by a marching cube representation.

```python
algo.marchingCubes(occurrences, voxelSize=50, elements=0, dilation=0, surfacic=False) -> scene.Occurrence
```

Parameters

| Type                                           | Name        | Description                                                                                |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                                               |
| [Distance](./geom_types#distance)              | voxelSize   | Size of voxels.                                                                            |
| [ElementFilter](./algo_types#elementfilter)    | elements    | Type of elements used to detect the voxels, polygons or points or hybrid.                  |
| [Int](./core_types#int)                        | dilation    | Dilation iterations on the voxel grid (only if surfacic=false).                            |
| [Boolean](./core_types#boolean)                | surfacic    | Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight. |

Returns

| Type                                   | Name             | Description                |
| -------------------------------------- | ---------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | marchingCubePart | Resulting part occurrence. |

See also:

* [algo.createOcclusionMesh](./algo_functions#createocclusionmesh)
* [algo.dualContouring](./algo_functions#dualcontouring)
* [algo.proxyMesh](./algo_functions#proxymesh)
* [algo.retopologize](./algo_functions#retopologize)
* [algo.voxelize](./algo_functions#voxelize)

### proxyMesh

Replace the tessellations of the selected parts by a proxy mesh based on a voxelization.

```python
algo.proxyMesh(occurrences, voxelSize=50, elements=0, dilation=0, surfacic=False) -> scene.Occurrence
```

Parameters

| Type                                           | Name        | Description                                                                                |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                                               |
| [Distance](./geom_types#distance)              | voxelSize   | Size of voxels.                                                                            |
| [ElementFilter](./algo_types#elementfilter)    | elements    | Type of elements used to detect the voxels, polygons or points or hybrid.                  |
| [Int](./core_types#int)                        | dilation    | Dilation iterations on the voxel grid (only if surfacic=false).                            |
| [Boolean](./core_types#boolean)                | surfacic    | Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight. |

Returns

| Type                                   | Name          | Description                |
| -------------------------------------- | ------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | proxyMeshPart | Resulting part occurrence. |

See also:

* [algo.createOcclusionMesh](./algo_functions#createocclusionmesh)
* [algo.dualContouring](./algo_functions#dualcontouring)
* [algo.marchingCubes](./algo_functions#marchingcubes)
* [algo.retopologize](./algo_functions#retopologize)
* [algo.voxelize](./algo_functions#voxelize)

### retopologize

> **Important:**
>
> This function is tagged as experimental.

Replace the tessellations of the selected parts by a retopology of the external hull.

```python
algo.retopologize(occurrences, targetTriangleCount=1000, pureQuad=True, pointCloud=False, precision=-1) -> scene.Occurrence
```

Parameters

| Type                                           | Name                | Description                                                                                                         |
| ---------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                                                                        |
| [Int](./core_types#int)                        | targetTriangleCount | Target triangle count.                                                                                              |
| [Bool](./core_types#bool)                      | pureQuad            | Retopologize to a pure quad mesh if True, else the resulting mesh will be quad dominant but can contains triangles. |
| [Bool](./core_types#bool)                      | pointCloud          | Set to true if occurrences are point cloud, else False.                                                             |
| [Distance](./geom_types#distance)              | precision           | If set, define the precision of the features to preserve.                                                           |

Returns

| Type                                   | Name              | Description                |
| -------------------------------------- | ----------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | retopologizedPart | Resulting part occurrence. |

See also:

* [algo.createOcclusionMesh](./algo_functions#createocclusionmesh)
* [algo.dualContouring](./algo_functions#dualcontouring)
* [algo.marchingCubes](./algo_functions#marchingcubes)
* [algo.proxyMesh](./algo_functions#proxymesh)
* [algo.voxelize](./algo_functions#voxelize)

### voxelize

Replace the tessellations of the selected parts by a voxelization of the external skin.

```python
algo.voxelize(occurrences, voxelSize=50, elements=0, dilation=0, useCurrentAnimationPosition=False) -> scene.Occurrence
```

Parameters

| Type                                           | Name                        | Description                                                               |
| ---------------------------------------------- | --------------------------- | ------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences                 | Part occurrences to process.                                              |
| [Distance](./geom_types#distance)              | voxelSize                   | Size of voxels.                                                           |
| [ElementFilter](./algo_types#elementfilter)    | elements                    | Type of elements used to detect the voxels, polygons or points or hybrid. |
| [Int](./core_types#int)                        | dilation                    | Dilation iterations on the voxel grid.                                    |
| [Boolean](./core_types#boolean)                | useCurrentAnimationPosition | Use the current animation position instead of the t-pose.                 |

Returns

| Type                                   | Name          | Description                |
| -------------------------------------- | ------------- | -------------------------- |
| [Occurrence](./scene_types#occurrence) | voxelizedPart | Resulting part occurrence. |

See also:

* [algo.createOcclusionMesh](./algo_functions#createocclusionmesh)
* [algo.dualContouring](./algo_functions#dualcontouring)
* [algo.marchingCubes](./algo_functions#marchingcubes)
* [algo.proxyMesh](./algo_functions#proxymesh)
* [algo.retopologize](./algo_functions#retopologize)

## Replacement

### replaceBy

Replace geometries by other shapes, or primitives.

```python
algo.replaceBy(occurrences, replaceBy=["Occurrence", algo.ReplaceByOccurrenceOptions(0, False)])
```

Parameters

| Type                                            | Name        | Description                           |
| ----------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)  | occurrences | Occurrences of components to replace. |
| [ReplaceByOption](./algo_types#replacebyoption) | replaceBy   | Shape replacement option.             |

See also:

* [algo.replaceByBox](./algo_functions#replacebybox)
* [algo.replaceByConvexHull](./algo_functions#replacebyconvexhull)
* [algo.replaceByPrimitive](./algo_functions#replacebyprimitive)

### replaceByBox

Replace objects by a bounding box.

```python
algo.replaceByBox(occurrences, boxType)
```

Parameters

| Type                                              | Name        | Description                                    |
| ------------------------------------------------- | ----------- | ---------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences | Occurrences of components to replace.          |
| [ReplaceByBoxType](./algo_types#replacebyboxtype) | boxType     | Bounding box type, oriented, axis-aligned, ... |

See also:

* [algo.replaceBy](./algo_functions#replaceby)
* [algo.replaceByConvexHull](./algo_functions#replacebyconvexhull)
* [algo.replaceByPrimitive](./algo_functions#replacebyprimitive)

### replaceByConvexHull

> **Important:**
>
> This function is tagged as experimental.

Replace objects by convex hull.

```python
algo.replaceByConvexHull(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to replace. |

See also:

* [algo.replaceBy](./algo_functions#replaceby)
* [algo.replaceByBox](./algo_functions#replacebybox)
* [algo.replaceByPrimitive](./algo_functions#replacebyprimitive)

### replaceByPrimitive

Replace objects by a primitive shapes.

```python
algo.replaceByPrimitive(occurrences, primitive, generateUV=True)
```

Parameters

| Type                                                              | Name        | Description                           |
| ----------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                    | occurrences | Occurrences of components to replace. |
| [PrimitiveShapeParameters](./algo_types#primitiveshapeparameters) | primitive   | Primitive type and parameters.        |
| [Boolean](./core_types#boolean)                                   | generateUV  | Primitive type and parameters.        |

See also:

* [algo.replaceBy](./algo_functions#replaceby)
* [algo.replaceByBox](./algo_functions#replacebybox)
* [algo.replaceByConvexHull](./algo_functions#replacebyconvexhull)

## Sawing

### sawWithAABB

Saw the mesh with an axis-aligned bounding box. New parts will be placed as children of input part occurrences.

```python
algo.sawWithAABB(occurrences, aabb, mode, innerSuffix="_inner", outerSuffix="_outer")
```

Parameters

| Type                                           | Name        | Description                                                           |
| ---------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                          |
| [AABB](./geom_types#aabb)                      | aabb        | Axis-Aligned Bounding Box.                                            |
| [SawingMode](./algo_types#sawingmode)          | mode        | The sawing mode.                                                      |
| [String](./core_types#string)                  | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [String](./core_types#string)                  | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |

See also:

* [algo.sawWithOBB](./algo_functions#sawwithobb)
* [algo.sawWithOctree](./algo_functions#sawwithoctree)
* [algo.sawWithPlane](./algo_functions#sawwithplane)

### sawWithOBB

Saw the mesh with an oriented bounding box. New parts will be placed as children of input part occurrences.

```python
algo.sawWithOBB(occurrences, obb, mode, innerSuffix="_inner", outerSuffix="_outer")
```

Parameters

| Type                                           | Name        | Description                                                           |
| ---------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                          |
| [OBB](./geom_types#obb)                        | obb         | Minimum Bounding Box.                                                 |
| [SawingMode](./algo_types#sawingmode)          | mode        | The sawing mode.                                                      |
| [String](./core_types#string)                  | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [String](./core_types#string)                  | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |

See also:

* [algo.sawWithAABB](./algo_functions#sawwithaabb)
* [algo.sawWithOctree](./algo_functions#sawwithoctree)
* [algo.sawWithPlane](./algo_functions#sawwithplane)

### sawWithOctree

Saw and split the mesh with an octree. New parts will be placed as children of input part occurrences.

```python
algo.sawWithOctree(occurrences, aabb, maxDepth, maxTrianglesByLeaf=-1, sawTolerance=0) -> scene.Occurrence
```

Parameters

| Type                                           | Name               | Description                                                                 |
| ---------------------------------------------- | ------------------ | --------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.                                                |
| [AABB](./geom_types#aabb)                      | aabb               | Octree Bounding Box.                                                        |
| [Int](./core_types#int)                        | maxDepth           | Depth of the octree.                                                        |
| [Int](./core_types#int)                        | maxTrianglesByLeaf | Set the maximum triangle count on the leaf of the octree ( -1 to not use ). |
| [Double](./core_types#double)                  | sawTolerance       | Size in mm of the tolerance of the saw.                                     |

Returns

| Type                                   | Name       | Description                            |
| -------------------------------------- | ---------- | -------------------------------------- |
| [Occurrence](./scene_types#occurrence) | octreeRoot | Root occurrence of the created octree. |

See also:

* [algo.sawWithAABB](./algo_functions#sawwithaabb)
* [algo.sawWithOBB](./algo_functions#sawwithobb)
* [algo.sawWithPlane](./algo_functions#sawwithplane)

### sawWithPlane

Saw the mesh with a plane. New parts will be placed as children of input part occurrences.

```python
algo.sawWithPlane(occurrences, planeOrigin, planeNormal, mode, innerSuffix="_inner", outerSuffix="_outer", tolerance=0)
```

Parameters

| Type                                           | Name        | Description                                                           |
| ---------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                          |
| [Point3](./geom_types#point3)                  | planeOrigin | The plane origin.                                                     |
| [Vector3](./geom_types#vector3)                | planeNormal | The plane normal.                                                     |
| [SawingMode](./algo_types#sawingmode)          | mode        | The sawing mode.                                                      |
| [String](./core_types#string)                  | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [String](./core_types#string)                  | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |
| [Double](./core_types#double)                  | tolerance   | Set a tolerance to make the saw lose.                                 |

See also:

* [algo.sawWithAABB](./algo_functions#sawwithaabb)
* [algo.sawWithOBB](./algo_functions#sawwithobb)
* [algo.sawWithOctree](./algo_functions#sawwithoctree)

## Similarity detection

### convertSimilarPartOccurrencesToInstances

Create instances from similar part occurrences with an accurate method based on topology checksums. This can be used to repair instances or to simplify a model that has similar parts that could be instantiated instead to reduce the number of unique meshes (reduces drawcalls, GPU memory usage and file size).

```python
algo.convertSimilarPartOccurrencesToInstances(occurrences, checkMeshTopo=True, checkVertexPositions=True, vertexPositionPrecision=5, checkUVTopo=True, checkUVVertexPositions=True, UVPositionprecision=5)
```

Parameters

| Type                                           | Name                    | Description                                                                               |
| ---------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences             | Occurrence for which we want to find similar parts and create instances using prototypes. |
| [Boolean](./core_types#boolean)                | checkMeshTopo           |                                                                                           |
| [Boolean](./core_types#boolean)                | checkVertexPositions    |                                                                                           |
| [Int](./core_types#int)                        | vertexPositionPrecision |                                                                                           |
| [Boolean](./core_types#boolean)                | checkUVTopo             |                                                                                           |
| [Boolean](./core_types#boolean)                | checkUVVertexPositions  |                                                                                           |
| [Int](./core_types#int)                        | UVPositionprecision     |                                                                                           |

See also:

* [algo.convertSimilarPartOccurrencesToInstancesFast](./algo_functions#convertsimilarpartoccurrencestoinstancesfast)
* [algo.findSimilarPartOccurrencesFast](./algo_functions#findsimilarpartoccurrencesfast)

### convertSimilarPartOccurrencesToInstancesFast

Create instances from similar part occurrences with a fast but approximate method. This can be used to repair instances or to simplify a model that has similar parts that could be instantiated instead to reduce the number of unique meshes (reduces drawcalls, GPU memory usage and file size). Using 1.0 (100%) in all similarity criteria is non destructive. Using lower values will help finding more similar parts, even if their polycount or dimensions varies a bit.

```python
algo.convertSimilarPartOccurrencesToInstancesFast(occurrences, dimensionsSimilarity=0.98, polycountSimilarity=0.98, ignoreSymmetry=False)
```

Parameters

| Type                                           | Name                 | Description                                                                                                                                                                                                          |
| ---------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Root occurrences for which we want to find similar part occurrences and create instances using prototypes.                                                                                                           |
| [Coeff](./core_types#coeff)                    | dimensionsSimilarity | The percentage of similarity on dimensions. A value of 1.0 (100%) will find parts that have exactly the same dimensions. A lower value will increase the likelihood to find similar parts, at the cost of precision. |
| [Coeff](./core_types#coeff)                    | polycountSimilarity  | The percentage of similarity on polycount. A value of 1.0 (100%) will find parts that have exactly the same polycount. A lower value will increase the likelihood to find similar parts, at the cost of precision.   |
| [Boolean](./core_types#boolean)                | ignoreSymmetry       | If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.                                                                                                    |

See also:

* [algo.convertSimilarPartOccurrencesToInstances](./algo_functions#convertsimilarpartoccurrencestoinstances)
* [algo.findSimilarPartOccurrencesFast](./algo_functions#findsimilarpartoccurrencesfast)

### findSimilarPartOccurrencesFast

Find part occurrences in the whole scene that are similar to the input part occurrences. If multiple part occurrences are passed as input, the output will contain similar part occurrences corresponding to each input part occurrence.

```python
algo.findSimilarPartOccurrencesFast(occurrences, dimensionsSimilarity=0.98, polycountSimilarity=0.98, ignoreSymmetry=False) -> scene.OccurrenceList
```

Parameters

| Type                                           | Name                 | Description                                                                                                                                                                                                          |
| ---------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Occurrences for which we want to find similar part occurrences in the scene.                                                                                                                                         |
| [Coeff](./core_types#coeff)                    | dimensionsSimilarity | The percentage of similarity on dimensions. A value of 1.0 (100%) will find parts that have exactly the same dimensions. A lower value will increase the likelihood to find similar parts, at the cost of precision. |
| [Coeff](./core_types#coeff)                    | polycountSimilarity  | The percentage of similarity on polycount. A value of 1.0 (100%) will find parts that have exactly the same polycount. A lower value will increase the likelihood to find similar parts, at the cost of precision.   |
| [Boolean](./core_types#boolean)                | ignoreSymmetry       | If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.                                                                                                    |

Returns

| Type                                           | Name     | Description                                        |
| ---------------------------------------------- | -------- | -------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | filtered | The list of part occurrences meeting the criteria. |

See also:

* [algo.convertSimilarPartOccurrencesToInstances](./algo_functions#convertsimilarpartoccurrencestoinstances)
* [algo.convertSimilarPartOccurrencesToInstancesFast](./algo_functions#convertsimilarpartoccurrencestoinstancesfast)

## UV Mapping

### alignUVIslands

> **Important:**
>
> This function is tagged as experimental.

Align with the axes the UVs of the islands.

```python
algo.alignUVIslands(occurrences, channel=0, usePolygonsWeights=0, useVerticesWeights=0, alignmentMode=0)
```

Parameters

| Type                                           | Name               | Description                                                           |
| ---------------------------------------------- | ------------------ | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.                                          |
| [Int](./core_types#int)                        | channel            | UV channel to merge.                                                  |
| [Double](./core_types#double)                  | usePolygonsWeights | Use polygons weights to give more importance to what must be aligned. |
| [Double](./core_types#double)                  | useVerticesWeights | Use vertices weights to give more importance to what must be aligned. |
| [AlignmentMode](./algo_types#alignmentmode)    | alignmentMode      | With which axis the UVs should be aligned.                            |

See also:

* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### applyUvTransform

Apply a transformation matrix on texture coordinates.

```python
algo.applyUvTransform(occurrences, matrix, channel=0)
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [Matrix4](./geom_types#matrix4)                | matrix      | Transformationmatrix.        |
| [Int](./core_types#int)                        | channel     | UV channel to transform.     |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### automaticUVMapping

> **Important:**
>
> This function is tagged as experimental.

Generates the texture coordinates and automatically find seams.

```python
algo.automaticUVMapping(occurrences, channel=0, maxAngleDistorsion=0.5, maxAreaDistorsion=-1, sharpToSeam=True, forbidOverlapping=True, resolution=1024, padding=1)
```

Parameters

| Type                                           | Name               | Description                                                               |               |           |
| ---------------------------------------------- | ------------------ | ------------------------------------------------------------------------- | ------------- | --------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.                                              |               |           |
| [Int](./core_types#int)                        | channel            | The UV channel which will contains the texture coordinates.               |               |           |
| [Double](./core_types#double)                  | maxAngleDistorsion | Maximum angle distorsion                                                  | 2PI-SumVtxAng | /2PI.     |
| [Double](./core_types#double)                  | maxAreaDistorsion  | Maximum area distorsion before scale to 1.                                | 2DArea-3DArea | /3DArea . |
| [Bool](./core_types#bool)                      | sharpToSeam        | If enabled, sharp edges are automatically considered as UV seams.         |               |           |
| [Bool](./core_types#bool)                      | forbidOverlapping  | If enabled, UV cannot overlap.                                            |               |           |
| [UInt](./core_types#uint)                      | resolution         | Resolution wanted for the final map when repacking at the end.            |               |           |
| [UInt](./core_types#uint)                      | padding            | Set the padding (in pixels) between UV islands when repacking at the end. |               |           |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### copyUV

Copy an UV channel to another UV channel.

```python
algo.copyUV(occurrences, sourceChannel=0, destinationChannel=0)
```

Parameters

| Type                                           | Name               | Description                              |
| ---------------------------------------------- | ------------------ | ---------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.             |
| [Int](./core_types#int)                        | sourceChannel      | The source UV channel to copy.           |
| [Int](./core_types#int)                        | destinationChannel | The destination UV channel to copy into. |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### getRatioUV3D

Compute the ratio between the UV and the 3D size.

```python
algo.getRatioUV3D(occurrences, ratioMode, channel=0) -> core.DoubleList
```

Parameters

| Type                                           | Name        | Description                      |
| ---------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.     |
| [RatioUV3DMode](./algo_types#ratiouv3dmode)    | ratioMode   | Choose how to compute the ratio. |
| [Int](./core_types#int)                        | channel     | UV channel to use.               |

Returns

| Type                                  | Name   | Description                                    |
| ------------------------------------- | ------ | ---------------------------------------------- |
| [DoubleList](./core_types#doublelist) | ratios | Ratios 3Dsize/UVsize of the input occurrences. |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### getUVQualityMetrics

Compute UV mapping qualitative metrics.

```python
algo.getUVQualityMetrics(occurrences, channel=0) -> core.UInt, core.Double, core.Double, core.Double, core.Double, core.Double
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [UInt](./core_types#uint)                      | channel     | UV channel to use.           |

Returns

| Type                          | Name        | Description                                                                                                                               |
| ----------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [UInt](./core_types#uint)     | chartCount  | Number of UV islands. If 0, all other returns are invalid.                                                                                |
| [Double](./core_types#double) | area3D      | 3D area (sum of 3D triangle areas).                                                                                                       |
| [Double](./core_types#double) | area2D      | 2D area (sum of UV-space triangle area).                                                                                                  |
| [Double](./core_types#double) | occupancy   | UV-space occupation (i.e., 2D area over AABR area).                                                                                       |
| [Double](./core_types#double) | crumbliness | Crumbliness (i.e., a measure of how intricate the UV-island borders are, basically a measure of deviation from a perfect disc).           |
| [Double](./core_types#double) | samplingStd | Sampling standard deviation (i.e., measure of variation over the mesh of triangle sampling rate, that is ratio of their 2D over 3D area). |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### getUvAabr

Compute the UV Axis Aligned Bounding Rectangle of a set of occurrences.

```python
algo.getUvAabr(occurrences, channel=0) -> geom.AABR
```

Parameters

| Type                                           | Name        | Description                  |
| ---------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process. |
| [Int](./core_types#int)                        | channel     | UV channel to transform.     |

Returns

| Type                      | Name | Description  |
| ------------------------- | ---- | ------------ |
| [AABR](./geom_types#aabr) | aabr | The UV AABR. |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### hasOverlappingUV

Check if a UV channel contains overlapping UVs.

```python
algo.hasOverlappingUV(occurrences, channel=0, resolution=1024) -> core.Boolean
```

Parameters

| Type                                           | Name        | Description                                                  |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                                 |
| [UInt](./core_types#uint)                      | channel     | UV channel to use.                                           |
| [UInt](./core_types#uint)                      | resolution  | Resolution of rasterization grid used to check for overlaps. |

Returns

| Type                            | Name              | Description                    |
| ------------------------------- | ----------------- | ------------------------------ |
| [Boolean](./core_types#boolean) | hasOverlappingUVs | True if overlapping UVs found. |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnAABB

Generate texture coordinates using the projection on object Axis Aligned Bounding Box.

```python
algo.mapUvOnAABB(occurrences, useLocalAABB=False, uv3dSize=100, channel=0, overrideExistingUVs=True, ignoreScale=True)
```

Parameters

| Type                                           | Name                | Description                                                  |
| ---------------------------------------------- | ------------------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                 |
| [Bool](./core_types#bool)                      | useLocalAABB        | If enabled, uses part own bounding box, else use global one. |
| [Distance](./geom_types#distance)              | uv3dSize            | 3D size of the UV space \[0-1].                              |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates.  |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                   |
| [Boolean](./core_types#boolean)                | ignoreScale         | If this and useLocalAABB are true, ignore local scale.       |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnBox

Generate texture coordinates using the projection on a box.

```python
algo.mapUvOnBox(occurrences, box, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [Box](./algo_types#box)                        | box                 | Box definition.                                             |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnCubicAABB

Generate texture coordinates using the projection on object AABB, with same scale on each axis.

```python
algo.mapUvOnCubicAABB(occurrences, uv3dSize=100, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [Distance](./geom_types#distance)              | uv3dSize            | 3D size of the UV space \[0-1].                             |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnCustomAABB

Generate texture coordinates using the projection on custom AABB.

```python
algo.mapUvOnCustomAABB(occurrences, aabb, uv3dSize=100, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [AABB](./geom_types#aabb)                      | aabb                | Axis aligned bounding box to project on.                    |
| [Distance](./geom_types#distance)              | uv3dSize            | 3D size of the UV space \[0-1].                             |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnCylinder

Generate texture coordinates using the projection on a cylinder.

```python
algo.mapUvOnCylinder(occurrences, cylinder, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [Cylinder](./algo_types#cylinder)              | cylinder            | Cylinder definition.                                        |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnFittingCylinder

Generate texture coordinates using the projection on a fitting cylinder.

```python
algo.mapUvOnFittingCylinder(occurrences, channel=0, overrideExistingUVs=True, useAABB=True, forcedAxis=geom.Vector3(0,0,0))
```

Parameters

| Type                                           | Name                | Description                                                                                                     |
| ---------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                                                                    |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates.                                                     |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                                                                      |
| [Boolean](./core_types#boolean)                | useAABB             | If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |
| [Vector3](./geom_types#vector3)                | forcedAxis          | Forced axis of the Cylinder.                                                                                    |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnFittingSphere

Generate texture coordinates using the projection on a fitting sphere.

```python
algo.mapUvOnFittingSphere(occurrences, channel=0, overrideExistingUVs=True, useAABB=True)
```

Parameters

| Type                                           | Name                | Description                                                                                                     |
| ---------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                                                                    |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates.                                                     |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                                                                      |
| [Boolean](./core_types#boolean)                | useAABB             | If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnMBB

Generate texture coordinates using the projection on object Minimum Bounding Box.

```python
algo.mapUvOnMBB(occurrences, useLocalMBB=False, uv3dSize=100, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                  |
| ---------------------------------------------- | ------------------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                 |
| [Bool](./core_types#bool)                      | useLocalMBB         | If enabled, uses part own bounding box, else use global one. |
| [Distance](./geom_types#distance)              | uv3dSize            | 3D size of the UV space \[0-1].                              |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates.  |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                   |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnPlane

Generate texture coordinates using the projection on a plane.

```python
algo.mapUvOnPlane(occurrences, plane, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [Plane](./algo_types#plane)                    | plane               | Plane definition.                                           |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mapUvOnSphere

Generate texture coordinates using the projection on a sphere.

```python
algo.mapUvOnSphere(occurrences, sphere, channel=0, overrideExistingUVs=True)
```

Parameters

| Type                                           | Name                | Description                                                 |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Part occurrences to process.                                |
| [Sphere](./algo_types#sphere)                  | sphere              | Sphere definition.                                          |
| [Int](./core_types#int)                        | channel             | The UV channel which will contains the texture coordinates. |
| [Boolean](./core_types#boolean)                | overrideExistingUVs | If True, override existing UVs on channel.                  |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mergeUVIslandsAffine

> **Important:**
>
> This function is tagged as experimental.

Minimizes the number of seams in the UV mapping by merging UV islands using affine transformation (recommanded for hard surfaces).

```python
algo.mergeUVIslandsAffine(occurrences, channel=0, scaleWeights=0, maxScaleVariationFactor=1.2, curvatureWeights=-1, usePolygonsWeights=1, useVerticesWeights=-1, allowedTransformations=0, allowUVInversion=False, rotationStep=-1)
```

Parameters

| Type                                                  | Name                    | Description                                                                                                          |
| ----------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)        | occurrences             | Part occurrences to process.                                                                                         |
| [Int](./core_types#int)                               | channel                 | UV channel to merge.                                                                                                 |
| [Double](./core_types#double)                         | scaleWeights            | Weight to assign to scale for the merging priority.                                                                  |
| [Double](./core_types#double)                         | maxScaleVariationFactor | Maximum scaling factor allowed, -1 meaning no limits.                                                                |
| [Double](./core_types#double)                         | curvatureWeights        | Weight to assign to curvature for the merging priority.                                                              |
| [Double](./core_types#double)                         | usePolygonsWeights      | Use polygons weights to prioritize seams between polygons with less weight. The value represents the feature weight. |
| [Double](./core_types#double)                         | useVerticesWeights      | Use vertices weights to prioritize seams where vertices with less weight. The value represents the feature weight.   |
| [TransformationType](./algo_types#transformationtype) | allowedTransformations  | Allowed transformation: TRSOnly or TRS+Skew.                                                                         |
| [Boolean](./core_types#boolean)                       | allowUVInversion        | Allow merged UVs to be inverted.                                                                                     |
| [Angle](./geom_types#angle)                           | rotationStep            | Constrains rotation steps to the specified angle (in degrees). If set to -1, allows free rotation.                   |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### mergeUVIslandsRelaxed

Minimizes the number of seams in the UV mapping by merging UV islands using local reparametrization near the UV seams (recommanded for organic surfaces).

```python
algo.mergeUVIslandsRelaxed(occurrences, channel=0, targetIslandCount=0, energyThreshold=0.01, forceIsolatedFaces=True)
```

Parameters

| Type                                           | Name               | Description                                                                                                                                 |
| ---------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.                                                                                                                |
| [Int](./core_types#int)                        | channel            | UV channel to use.                                                                                                                          |
| [Int](./core_types#int)                        | targetIslandCount  | Target number of islands (zero means the algorithm runs until no more merging is possible).                                                 |
| [Double](./core_types#double)                  | energyThreshold    | Max energy allowed during local reparametrization.                                                                                          |
| [Boolean](./core_types#boolean)                | forceIsolatedFaces | UV islands consisting in a single isolated face completely surrounded by another island are forced to be merged, without reparametrization. |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### normalizeUV

Normalize UVs to fit in the \[0-1] uv space.

```python
algo.normalizeUV(occurrences, sourceUVChannel=0, destinationUVChannel=-1, uniform=True, sharedUVSpace=True, ignoreNullIslands=False)
```

Parameters

| Type                                           | Name                 | Description                                                                                                                     |
| ---------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences          | Part occurrences to process.                                                                                                    |
| [Int](./core_types#int)                        | sourceUVChannel      | UV Channel to normalize.                                                                                                        |
| [Int](./core_types#int)                        | destinationUVChannel | UV channel to store the normalized UV (if -1, sourceUVChannel will be replaced).                                                |
| [Boolean](./core_types#boolean)                | uniform              | If true, the scale will be uniform. Else UV can be deformed with a non-uniform scale.                                           |
| [Boolean](./core_types#boolean)                | sharedUVSpace        | If true, all parts will be processed as if they were merged to avoid overlapping of their UV coordinates.                       |
| [Boolean](./core_types#boolean)                | ignoreNullIslands    | If true, islands with null height and width will be ignored and their UV coordinates will be set to \[0,0] (Slower if enabled). |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### removeUV

Remove one or all UV channel(s).

```python
algo.removeUV(occurrences, channel=-1)
```

Parameters

| Type                                           | Name        | Description                                   |
| ---------------------------------------------- | ----------- | --------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.                  |
| [Int](./core_types#int)                        | channel     | The UV channel to remove (all if channel=-1). |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### repackUV

Pack existing UV (create atlas).

```python
algo.repackUV(occurrences, channel=0, shareMap=True, resolution=1024, padding=2, uniformRatio=False, iterations=3, removeOverlaps=True) -> scene.OccurrenceList
```

Parameters

| Type                                           | Name           | Description                                                              |
| ---------------------------------------------- | -------------- | ------------------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences    | Part occurrences to process.                                             |
| [Int](./core_types#int)                        | channel        | The UV channel to repack.                                                |
| [Boolean](./core_types#boolean)                | shareMap       | If True, the UV of all given parts will be packed together.              |
| [Int](./core_types#int)                        | resolution     | Resolution wanted for the final map.                                     |
| [UInt](./core_types#uint)                      | padding        | Set the padding (in pixels) between UV islands.                          |
| [Boolean](./core_types#boolean)                | uniformRatio   | If true, UV of different part will have the same ratio.                  |
| [Int](./core_types#int)                        | iterations     | Fitting iterations.                                                      |
| [Boolean](./core_types#boolean)                | removeOverlaps | Remove overlaps to avoid multiple triangles UVs to share the same pixel. |

Returns

| Type                                           | Name        | Description                                                                                                    |
| ---------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | failedParts | Parts which failed to be repacked at this resolution (try to increase the resolution or decrease the padding). |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### resizeUVsToTextureSize

Rescale the UV coordinates to fit the input texture size.

```python
algo.resizeUVsToTextureSize(occurrences, TextureSize=100, channel=0)
```

Parameters

| Type                                           | Name        | Description                                                  |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to use for the rescaling.                        |
| [Distance](./geom_types#distance)              | TextureSize | Texture size to use for the UV coordinates (in millimeters). |
| [Int](./core_types#int)                        | channel     | UV channel to use.                                           |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### scaleUV

Apply a scale on texture coordinates.

```python
algo.scaleUV(occurrences, scaleU, scaleV, channel=0)
```

Parameters

| Type                                           | Name        | Description                     |
| ---------------------------------------------- | ----------- | ------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Part occurrences to process.    |
| [Double](./core_types#double)                  | scaleU      | Scale to apply to U coordinate. |
| [Double](./core_types#double)                  | scaleV      | Scale to apply to V coordinate. |
| [Int](./core_types#int)                        | channel     | UV channel to transform.        |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### swapUvChannels

Swap two UV channels.

```python
algo.swapUvChannels(occurrences, firstChannel=0, secondChannel=0)
```

Parameters

| Type                                           | Name          | Description                  |
| ---------------------------------------------- | ------------- | ---------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences   | Part occurrences to process. |
| [Int](./core_types#int)                        | firstChannel  | First UV Channel to swap.    |
| [Int](./core_types#int)                        | secondChannel | Second UV Channel to swap.   |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.unwrapUV](./algo_functions#unwrapuv)

### unwrapUV

> **Important:**
>
> This function is tagged as experimental.

Unwrap UV islands.

```python
algo.unwrapUV(occurrences, method=0, channel=-1, createSeamsFromLoI=False, iterMax=50, tolerance=0.00001)
```

Parameters

| Type                                           | Name               | Description                                                          |
| ---------------------------------------------- | ------------------ | -------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences        | Part occurrences to process.                                         |
| [UnwrapUVMethod](./algo_types#unwrapuvmethod)  | method             | Minimization method to use for unwrapping (isometric or conformal).  |
| [Int](./core_types#int)                        | channel            | The UV channel which will contains the texture coordinates.          |
| [Boolean](./core_types#boolean)                | createSeamsFromLoI | Use Lines of Interest to generate UV islands.                        |
| [Int](./core_types#int)                        | iterMax            | For iterative solvers: set the maximum number of iterations allowed. |
| [Double](./core_types#double)                  | tolerance          | For iterative solvers: set the maximum error threshold.              |

See also:

* [algo.alignUVIslands](./algo_functions#alignuvislands)
* [algo.applyUvTransform](./algo_functions#applyuvtransform)
* [algo.automaticUVMapping](./algo_functions#automaticuvmapping)
* [algo.copyUV](./algo_functions#copyuv)
* [algo.getRatioUV3D](./algo_functions#getratiouv3d)
* [algo.getUVQualityMetrics](./algo_functions#getuvqualitymetrics)
* [algo.getUvAabr](./algo_functions#getuvaabr)
* [algo.hasOverlappingUV](./algo_functions#hasoverlappinguv)
* [algo.mapUvOnAABB](./algo_functions#mapuvonaabb)
* [algo.mapUvOnBox](./algo_functions#mapuvonbox)
* [algo.mapUvOnCubicAABB](./algo_functions#mapuvoncubicaabb)
* [algo.mapUvOnCustomAABB](./algo_functions#mapuvoncustomaabb)
* [algo.mapUvOnCylinder](./algo_functions#mapuvoncylinder)
* [algo.mapUvOnFittingCylinder](./algo_functions#mapuvonfittingcylinder)
* [algo.mapUvOnFittingSphere](./algo_functions#mapuvonfittingsphere)
* [algo.mapUvOnMBB](./algo_functions#mapuvonmbb)
* [algo.mapUvOnPlane](./algo_functions#mapuvonplane)
* [algo.mapUvOnSphere](./algo_functions#mapuvonsphere)
* [algo.mergeUVIslandsAffine](./algo_functions#mergeuvislandsaffine)
* [algo.mergeUVIslandsRelaxed](./algo_functions#mergeuvislandsrelaxed)
* [algo.normalizeUV](./algo_functions#normalizeuv)
* [algo.removeUV](./algo_functions#removeuv)
* [algo.repackUV](./algo_functions#repackuv)
* [algo.resizeUVsToTextureSize](./algo_functions#resizeuvstotexturesize)
* [algo.scaleUV](./algo_functions#scaleuv)
* [algo.swapUvChannels](./algo_functions#swapuvchannels)

## fitting

### getFittingCylinder

Returns the fitting cylinder of a set of occurrences (based on MBB).

```python
algo.getFittingCylinder(occurrences, useAABB=True, forcedAxis=geom.Vector3(0,0,0)) -> geom.Affine
```

Parameters

| Type                                           | Name        | Description                                                                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to fit.                                                                             |
| [Boolean](./core_types#boolean)                | useAABB     | If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |
| [Vector3](./geom_types#vector3)                | forcedAxis  | Forced axis of the Cylinder when using MBB.                                                     |

Returns

| Type                          | Name   | Description                            |
| ----------------------------- | ------ | -------------------------------------- |
| [Affine](./geom_types#affine) | affine | Affine transformation of the cylinder. |

See also:

* [algo.getFittingSphere](./algo_functions#getfittingsphere)

### getFittingSphere

Returns the fitting sphere of a set of occurrences.

```python
algo.getFittingSphere(occurrences, useAABB=True) -> geom.Affine
```

Parameters

| Type                                           | Name        | Description                                                                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to fit.                                                                             |
| [Boolean](./core_types#boolean)                | useAABB     | If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |

Returns

| Type                          | Name   | Description                          |
| ----------------------------- | ------ | ------------------------------------ |
| [Affine](./geom_types#affine) | affine | Affine transformation of the sphere. |

See also:

* [algo.getFittingCylinder](./algo_functions#getfittingcylinder)

## map\_generation

### convertNormalMap

Convert an existing normal map between Object-space and Tangent-space.

```python
algo.convertNormalMap(partOccurrences, normalMap, uvChannel=0, sourceSpace=0, destinationSpace=2, sourceIsRightHanded=True, destinationIsRightHanded=True, replaceMap=True, resolution=-1, padding=1) -> material.Image
```

Parameters

| Type                                           | Name                     | Description                                                                                                                                       |
| ---------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | partOccurrences          | Occurrences of components using the given map.                                                                                                    |
| [Image](./material_types#image)                | normalMap                | Source normal map to convert.                                                                                                                     |
| [Int](./core_types#int)                        | uvChannel                | UV channel used on the given map.                                                                                                                 |
| [Space](./algo_types#space)                    | sourceSpace              | Defines the space (object, world or tangent) from which the given normalMap is converted.                                                         |
| [Space](./algo_types#space)                    | destinationSpace         | Defines the space (object, world or tangent) to which the given normalMap is converted.                                                           |
| [Boolean](./core_types#boolean)                | sourceIsRightHanded      | Considers source normal map as part of a right-handed coordinates system.                                                                         |
| [Boolean](./core_types#boolean)                | destinationIsRightHanded | Generate destination normal map as part of a right-handed coordinates system.                                                                     |
| [Boolean](./core_types#boolean)                | replaceMap               | If true, the given normalMap will be replaced by the converted one.                                                                               |
| [Int](./core_types#int)                        | resolution               | New map resolution (if replaceMap=false), if resolution=-1, the input resolution will be used.                                                    |
| [Int](./core_types#int)                        | padding                  | Number of pixels to add for padding. A negative value means that the texture will be filled, and the padding for uv island is the absolute value. |

Returns

| Type                            | Name               | Description                                                 |
| ------------------------------- | ------------------ | ----------------------------------------------------------- |
| [Image](./material_types#image) | convertedNormalMap | Converted normal map (equals normalMap if replaceMap=true). |

See also:

* [algo.createBillboard](./algo_functions#createbillboard)
* [algo.fillNormalMap](./algo_functions#fillnormalmap)
* [algo.orientNormalMap](./algo_functions#orientnormalmap)

### createBillboard

Create a billboard imposter.

```python
algo.createBillboard(occurrences, resolution=1024, XPositive=True, XNegative=True, YPositive=True, YNegative=True, ZPositive=True, ZNegative=True, moveFacesToCenter=True, leftHandedNormalMap=False) -> scene.Occurrence
```

Parameters

| Type                                           | Name                | Description                                                                                           |
| ---------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences         | Occurrences to bake in the billboard.                                                                 |
| [Int](./core_types#int)                        | resolution          | Total resolution of the billboard (contains all wanted faces).                                        |
| [Bool](./core_types#bool)                      | XPositive           | Bake face facing X+.                                                                                  |
| [Bool](./core_types#bool)                      | XNegative           | Bake face facing X-.                                                                                  |
| [Bool](./core_types#bool)                      | YPositive           | Bake face facing Y+.                                                                                  |
| [Bool](./core_types#bool)                      | YNegative           | Bake face facing Y-.                                                                                  |
| [Bool](./core_types#bool)                      | ZPositive           | Bake face facing Z+.                                                                                  |
| [Bool](./core_types#bool)                      | ZNegative           | Bake face facing Z-.                                                                                  |
| [Bool](./core_types#bool)                      | moveFacesToCenter   | If true, all face are moved to the center of the AABB of the occurrences, else it will shape an AABB. |
| [Bool](./core_types#bool)                      | leftHandedNormalMap | If true, a left handed normal map will be generated.                                                  |

Returns

| Type                                   | Name      | Description          |
| -------------------------------------- | --------- | -------------------- |
| [Occurrence](./scene_types#occurrence) | billboard | Resulting billboard. |

See also:

* [algo.convertNormalMap](./algo_functions#convertnormalmap)
* [algo.fillNormalMap](./algo_functions#fillnormalmap)
* [algo.orientNormalMap](./algo_functions#orientnormalmap)

### fillNormalMap

> **Important:**
>
> This function is tagged as experimental.

Fill normal map (useful after a decimation for example).

```python
algo.fillNormalMap(normalMap)
```

Parameters

| Type                            | Name      | Description                   |
| ------------------------------- | --------- | ----------------------------- |
| [Image](./material_types#image) | normalMap | Source normal map to convert. |

See also:

* [algo.convertNormalMap](./algo_functions#convertnormalmap)
* [algo.createBillboard](./algo_functions#createbillboard)
* [algo.orientNormalMap](./algo_functions#orientnormalmap)

### orientNormalMap

> **Important:**
>
> This function is tagged as experimental.

Orient a tangent space normal map (all Z positive).

```python
algo.orientNormalMap(normalMap)
```

Parameters

| Type                            | Name      | Description           |
| ------------------------------- | --------- | --------------------- |
| [Image](./material_types#image) | normalMap | Normal map to orient. |

See also:

* [algo.convertNormalMap](./algo_functions#convertnormalmap)
* [algo.createBillboard](./algo_functions#createbillboard)
* [algo.fillNormalMap](./algo_functions#fillnormalmap)

## repair

### barySmooth

Smooth the tessellations by moving the vertices to the barycenter of their neighbors.

```python
algo.barySmooth(occurrences, iteration=1)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |
| [Int](./core_types#int)                        | iteration   | Number of iterations.                 |

See also:

* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### crackMoebiusStrips

Remove moebius strip by topologically cracking them (make it orientable).

```python
algo.crackMoebiusStrips(occurrences, maxEdgeCount=3)
```

Parameters

| Type                                           | Name         | Description                                                   |
| ---------------------------------------------- | ------------ | ------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences  | Occurrences of components to repair.                          |
| [Int](./core_types#int)                        | maxEdgeCount | Maximum number of edges to crack to remove one moebius strip. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### crackNonManifoldVertices

Splits non-manifold vertices.

```python
algo.crackNonManifoldVertices(occurrences)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to repair. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### createCavityOccurrences

Identify cavities and create occurrences to show them.

```python
algo.createCavityOccurrences(occurrences, voxelSize=100, minimumCavityVolume=1, mode=0, parent=None) -> scene.Occurrence
```

Parameters

| Type                                              | Name                | Description                                                                                                                             |
| ------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)    | occurrences         | Occurrences set to identify cavities.                                                                                                   |
| [Distance](./geom_types#distance)                 | voxelSize           | Size of the voxels in mm.                                                                                                               |
| [Volume](./geom_types#volume)                     | minimumCavityVolume | Minimum volume of a cavity in cubic meter.                                                                                              |
| [InnerOuterOption](./algo_types#innerouteroption) | mode                | Select where to place camera (all cavities, only outer or only inner cavities).                                                         |
| [Occurrence](./scene_types#occurrence)            | parent              | The create occurrence root will be added under the parent if given, else it will be added under the deeper parent of given occurrences. |

Returns

| Type                                   | Name | Description                                  |
| -------------------------------------- | ---- | -------------------------------------------- |
| [Occurrence](./scene_types#occurrence) | root | Parent occurrence of the cavity occurrences. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### invertPolygonFacesOrientation

Invert the orientation of tessellation elements.

```python
algo.invertPolygonFacesOrientation(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### moebiusCracker

Splits moebius ring.

```python
algo.moebiusCracker(occurrences)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to repair. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### orientNormals

Orient existing normal according to the polygons clockwise.

```python
algo.orientNormals(occurrences)
```

Parameters

| Type                                           | Name        | Description                                  |
| ---------------------------------------------- | ----------- | -------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to orient normals. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### remeshSurfacicHoles

> **Important:**
>
> This function is tagged as experimental.

Resmesh surfacic holes of tessellations.

```python
algo.remeshSurfacicHoles(occurrences, maxDiameter=0, refine=True, numberOfNeighbors=3, fillWithMaterial=0)
```

Parameters

| Type                                           | Name              | Description                                                   |
| ---------------------------------------------- | ----------------- | ------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences       | Occurrences of components to process.                         |
| [Distance](./geom_types#distance)              | maxDiameter       | Maximum surfacic holes diameters.                             |
| [Boolean](./core_types#boolean)                | refine            | Refine mesh for more details in holes.                        |
| [Int](./core_types#int)                        | numberOfNeighbors | Number of neighboring vertices to use for the MLS projection. |
| [Material](./material_types#material)          | fillWithMaterial  | If set, the given material will be used to fill the holes.    |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### removeDegeneratedPolygons

Remove some kinds of degenerated polygons.

```python
algo.removeDegeneratedPolygons(occurrences, tolerance=0.1)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |
| [Distance](./geom_types#distance)              | tolerance   | Degenerated tolerance.                |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### removeMultiplePolygon

Remove multiple polygon.

```python
algo.removeMultiplePolygon(occurrences)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to repair. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### removeZFighting

Remove Z-fighting (surfaces overlapping) by slightly shrinking the selected parts' surfaces.

```python
algo.removeZFighting(occurrences) -> geom.Distance
```

Parameters

| Type                                           | Name        | Description             |
| ---------------------------------------------- | ----------- | ----------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to process. |

Returns

| Type                              | Name   | Description                         |
| --------------------------------- | ------ | ----------------------------------- |
| [Distance](./geom_types#distance) | offset | Offset value used by the algorithm. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### repairMesh

Launch the repair process to repair a disconnected or not clean tessellation.

```python
algo.repairMesh(occurrences, tolerance=0.1, crackNonManifold=True, orient=True)
```

Parameters

| Type                                           | Name             | Description                                                           |
| ---------------------------------------------- | ---------------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences      | Occurrences of components to process.                                 |
| [Distance](./geom_types#distance)              | tolerance        | Connection tolerance.                                                 |
| [Bool](./core_types#bool)                      | crackNonManifold | At the end of the repair process, crack resulting non-manifold edges. |
| [Boolean](./core_types#boolean)                | orient           | If true reorient the model.                                           |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### repairNullNormals

Create normal on an existing normal set when normal is null (polygons appears black).

```python
algo.repairNullNormals(occurrences)
```

Parameters

| Type                                           | Name        | Description                                       |
| ---------------------------------------------- | ----------- | ------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to repair null normals. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### separateToManifold

> **Important:**
>
> This function is tagged as experimental.

Remove non manifold edges and try to reconnect manifold groups of triangles.

```python
algo.separateToManifold(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.sewBoundary](./algo_functions#sewboundary)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### sewBoundary

Sew boundaries between them.

```python
algo.sewBoundary(occurrences, maxDistance)
```

Parameters

| Type                                           | Name        | Description                          |
| ---------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to repair. |
| [Distance](./geom_types#distance)              | maxDistance | Maximum distance between bundaries.  |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.vertexOffset](./algo_functions#vertexoffset)

### vertexOffset

Move the vertices by the offsset along their normal.

```python
algo.vertexOffset(occurrences, offset=1)
```

Parameters

| Type                                           | Name        | Description             |
| ---------------------------------------------- | ----------- | ----------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences to process. |
| [Distance](./geom_types#distance)              | offset      | Displacement.           |

See also:

* [algo.barySmooth](./algo_functions#barysmooth)
* [algo.crackMoebiusStrips](./algo_functions#crackmoebiusstrips)
* [algo.crackNonManifoldVertices](./algo_functions#cracknonmanifoldvertices)
* [algo.createCavityOccurrences](./algo_functions#createcavityoccurrences)
* [algo.invertPolygonFacesOrientation](./algo_functions#invertpolygonfacesorientation)
* [algo.moebiusCracker](./algo_functions#moebiuscracker)
* [algo.orientNormals](./algo_functions#orientnormals)
* [algo.remeshSurfacicHoles](./algo_functions#remeshsurfacicholes)
* [algo.removeDegeneratedPolygons](./algo_functions#removedegeneratedpolygons)
* [algo.removeMultiplePolygon](./algo_functions#removemultiplepolygon)
* [algo.removeZFighting](./algo_functions#removezfighting)
* [algo.repairMesh](./algo_functions#repairmesh)
* [algo.repairNullNormals](./algo_functions#repairnullnormals)
* [algo.separateToManifold](./algo_functions#separatetomanifold)
* [algo.sewBoundary](./algo_functions#sewboundary)

## repair faces orientation

### orientFromFace

Orient all connected polygons in the same orientation of the polygon selectionned.

```python
algo.orientFromFace()
```

See also:

* [algo.orientPolygonFaces](./algo_functions#orientpolygonfaces)
* [algo.orientPolygonFacesAdvanced](./algo_functions#orientpolygonfacesadvanced)
* [algo.orientPolygonFacesFromCamera](./algo_functions#orientpolygonfacesfromcamera)

### orientPolygonFaces

Orient tessellation elements.

```python
algo.orientPolygonFaces(occurrences, makeOrientable=True, useArea=False, orientStrategy=0)
```

Parameters

| Type                                           | Name           | Description                                              |
| ---------------------------------------------- | -------------- | -------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences    | Occurrences of components to process.                    |
| [Boolean](./core_types#boolean)                | makeOrientable | Crack moebius strips to make the model orientable.       |
| [Boolean](./core_types#boolean)                | useArea        | Use the area instead of counting the number of triangle. |
| [OrientStrategy](./algo_types#orientstrategy)  | orientStrategy | Strategy to adopt with this algorithm.                   |

See also:

* [algo.orientFromFace](./algo_functions#orientfromface)
* [algo.orientPolygonFacesAdvanced](./algo_functions#orientpolygonfacesadvanced)
* [algo.orientPolygonFacesFromCamera](./algo_functions#orientpolygonfacesfromcamera)

### orientPolygonFacesAdvanced

Properly orient all polygons in the same direction, using voxel based view points placement.

```python
algo.orientPolygonFacesAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=64, mode=0, considerTransparentOpaque=True, orientStrategy=0)
```

Parameters

| Type                                                          | Name                      | Description                                                                                 |
| ------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                | occurrences               | Occurrences to orient.                                                                      |
| [Distance](./geom_types#distance)                             | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [Volume](./geom_types#volume)                                 | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [Int](./core_types#int)                                       | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_types#innerouteroption)             | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [Boolean](./core_types#boolean)                               | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [OrientStrategyAdvanced](./algo_types#orientstrategyadvanced) | orientStrategy            | Strategy to adopt with this algorithm.                                                      |

See also:

* [algo.orientFromFace](./algo_functions#orientfromface)
* [algo.orientPolygonFaces](./algo_functions#orientpolygonfaces)
* [algo.orientPolygonFacesFromCamera](./algo_functions#orientpolygonfacesfromcamera)

### orientPolygonFacesFromCamera

Properly orient all polygons in the same direction, using a specified viewpoint.

```python
algo.orientPolygonFacesFromCamera(occurrences, cameraPosition, cameraDirection, cameraUp, resolution=1024, fovX=90)
```

Parameters

| Type                                           | Name            | Description                           |
| ---------------------------------------------- | --------------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences     | Occurrences to orient.                |
| [Point3](./geom_types#point3)                  | cameraPosition  | Camera position.                      |
| [Point3](./geom_types#point3)                  | cameraDirection | Camera direction.                     |
| [Point3](./geom_types#point3)                  | cameraUp        | Camera up vector.                     |
| [Int](./core_types#int)                        | resolution      | Resolution of the visibility viewer.  |
| [Double](./core_types#double)                  | fovX            | Horizontal field of view (in degree). |

See also:

* [algo.orientFromFace](./algo_functions#orientfromface)
* [algo.orientPolygonFaces](./algo_functions#orientpolygonfaces)
* [algo.orientPolygonFacesAdvanced](./algo_functions#orientpolygonfacesadvanced)

## tessellation conversion

### equilateralize

Sswap edges to make triangles more equilateral.

```python
algo.equilateralize(occurrences, maxIterations=1)
```

Parameters

| Type                                           | Name          | Description                           |
| ---------------------------------------------- | ------------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences   | Occurrences of components to process. |
| [Int](./core_types#int)                        | maxIterations | Maximum number of swapping iteration. |

See also:

* [algo.quadify](./algo_functions#quadify)
* [algo.requadify](./algo_functions#requadify)
* [algo.triangularize](./algo_functions#triangularize)

### quadify

Merge all triangle polygons in the meshes to quadrangles.

```python
algo.quadify(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

See also:

* [algo.equilateralize](./algo_functions#equilateralize)
* [algo.requadify](./algo_functions#requadify)
* [algo.triangularize](./algo_functions#triangularize)

### requadify

Advanced function to requadify a triangle tessellation coming from full quad mesh.

```python
algo.requadify(occurrences, forceFullQuad=True)
```

Parameters

| Type                                           | Name          | Description                                                                  |
| ---------------------------------------------- | ------------- | ---------------------------------------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences   | Occurrences of components to process.                                        |
| [Bool](./core_types#bool)                      | forceFullQuad | Force the results to be only full quad. It it's impossible, nothing is done. |

See also:

* [algo.equilateralize](./algo_functions#equilateralize)
* [algo.quadify](./algo_functions#quadify)
* [algo.triangularize](./algo_functions#triangularize)

### triangularize

Split all non-triangle polygons in the meshes to triangles.

```python
algo.triangularize(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

See also:

* [algo.equilateralize](./algo_functions#equilateralize)
* [algo.quadify](./algo_functions#quadify)
* [algo.requadify](./algo_functions#requadify)

## vertex weights

### createVertexWeightsFromVertexColors

Use vertex colors attributes on meshes of the given occurrence to create vertex weights attributes used by the decimation functions. If strategy is set to RedBlueDiff (default), the finals weights will be computed with w = offset + (red - blue) \* scale. If strategy is set to Grayscale, weights are computed with w = offset + red \* scale. If strategy is InvertedGrayscale, weights are calculated with w = offset + (1-red) \* scale.

```python
algo.createVertexWeightsFromVertexColors(occurrences, offset=0, scale=1, strategy=0)
```

Parameters

| Type                                                      | Name        | Description                           |
| --------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)            | occurrences | Occurrences of components to process. |
| [Double](./core_types#double)                             | offset      | Offset value for weight computation.  |
| [Double](./core_types#double)                             | scale       | Scale value for weight computation.   |
| [VertexWeightStrategy](./algo_types#vertexweightstrategy) | strategy    | How vertex weights are computed.      |

See also:

* [algo.createVertexWeightsFromVisibilityAttributes](./algo_functions#createvertexweightsfromvisibilityattributes)
* [algo.deleteVertexWeights](./algo_functions#deletevertexweights)

### createVertexWeightsFromVisibilityAttributes

Use visibility attributes on meshes of the given occurrence to create vertex weights attributes used by the decimation functions. The finals weights will be computed with w = offset + (visibility/maxVisibility) \* scale.

```python
algo.createVertexWeightsFromVisibilityAttributes(occurrences, offset=0, scale=1)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |
| [Double](./core_types#double)                  | offset      | Offset value for weight computation.  |
| [Double](./core_types#double)                  | scale       | Scale value for weight computation.   |

See also:

* [algo.createVertexWeightsFromVertexColors](./algo_functions#createvertexweightsfromvertexcolors)
* [algo.deleteVertexWeights](./algo_functions#deletevertexweights)

### deleteVertexWeights

Remove any existing vertex weights attributes on given occurrences.

```python
algo.deleteVertexWeights(occurrences)
```

Parameters

| Type                                           | Name        | Description                           |
| ---------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to process. |

See also:

* [algo.createVertexWeightsFromVertexColors](./algo_functions#createvertexweightsfromvertexcolors)
* [algo.createVertexWeightsFromVisibilityAttributes](./algo_functions#createvertexweightsfromvisibilityattributes)

## visibility

### createVisibilityAttributes

Create visibility attributes on tessellations.

```python
algo.createVisibilityAttributes(occurrences)
```

Parameters

| Type                                           | Name        | Description                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to create attributes. |

See also:

* [algo.deletePolygonalWeightAttribute](./algo_functions#deletepolygonalweightattribute)
* [algo.deleteVisibilityAttributes](./algo_functions#deletevisibilityattributes)
* [algo.flagVisibilityAttributesOnTransparents](./algo_functions#flagvisibilityattributesontransparents)
* [algo.transferVisibilityToPolygonalWeight](./algo_functions#transfervisibilitytopolygonalweight)

### deletePolygonalWeightAttribute

> **Important:**
>
> This function is tagged as experimental.

Delete Polygonal Weight attributes on tessellations.

```python
algo.deletePolygonalWeightAttribute(occurrences)
```

Parameters

| Type                                           | Name        | Description                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to delete attributes. |

See also:

* [algo.createVisibilityAttributes](./algo_functions#createvisibilityattributes)
* [algo.deleteVisibilityAttributes](./algo_functions#deletevisibilityattributes)
* [algo.flagVisibilityAttributesOnTransparents](./algo_functions#flagvisibilityattributesontransparents)
* [algo.transferVisibilityToPolygonalWeight](./algo_functions#transfervisibilitytopolygonalweight)

### deleteVisibilityAttributes

Delete visibility attributes on tessellations.

```python
algo.deleteVisibilityAttributes(occurrences)
```

Parameters

| Type                                           | Name        | Description                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to delete attributes. |

See also:

* [algo.createVisibilityAttributes](./algo_functions#createvisibilityattributes)
* [algo.deletePolygonalWeightAttribute](./algo_functions#deletepolygonalweightattribute)
* [algo.flagVisibilityAttributesOnTransparents](./algo_functions#flagvisibilityattributesontransparents)
* [algo.transferVisibilityToPolygonalWeight](./algo_functions#transfervisibilitytopolygonalweight)

### flagVisibilityAttributesOnTransparents

Add one count to all visiblility attributes (poly and patch) on transparent patches.

```python
algo.flagVisibilityAttributesOnTransparents(occurrences)
```

Parameters

| Type                                           | Name        | Description                                     |
| ---------------------------------------------- | ----------- | ----------------------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist) | occurrences | Occurrences of components to create attributes. |

See also:

* [algo.createVisibilityAttributes](./algo_functions#createvisibilityattributes)
* [algo.deletePolygonalWeightAttribute](./algo_functions#deletepolygonalweightattribute)
* [algo.deleteVisibilityAttributes](./algo_functions#deletevisibilityattributes)
* [algo.transferVisibilityToPolygonalWeight](./algo_functions#transfervisibilitytopolygonalweight)

### transferVisibilityToPolygonalWeight

> **Important:**
>
> This function is tagged as experimental.

Set Polygonal Weight Attribute from Visibility Attribute.

```python
algo.transferVisibilityToPolygonalWeight(occurrences, Mode=0)
```

Parameters

| Type                                                          | Name        | Description                      |
| ------------------------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_types#occurrencelist)                | occurrences | Part occurrences to process.     |
| [VisibilityToWeightMode](./algo_types#visibilitytoweightmode) | Mode        | Mode used to compute visibility. |

See also:

* [algo.createVisibilityAttributes](./algo_functions#createvisibilityattributes)
* [algo.deletePolygonalWeightAttribute](./algo_functions#deletepolygonalweightattribute)
* [algo.deleteVisibilityAttributes](./algo_functions#deletevisibilityattributes)
* [algo.flagVisibilityAttributesOnTransparents](./algo_functions#flagvisibilityattributesontransparents)
