# AlgoInterface

> Class

Inheritance

* [object](https://learn.microsoft.com/dotnet/api/system.object)
* [Interface](./api_interface)
* AlgoInterface

***

Inherited Members

* [Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\))

* [Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\))

* [GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

* [GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)

* [MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

* [ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

* [ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

***

Namespace: UnityEngine.Pixyz.Algo

```csharp
public class AlgoInterface : Interface
```

## Methods

### GetLastError

```csharp
public static string GetLastError()
```

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### AssembleCAD

Assemble faces of CAD shapes.

```csharp
[HandleProcessCorruptedStateExceptions]
public void AssembleCAD(OccurrenceList occurrences, double tolerance, bool removeDuplicatedFaces = true)
```

Parameters

| Type                                                           | Name                  | Description                                |
| -------------------------------------------------------------- | --------------------- | ------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences           | Occurrences of components to assemble.     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance             | Assembling tolerance.                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | removeDuplicatedFaces | If True, duplicated faces will be removed. |

### BackToInitialBRep

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void BackToInitialBRep(OccurrenceList occurrences)
```

Parameters

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

### BakeImpostor

Bakes impostors textures.

```csharp
[HandleProcessCorruptedStateExceptions]
public OctahedralImpostor BakeImpostor(uint occurrence, int XFrames, int YFrames, bool hemi = false, int resolution = 1024, int padding = 0, bool roughness = false, bool metallic = false, bool ao = false)
```

Parameters

| Type                                                          | Name       | Description |
| ------------------------------------------------------------- | ---------- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | occurrence |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | XFrames    |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | YFrames    |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | hemi       |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | resolution |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | padding    |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | roughness  |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | metallic   |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | ao         |             |

Returns

| Type                                            | Description |
| ----------------------------------------------- | ----------- |
| [OctahedralImpostor](./algo_octahedralimpostor) |             |

### BakeVertexAttributes

Bake vertex attributes on meshes from other meshes.

```csharp
[HandleProcessCorruptedStateExceptions]
public void BakeVertexAttributes(OccurrenceList destinationOccurrences, OccurrenceList sourceOccurrences, bool skinnedMesh, bool positions, bool useCurrentPositionAsTPose = false)
```

Parameters

| Type                                                          | Name                      | Description                                                              |
| ------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | destinationOccurrences    | Occurrences of the meshes where to store the baked vertex attributes.    |
| [OccurrenceList](./scene_occurrencelist)                      | sourceOccurrences         | Occurrences of components from which to bake vertex attributes.          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | skinnedMesh               | Enabling skinned mesh baking (joint assignation for animation transfer). |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | positions                 | Enabling vertex position baking.                                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useCurrentPositionAsTPose | Use the current position as the T-Pose.                                  |

### CalculateNormalsInPointClouds

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CalculateNormalsInPointClouds(OccurrenceList occurrences)
```

Parameters

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

### ConfigureFunctionLogger

```csharp
[HandleProcessCorruptedStateExceptions]
public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
```

Parameters

| Type                                                           | Name                | Description |
| -------------------------------------------------------------- | ------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | functionName        |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableFunction      |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableParameters    |             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | enableExecutionTime |             |

### CrackCADMoebiusStrip

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CrackCADMoebiusStrip(OccurrenceList occurrences)
```

Parameters

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

### CrackEdges

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

```csharp
[Obsolete]
[HandleProcessCorruptedStateExceptions]
public void CrackEdges(OccurrenceList occurrences, bool useAttributesFilter = true, double sharpAngleFilter = 45, bool useNonManifoldFilter = false)
```

Parameters

| Type                                                           | Name                 | Description                                                                                 |
| -------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences          | Occurrences of components to process.                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useAttributesFilter  | Filters by attribute.                                                                       |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sharpAngleFilter     | Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useNonManifoldFilter | Filters by manifold-ness.                                                                   |

### CrackMeshEdges

Crack polygonal edges according to given criteria.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CrackMeshEdges(OccurrenceList occurrences, bool normal = false, bool uvs = false, IntList uvChannels = null, bool loi = false, bool patches = false, bool nman = false)
```

Parameters

| Type                                                          | Name        | Description                                                                           |
| ------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences of components to process.                                                 |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | normal      | Crack on sharp normals.                                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | uvs         | Crack on UV seams.                                                                    |
| [IntList](./core_intlist)                                     | uvChannels  | If empty and uvs=true, crack all UV channel, else only channel specified in the list. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | loi         | Crack on identifier Lines of Interests.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | patches     | Crack on patch borders.                                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | nman        | Crack on non-manifolds.                                                               |

### CreateFreeEdgesFromPatches

Create free edges from patch borders.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateFreeEdgesFromPatches(OccurrenceList occurrences)
```

Parameters

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

### CreateIdentifiedPatchesFromPatches

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateIdentifiedPatchesFromPatches(OccurrenceList occurrences)
```

Parameters

| Type                                     | Name        | Description                           |
| ---------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_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.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint CreateIndexMapFromOccurrences(OccurrenceList occurrences, int uvChannel, bool createTexture1D)
```

Parameters

| Type                                                          | Name            | Description                                                                                                                                           |
| ------------------------------------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences     |                                                                                                                                                       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | uvChannel       |                                                                                                                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | 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                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### CreateNormals

Create normal attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateNormals(OccurrenceList occurrences, double sharpEdge = 45, bool overriding = true, bool useAreaWeighting = false)
```

Parameters

| Type                                                           | Name             | Description                                                                                                                   |
| -------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences      | Occurrences of components to create attributes.                                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sharpEdge        | Edges with an angle between their polygons greater than sharpEdge will be considered sharp. If negative, smooth normals only. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overriding       | If true, override existing normals, else only create normals on meshes without normals.                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint CreatePointCloudKDTree(OccurrenceList occurrences, int depth, bool addToScene = true)
```

Parameters

| Type                                                          | Name        | Description                           |
| ------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences to process.               |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | depth       | Kd tree depth.                        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | addToScene  | Add the KD-Tree to the current scene. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### CreateTangents

Create tangent attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateTangents(OccurrenceList occurrences, int uvChannel = 0, bool overriding = true)
```

Parameters

| Type                                                          | Name        | Description                                                                                |
| ------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences of components to create attributes.                                            |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | uvChannel   | UV channel to use for the tangents creation.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overriding  | 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVertexColorFromMaterials(OccurrenceList occurrenceList)
```

Parameters

| Type                                     | Name           | Description |
| ---------------------------------------- | -------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) | occurrenceList |             |

### CreateVisibilityPatchesFromPatch

Create visibility patches from existing patches.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVisibilityPatchesFromPatch(OccurrenceList occurrences)
```

Parameters

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

### Decimate

Reduce the polygon count by removing some vertices.

```csharp
[HandleProcessCorruptedStateExceptions]
public void Decimate(OccurrenceList occurrences, double surfacicTolerance, double lineicTolerance = 0.1, double normalTolerance = 5, double texCoordTolerance = -1, bool releaseConstraintOnSmallArea = false)
```

Parameters

| Type                                                           | Name                         | Description                                                                                                      |
| -------------------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences                  | Occurrences of components to process.                                                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | surfacicTolerance            | Maximum distance between surfacic vertices and resulting simplified surfaces.                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | lineicTolerance              | Maximum distance between lineic vertices and resulting simplified lines.                                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | normalTolerance              | Maximum angle between original normals and those interpolated on the simplified surface.                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | texCoordTolerance            | Maximum distance (in 3D space) between original texcoords and those interpolated on the simplified surface.      |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DecimateEdgeCollapse(OccurrenceList occurrences, double surfacicTolerance, double boundaryWeight = 1, double normalWeight = 1, double UVWeight = 1, double sharpNormalWeight = 1, double UVSeamWeight = 10, double normalMaxDeviation = -1, bool forbidUVOverlaps = true, double UVMaxDeviation = -1, double UVSeamMaxDeviation = -1, bool protectTopology = false, QualitySpeedTradeoff qualityTradeoff = QualitySpeedTradeoff.PreferQuality)
```

Parameters

| Type                                                           | Name               | Description                                                                                                                                                        |
| -------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Occurrences of components to process.                                                                                                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | surfacicTolerance  | Error max between the simplified mesh et the old one.                                                                                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | boundaryWeight     | Boundary importance during the decimation.                                                                                                                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | normalWeight       | Normal importance during the decimation.                                                                                                                           |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | UVWeight           | UV importance during the decimation.                                                                                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sharpNormalWeight  | Importance of sharp edges during the decimation.                                                                                                                   |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | UVSeamWeight       | Importance of UV seams during the decimation.                                                                                                                      |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | normalMaxDeviation | Constraint the normals deviation on decimated model.                                                                                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | forbidUVOverlaps   | Forbid UV to fold over and overlap during the decimation.                                                                                                          |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | UVMaxDeviation     | Constraint the uv deviation on decimated model.                                                                                                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | UVSeamMaxDeviation | Constraint the uv seams deviation on decimated model.                                                                                                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.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_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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DecimatePointClouds(OccurrenceList occurrences, double tolerance = 500)
```

Parameters

| Type                                                           | Name        | Description                      |
| -------------------------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 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).

```csharp
[HandleProcessCorruptedStateExceptions]
public void DecimateTarget(OccurrenceList occurrences, DecimateOptionsSelector targetStrategy, UVImportanceEnum UVImportance = UVImportanceEnum.PreserveSeamsAndReduceDeformation, bool protectTopology = false, ulong iterativeThreshold = 5000000, bool processMeshIndependently = false, int maxQuadricAge = -1)
```

Parameters

| Type                                                          | Name                     | Description                                                                                                                            |
| ------------------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences              | List of occurrences to process.                                                                                                        |
| [DecimateOptionsSelector](./algo_decimateoptionsselector)     | targetStrategy           | Select between targetCount or ratio to define the number of triangles left after the decimation process.                               |
| [UVImportanceEnum](./algo_uvimportanceenum)                   | UVImportance             | Select importance of texture coordinates.                                                                                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | protectTopology          | If False, the topology of the mesh can change and some edges can become non-manifold.                                                  |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | iterativeThreshold       | Number of triangles above which the iterative algorithm is used to limit the memory usage (disabled if processMeshIndependently=True). |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | processMeshIndependently | If true, each mesh will be processed independently and the triangleCount or ratio will apply by mesh (disable iterative method).       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteAttribute(uint occurrence, AttributeType type)
```

Parameters

| Type                                                         | Name       | Description                          |
| ------------------------------------------------------------ | ---------- | ------------------------------------ |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | occurrence | Occurrence to delete attribute from. |
| [AttributeType](./algo_attributetype)                        | type       | Attribute type.                      |

### DeleteBRepShapes

Delete BRep representation on parts.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteBRepShapes(OccurrenceList occurrences, bool onlyTessellated = true)
```

Parameters

| Type                                                          | Name            | Description                                                                |
| ------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences     | Occurrences of components to process.                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteFreeVertices(OccurrenceList occurrences)
```

Parameters

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

### DeleteLines

Delete all free line of the mesh of given parts.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteLines(OccurrenceList occurrences)
```

Parameters

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

### DeleteNormals

Remove normal attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteNormals(OccurrenceList occurrences)
```

Parameters

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

### DeletePatches

Delete patches attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeletePatches(OccurrenceList occurrences, bool keepOnePatchByMaterial = true)
```

Parameters

| Type                                                          | Name                   | Description                                                                                                         |
| ------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences            | Occurrences of components to process.                                                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeletePolygons(OccurrenceList occurrences)
```

Parameters

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

### DeleteTangents

Remove tangent attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteTangents(OccurrenceList occurrences)
```

Parameters

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

### DeleteTextureCoordinates

Delete texture coordinates on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteTextureCoordinates(OccurrenceList occurrences, int channel = -1)
```

Parameters

| Type                                                       | Name        | Description                                                         |
| ---------------------------------------------------------- | ----------- | ------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Occurrences of components to process.                               |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | channel     | Choose Texture coordinates channel to delete (-1 for all channels). |

### DeleteVisibilityPatches

Delete the visibility patches of given occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteVisibilityPatches(OccurrenceList occurrences)
```

Parameters

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

### EvalDecimateErrorForTarget

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

```csharp
[HandleProcessCorruptedStateExceptions]
public double EvalDecimateErrorForTarget(OccurrenceList occurrences, DecimateOptionsSelector TargetStrategy, double boundaryWeight = 1, double normalWeight = 1, double UVWeight = 1, double sharpNormalWeight = 1, double UVSeamWeight = 10, bool forbidUVFoldovers = true, bool protectTopology = false)
```

Parameters

| Type                                                           | Name              | Description                                                                                                                                                            |
| -------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences       | List of occurrences to process.                                                                                                                                        |
| [DecimateOptionsSelector](./algo_decimateoptionsselector)      | TargetStrategy    | Select between targetCount or ratio to define the number of triangles left after the decimation process.                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | boundaryWeight    | Defines how important the edges defining the mesh boundaries (free edges) are during the decimation process, to preserve them from distortion.                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | normalWeight      | Defines how important vertex normals are during the decimation process, to preserve the smoothing of the mesh from being damaged.                                      |
| [double](https://learn.microsoft.com/dotnet/api/system.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](https://learn.microsoft.com/dotnet/api/system.double) | sharpNormalWeight | Defines how important sharp edges (or hard edges) are during the decimation process, to preserve them from being distorted.                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.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). |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | forbidUVFoldovers | Forbids UVs to fold over and overlap each other during the decimation.                                                                                                 |
| [bool](https://learn.microsoft.com/dotnet/api/system.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                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) |             |

### ExtractNeutralAxis

Extract neutral axis from tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExtractNeutralAxis(OccurrenceList occurrences, double maxDiameter, bool removeOriginalMesh)
```

Parameters

| Type                                                           | Name               | Description                                                  |
| -------------------------------------------------------------- | ------------------ | ------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Occurrences of components to process.                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDiameter        | Maximum diameter of beams.                                   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | removeOriginalMesh | Remove or not the original mesh at the end of the algorithm. |

### FilletMesh

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void FilletMesh(OccurrenceList occurrences, double value, FilletingMode filletingMode = FilletingMode.Width, int subdivisionNb = 0, bool createFlatChamfer = false, uint material = 0, int uvChannel = -1)
```

Parameters

| Type                                                           | Name              | Description                                                                                    |
| -------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences       | Input occurrences.                                                                             |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | value             | Value (mm).                                                                                    |
| [FilletingMode](./algo_filletingmode)                          | filletingMode     | Filleting mode.                                                                                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | subdivisionNb     | Number of subdivision.                                                                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createFlatChamfer | If there is 0 subdivision, should the fillet be a planar flat chamfer?.                        |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | material          | Material to apply to created fillets. Default: use a random neighbor material.                 |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void FilterHiddenPolygons(OccurrenceList occurrences, double voxelSize)
```

Parameters

| Type                                                           | Name        | Description                  |
| -------------------------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Size of voxels.              |

### FilterMeshVertexColors

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void FilterMeshVertexColors(OccurrenceList occurrences, double sigmaPos = 5, double sigmaValue = 0.2, double sigmaNormal = 15)
```

Parameters

| Type                                                           | Name        | Description                                                                                                 |
| -------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Mesh occurrences the filter must be applied on.                                                             |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sigmaPos    | Variance of the Gaussian filter applied to distances between adjacent vertex positions.                     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sigmaValue  | Variance of the Gaussian filter applied to differences between adjacent vertex colors (in \[0, 1]).         |
| [double](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public Matrix4 FindBestPivotBetweenOccurrences(OccurrenceList assembly1, OccurrenceList assembly2, double precision = -1)
```

Parameters

| Type                                                           | Name      | Description                                          |
| -------------------------------------------------------------- | --------- | ---------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | assembly1 | Set occurrences 1.                                   |
| [OccurrenceList](./scene_occurrencelist)                       | assembly2 | Set occurrences 2.                                   |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | precision | Precision used to determine if elements are similar. |

Returns

| Type                      | Description |
| ------------------------- | ----------- |
| [Matrix4](./geom_matrix4) |             |

### GetAllAxisFromCADModel

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

```csharp
[HandleProcessCorruptedStateExceptions]
public GetAllAxisFromCADModelReturn GetAllAxisFromCADModel(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                                                | Description |
| ------------------------------------------------------------------- | ----------- |
| [GetAllAxisFromCADModelReturn](./algo_getallaxisfromcadmodelreturn) |             |

### GetMeshVertexColors

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

```csharp
[HandleProcessCorruptedStateExceptions]
public ColorAlphaListList GetMeshVertexColors(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                            | Description |
| ----------------------------------------------- | ----------- |
| [ColorAlphaListList](./core_coloralphalistlist) |             |

### GetOptimalTextureResolution

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

```csharp
[HandleProcessCorruptedStateExceptions]
public int GetOptimalTextureResolution(OccurrenceList occurrences, double texelPerMm)
```

Parameters

| Type                                                           | Name        | Description                                                 |
| -------------------------------------------------------------- | ----------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences on which to compute optimal texture resolution. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | texelPerMm  | Number of texel per millimeter in a 3D space.               |

Returns

| Type                                                       | Description |
| ---------------------------------------------------------- | ----------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) |             |

### GetTessellations

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

```csharp
[HandleProcessCorruptedStateExceptions]
public TessellationList GetTessellations(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                             | Description |
| ------------------------------------------------ | ----------- |
| [TessellationList](./polygonal_tessellationlist) |             |

### GetUV3dRatio

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

```csharp
[HandleProcessCorruptedStateExceptions]
public double GetUV3dRatio(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) |             |

### GetVisibilityStats

Returns the visibility statistics for some occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public GetVisibilityStatsReturn GetVisibilityStats(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                                        | Description |
| ----------------------------------------------------------- | ----------- |
| [GetVisibilityStatsReturn](./algo_getvisibilitystatsreturn) |             |

### GetVisualComparisonFootprint

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

```csharp
[HandleProcessCorruptedStateExceptions]
public double GetVisualComparisonFootprint(OccurrenceList originalOccurrences, OccurrenceList comparedOccurrences, int resolution = 512, int viewpointCount = 256, double threshold = 0.2, bool onHemisphereOnly = false)
```

Parameters

| Type                                                           | Name                | Description                                                                   |
| -------------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | originalOccurrences | Set of occurrences representing the ground truth.                             |
| [OccurrenceList](./scene_occurrencelist)                       | comparedOccurrences | Set of occurrences to compare with the ground truth.                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution          | Resolution of the viewer.                                                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | viewpointCount      | Number of viewpoints generated around the bounding sphere of all occurrences. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | threshold           | Tolerance for pixel comparison.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | onHemisphereOnly    | Create viewpoints only in the Y+ hemisphere of the bounding sphere.           |

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) |             |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void IdentifyLinesOfInterest(OccurrenceList occurrences, bool normal = false, bool uvs = false, IntList uvChannels = null, bool border = false, bool patches = false, bool nman = false)
```

Parameters

| Type                                                          | Name        | Description                                                                                    |
| ------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences of components to process.                                                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | normal      | Add LoI on sharp normals.                                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | uvs         | Add LoI on UV seams.                                                                           |
| [IntList](./core_intlist)                                     | uvChannels  | If empty and uvs=true, add LoI using all UV channels, else only channel specified in the list. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | border      | Add LoI on boundary edges.                                                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | patches     | Add LoI on submesh borders.                                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | nman        | Add LoI on non-manifolds edges.                                                                |

### IdentifyPatches

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void IdentifyPatches(OccurrenceList occurrences, bool useAttributesFilter = true, double sharpAngleFilter = 45, bool useBoundaryFilter = true, bool useNonManifoldFilter = true, bool useLineEdgeFilter = true, bool useQuadLineFilter = false)
```

Parameters

| Type                                                           | Name                 | Description                                                                                 |
| -------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences          | Occurrences of components to process.                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useAttributesFilter  | Filters by attributes.                                                                      |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sharpAngleFilter     | Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useBoundaryFilter    | Filters by boundaries.                                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useNonManifoldFilter | Filters by manifold-ness.                                                                   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useLineEdgeFilter    | Filters by edge.                                                                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useQuadLineFilter    | Filters by quad lines.                                                                      |

### IdentifySharpEdges

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void IdentifySharpEdges(OccurrenceList occurrences, double minSharpAngle, double maxSharpAngle = 180, ConvexityFilter convexity = ConvexityFilter.OnConvexAndConcave, bool onlyExplicitSharp = false)
```

Parameters

| Type                                                           | Name              | Description                                                                                               |
| -------------------------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences       | Input occurrences.                                                                                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minSharpAngle     | The angle between the normals - all edges sharpest than this will be filleted.                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxSharpAngle     | All edges sharpest than this won't be filleted.                                                           |
| [ConvexityFilter](./algo_convexityfilter)                      | convexity         | Fillet sharp edges that are convex, concave or both.                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void InvertTangents(OccurrenceList occurrences, bool invertW = true)
```

Parameters

| Type                                                          | Name        | Description                                                                      |
| ------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences to invert tangents on.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | invertW     | If true, only inverse the w components of tangent. Else, inverse the xyz vector. |

### LineToTexture

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void LineToTexture(OccurrenceList lines, UseColorOption useColor, int resolution = 512, int thickness = 5)
```

Parameters

| Type                                                       | Name       | Description                           |
| ---------------------------------------------------------- | ---------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | lines      | Lines to select.                      |
| [UseColorOption](./algo_usecoloroption)                    | useColor   | Set color policy.                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | resolution | Texture resolution.                   |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | thickness  | The thickness of the lines in pixels. |

### ListFeatures

List features from tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceFeaturesList ListFeatures(OccurrenceList occurrences, bool throughHoles = true, bool blindHoles = false, double maxDiameter = -1)
```

Parameters

| Type                                                           | Name         | Description                                                    |
| -------------------------------------------------------------- | ------------ | -------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences  | Occurrences of components to process.                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | throughHoles | List through holes.                                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | blindHoles   | List blind holes.                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDiameter  | Maximum diameter of the holes to be list (-1=no max diameter). |

Returns

| Type                                                    | Description |
| ------------------------------------------------------- | ----------- |
| [OccurrenceFeaturesList](./algo_occurrencefeatureslist) |             |

### LoopSubdivMesh

Apply Loop Subdivision on Triangle-only Mesh.

```csharp
[HandleProcessCorruptedStateExceptions]
public void LoopSubdivMesh(OccurrenceList occurrences, int depth)
```

Parameters

| Type                                                       | Name        | Description                           |
| ---------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Occurrences of components to process. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | depth       | Subdivision depth.                    |

### MergeVertices

Merge near vertices according to the given distance.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MergeVertices(OccurrenceList occurrences, double maxDistance, TopologyCategoryMask mask)
```

Parameters

| Type                                                           | Name        | Description                                    |
| -------------------------------------------------------------- | ----------- | ---------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to process.          |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDistance | Maximum distance between two vertex to merge.  |
| [TopologyCategoryMask](./polygonal_topologycategorymask)       | mask        | Topological category of the vertices to merge. |

### MeshBooleanOperation

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint MeshBooleanOperation(OccurrenceList occurrencesA, OccurrenceList occurrencesB, MeshBooleanOperation operation)
```

Parameters

| Type                                                | Name         | Description               |
| --------------------------------------------------- | ------------ | ------------------------- |
| [OccurrenceList](./scene_occurrencelist)            | occurrencesA | Occurrences A.            |
| [OccurrenceList](./scene_occurrencelist)            | occurrencesB | Occurrences B.            |
| [MeshBooleanOperation](./algo_meshbooleanoperation) | operation    | The operation to perform. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### MeshComparison

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

```csharp
[HandleProcessCorruptedStateExceptions]
public double MeshComparison(uint mesh_1, uint mesh_2)
```

Parameters

| Type                                                         | Name    | Description |
| ------------------------------------------------------------ | ------- | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | mesh\_1 |             |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | mesh\_2 |             |

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) |             |

### MeshComparisonBatch

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

```csharp
[HandleProcessCorruptedStateExceptions]
public DistanceList MeshComparisonBatch(OccurrenceList meshes1, OccurrenceList meshes2)
```

Parameters

| Type                                     | Name    | Description |
| ---------------------------------------- | ------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) | meshes1 |             |
| [OccurrenceList](./scene_occurrencelist) | meshes2 |             |

Returns

| Type                                | Description |
| ----------------------------------- | ----------- |
| [DistanceList](./geom_distancelist) |             |

### MeshIntersections

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

```csharp
[HandleProcessCorruptedStateExceptions]
public Point3ListList MeshIntersections(OccurrenceList occurrencesA, OccurrenceList occurrencesB)
```

Parameters

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

Returns

| Type                                    | Description |
| --------------------------------------- | ----------- |
| [Point3ListList](./geom_point3listlist) |             |

### NoiseMesh

Apply noise to vertex positions along their normals.

```csharp
[HandleProcessCorruptedStateExceptions]
public void NoiseMesh(OccurrenceList occurrences, double maxAmplitude)
```

Parameters

| Type                                                           | Name         | Description                                                |
| -------------------------------------------------------------- | ------------ | ---------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences  | Part occurrencess to noise.                                |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxAmplitude | Maximum distance between original vertex and noisy vertex. |

### OptimizeCADLoops

Optimize CAD Face loops by merging useless loop edges.

```csharp
[HandleProcessCorruptedStateExceptions]
public void OptimizeCADLoops(OccurrenceList occurrences)
```

Parameters

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

### OptimizeForRendering

Optimize mesh for rendering (lossless, only reindexing).

```csharp
[HandleProcessCorruptedStateExceptions]
public void OptimizeForRendering(OccurrenceList occurrences)
```

Parameters

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

### OptimizeSubMeshes

Sort sub meshes by materials.

```csharp
[HandleProcessCorruptedStateExceptions]
public void OptimizeSubMeshes(OccurrenceList occurrences)
```

Parameters

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

### OptimizeTextureSize

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void OptimizeTextureSize(uint root, double texelPerMm)
```

Parameters

| Type                                                           | Name       | Description                                    |
| -------------------------------------------------------------- | ---------- | ---------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root       | Root from which texture resizing will process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | texelPerMm | Number of texel per millimeter in a 3D space.  |

### RemoveHoles

Remove some features from tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemoveHoles(OccurrenceList occurrences, bool throughHoles, bool blindHoles, bool surfacicHoles, double maxDiameter, uint fillWithMaterial = 0)
```

Parameters

| Type                                                           | Name             | Description                                                       |
| -------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences      | Occurrences of components to process.                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | throughHoles     | Remove through holes.                                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | blindHoles       | Remove blind holes.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | surfacicHoles    | Remove surfacic holes.                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDiameter      | Maximum diameter of the holes to be removed (-1=no max diameter). |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RepairCAD(OccurrenceList occurrences, double tolerance, bool orient = true)
```

Parameters

| Type                                                           | Name        | Description                         |
| -------------------------------------------------------------- | ----------- | ----------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to clean. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance   | Tolerance.                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | orient      | If true reorient the model.         |

### SegmentMesh

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SegmentMesh(OccurrenceList occurrences, bool overwriteLoI = true)
```

Parameters

| Type                                                          | Name         | Description                                                        |
| ------------------------------------------------------------- | ------------ | ------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences  | Occurrences of components to process.                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overwriteLoI | Overwrite the lines-of-interest parameters if true, else add them. |

### SetFeatureComponentMaxIndex

Remap Index map of each FeatureComponent of selected occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetFeatureComponentMaxIndex(OccurrenceList occurrences, int maxIndex)
```

Parameters

| Type                                                       | Name        | Description |
| ---------------------------------------------------------- | ----------- | ----------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences |             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | maxIndex    |             |

### SetMeshVertexColors

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetMeshVertexColors(OccurrenceList occurrences, ColorAlphaListList vertexColors)
```

Parameters

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

### SmoothMesh

```csharp
[HandleProcessCorruptedStateExceptions]
public void SmoothMesh(OccurrenceList occurrences, CostEvaluation mode, int maxIterations = 100, bool lockSignificantEdges = true)
```

Parameters

| Type                                                          | Name                 | Description                                                                        |
| ------------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences          | Occurrences of components to process.                                              |
| [CostEvaluation](./algo_costevaluation)                       | mode                 | Computation of cost.                                                               |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | maxIterations        | Maximum number of swapping iteration.                                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | lockSignificantEdges | Forbid to swap significant edges (e.g. UV seams, sharp edges, patch borders, ...). |

### SplitUVForAtlas

```csharp
[HandleProcessCorruptedStateExceptions]
public void SplitUVForAtlas(OccurrenceList occurrences)
```

Parameters

| Type                                     | Name        | Description        |
| ---------------------------------------- | ----------- | ------------------ |
| [OccurrenceList](./scene_occurrencelist) | occurrences | Input occurrences. |

### Sweep

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void Sweep(OccurrenceList occurrences, double radius, int sides, bool createNormals, bool keepLines, bool generateUV)
```

Parameters

| Type                                                           | Name          | Description                           |
| -------------------------------------------------------------- | ------------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences   | Occurrences of components to check.   |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | radius        | Radius of cylinders.                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sides         | Number of points to create cylinders. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createNormals |                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | keepLines     |                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | generateUV    |                                       |

### Tessellate

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void Tessellate(OccurrenceList occurrences, double maxSag, double maxLength, double maxAngle, bool createNormals = true, UVGenerationMode uvMode = UVGenerationMode.NoUV, int uvChannel = 1, double uvPadding = 0, bool createTangents = false, bool createFreeEdges = false, bool keepBRepShape = true, bool overrideExistingTessellation = false)
```

Parameters

| Type                                                           | Name                         | Description                                                                                                                                    |
| -------------------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences                  | Occurrences of components to tessellate.                                                                                                       |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxSag                       | Maximum distance between the geometry and the tessellation.                                                                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxLength                    | Maximum length of elements.                                                                                                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxAngle                     | Maximum angle between normals of two adjacent elements.                                                                                        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createNormals                | If true, normals will be generated.                                                                                                            |
| [UVGenerationMode](./algo_uvgenerationmode)                    | uvMode                       | Select the texture coordinates generation mode.                                                                                                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | uvChannel                    | The UV channel of the generated texture coordinates (if any).                                                                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.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. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createTangents               | If true, tangents will be generated.                                                                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createFreeEdges              | If true, free edges will be created for each patch borders.                                                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | keepBRepShape                | If true, BRep shapes will be kept for Back to Brep or Retessellate.                                                                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingTessellation | If true, already tessellated parts will be re-tessellated.                                                                                     |

### TessellatePointClouds

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void TessellatePointClouds(OccurrenceList occurrences, int kNeighbors = 20, bool keepPoints = false, bool colorize = true)
```

Parameters

| Type                                                          | Name        | Description                                                        |
| ------------------------------------------------------------- | ----------- | ------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences |                                                                    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | kNeighbors  | The number of neighbor points used to compute normals.             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | keepPoints  | Keep points after meshing if enabled.                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void TessellateRelativelyToAABB(OccurrenceList occurrences, double maxSag, double sagRatio, double maxLength, double maxAngle, bool createNormals = true, UVGenerationMode uvMode = UVGenerationMode.NoUV, int uvChannel = 1, double uvPadding = 0, bool createTangents = false, bool createFreeEdges = false, bool keepBRepShape = true, bool overrideExistingTessellation = false)
```

Parameters

| Type                                                           | Name                         | Description                                                                                                                                    |
| -------------------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences                  | Occurrences of components to tessellate.                                                                                                       |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxSag                       | Maximum distance between the geometry and the tessellation.                                                                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sagRatio                     | Maximum ratio distance between the geometry and the tessellation.                                                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxLength                    | Maximum length of elements.                                                                                                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxAngle                     | Maximum angle between normals of two adjacent elements.                                                                                        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createNormals                | If true, normals will be generated.                                                                                                            |
| [UVGenerationMode](./algo_uvgenerationmode)                    | uvMode                       | Select the texture coordinates generation mode.                                                                                                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | uvChannel                    | The UV channel of the generated texture coordinates (if any).                                                                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.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. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createTangents               | If true, tangents will be generated.                                                                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createFreeEdges              | If true, free edges will be created for each patch borders.                                                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | keepBRepShape                | If true, BRep shapes will be kept for Back to Brep or Retessellate.                                                                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingTessellation | If true, already tessellated parts will be re-tessellated.                                                                                     |

### TransferUV

Transfer UV from a mesh to another mesh.

```csharp
[HandleProcessCorruptedStateExceptions]
public void TransferUV(uint source, uint destination, int sourceChannel = 0, int destinationChannel = 0, double tolerance = 0.001)
```

Parameters

| Type                                                           | Name               | Description                               |
| -------------------------------------------------------------- | ------------------ | ----------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | source             | Occurrence of the source mesh.            |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | destination        | Occurrence of the destination mesh.       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sourceChannel      | Source UV channel to bake.                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | destinationChannel | Destination UV channel to bake to.        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance          | Geometric tolerance for point projection. |

### VoxelizePointClouds

Explode point clouds to voxels.

```csharp
[HandleProcessCorruptedStateExceptions]
public void VoxelizePointClouds(OccurrenceList occurrences, double voxelSize = 500)
```

Parameters

| Type                                                           | Name        | Description                  |
| -------------------------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Size of voxels.              |

### BakeAOMap

Ray tracing based ambient occlusion computation.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeAOMap(uint sessionId, int samples = 32, bool bentNormals = false, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                          | Name         | Description                                                                                   |
| ------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | sessionId    | Baking session Id.                                                                            |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | samples      | Number of rays cast for occlusion detection (must be a power of two in the range \[8, 4096]). |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | bentNormals  | If true, bent normals are baked in addition to AO.                                            |
| [ColorAlpha](./core_coloralpha)                               | defaultColor | Color used for filling unbaked texels.                                                        |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeDepthMap

Depth map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeDepthMap(uint sessionId, double normalizeValue = 1, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                           | Name           | Description                                                |
| -------------------------------------------------------------- | -------------- | ---------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | sessionId      | Baking session Id.                                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | normalizeValue | Divisor applied to depth values before storage to texture. |
| [ColorAlpha](./core_coloralpha)                                | defaultColor   | Color used for filling unbaked texels.                     |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeDiffuseMap

Diffuse map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeDiffuseMap(uint sessionId, bool withTransparency = false, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                          | Name             | Description                                                   |
| ------------------------------------------------------------- | ---------------- | ------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | sessionId        | Baking session Id.                                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | withTransparency | If true, surface transparency is stored in the alpha channel. |
| [ColorAlpha](./core_coloralpha)                               | defaultColor     | Color used for filling unbaked texels.                        |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeDisplacementMap

Displacement map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeDisplacementMap(uint sessionId, bool normalize = true, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                          | Name         | Description                                            |
| ------------------------------------------------------------- | ------------ | ------------------------------------------------------ |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | sessionId    | Baking session Id.                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | normalize    | If true, displacement vectors are remapped to \[-1,1]. |
| [ColorAlpha](./core_coloralpha)                               | defaultColor | Color used for filling unbaked texels.                 |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeEmissiveMap

Emissive map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeEmissiveMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeFeatureMap

Feature map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeFeatureMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeMaterialAOMap

AO baking from the source material.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeMaterialAOMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeMaterialIdMap

Color map baking based on source material Ids.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeMaterialIdMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeMaterialPropertyMap

Baking of custom material properties.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeMaterialPropertyMap(uint sessionId, string propertyName, int nComponents = 3, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                           | Name         | Description                                                                    |
| -------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------ |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | sessionId    | Baking session Id.                                                             |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyName | Name of the material property to bake (must be a color, a coeff or a texture). |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | nComponents  | Expected number of components per pixel for the resulting maps.                |
| [ColorAlpha](./core_coloralpha)                                | defaultColor | Color used for filling unbaked texels.                                         |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeMetallicMap

Metallic map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeMetallicMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeNormalMap

Normal map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeNormalMap(uint sessionId, Space sourceSpace = Space.Tangent, Space destinationSpace = Space.Tangent, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name             | Description                                                |
| ------------------------------------------------------------ | ---------------- | ---------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId        | Baking session Id.                                         |
| [Space](./algo_space)                                        | sourceSpace      | The space in which source normal vectors are defined.      |
| [Space](./algo_space)                                        | destinationSpace | The space in which destination normal vectors are defined. |
| [ColorAlpha](./core_coloralpha)                              | defaultColor     | Color used for filling unbaked texels.                     |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeOccurrencePropertyMap

Occurrence property map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeOccurrencePropertyMap(uint sessionId, string propertyName, int nComponents = 3, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                           | Name         | Description                                                                      |
| -------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | sessionId    | Baking session Id.                                                               |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | propertyName | Name of the occurrence property to bake (must be a color, a coeff or a texture). |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | nComponents  | Expected number of components per pixel for the resulting maps.                  |
| [ColorAlpha](./core_coloralpha)                                | defaultColor | Color used for filling unbaked texels.                                           |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeOpacityMap

Opacity map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeOpacityMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakePartIdMap

Color map baking based on the source part Ids.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakePartIdMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakePositionMap

Position map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakePositionMap(uint sessionId, bool local = false, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                          | Name         | Description                                                           |
| ------------------------------------------------------------- | ------------ | --------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | sessionId    | Baking session Id.                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | local        | If true, position is baked in local space, otherwise in global space. |
| [ColorAlpha](./core_coloralpha)                               | defaultColor | Color used for filling unbaked texels.                                |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeRoughnessMap

Roughness map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeRoughnessMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeSpecularMap

Specular map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeSpecularMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeUVMap

Source UV coordinates baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeUVMap(uint sessionId, int uvChannel = 0, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | uvChannel    | The channel from which UVs are baked.  |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeValidityMap

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

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeValidityMap(uint sessionId, double validValue = 1, double invalidValue = 0)
```

Parameters

| Type                                                           | Name         | Description                            |
| -------------------------------------------------------------- | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | sessionId    | Baking session Id.                     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | validValue   | Value used for filling baked texels.   |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | invalidValue | Value used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BakeVertexColorMap

Vertex color map baking.

```csharp
[HandleProcessCorruptedStateExceptions]
public ImageList BakeVertexColorMap(uint sessionId, ColorAlpha? defaultColor = null)
```

Parameters

| Type                                                         | Name         | Description                            |
| ------------------------------------------------------------ | ------------ | -------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId    | Baking session Id.                     |
| [ColorAlpha](./core_coloralpha)                              | defaultColor | Color used for filling unbaked texels. |

Returns

| Type                              | Description |
| --------------------------------- | ----------- |
| [ImageList](./material_imagelist) |             |

### BeginBakingSession

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint BeginBakingSession(OccurrenceList destinationOccurrences, OccurrenceList sourceOccurrences, int uvChannel = 0, int resolution = 1024, double rayOffset = 0, double rayMaxDist = -1, double opacityThreshold = -1, bool useCurrentPosition = false, bool shareMaps = true, ElementFilter sourceElements = ElementFilter.Polygons)
```

Parameters

| Type                                                           | Name                   | Description                                                                                                         |
| -------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | destinationOccurrences | Occurrences of the meshes where to store the baked map.                                                             |
| [OccurrenceList](./scene_occurrencelist)                       | sourceOccurrences      | Occurrences of components from which to bake maps (if empty use destination).                                       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | uvChannel              | UV channel of destOccurrence to use for the map generation.                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution             | Map resolution.                                                                                                     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | rayOffset              | Offset from source mesh.                                                                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | rayMaxDist             | Maximum search distance for ray tracing during baking computation (-1 means infinity).                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | opacityThreshold       | If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useCurrentPosition     | Use the current position instead of the T-Pose of the input occurrence.                                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | shareMaps              | If true, all the destinationOccurrences will share the same maps.                                                   |
| [ElementFilter](./algo_elementfilter)                          | sourceElements         | Defines the type of elements from which baking is performed (polygons or points).                                   |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### BeginVertexBakingSession

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint BeginVertexBakingSession(OccurrenceList destinationOccurrences, OccurrenceList sourceOccurrences, double rayOffset = 0, double rayMaxDist = -1, double opacityThreshold = -1, bool useCurrentPosition = false, ElementFilter sourceElements = ElementFilter.Polygons)
```

Parameters

| Type                                                           | Name                   | Description                                                                                                         |
| -------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | destinationOccurrences | Occurrences of the meshes where to store the baked map.                                                             |
| [OccurrenceList](./scene_occurrencelist)                       | sourceOccurrences      | Occurrences of components from which to bake maps (if empty use destination).                                       |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | rayOffset              | Offset from source mesh.                                                                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | rayMaxDist             | Maximum search distance for ray tracing during baking computation (-1 means infinity).                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | opacityThreshold       | If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useCurrentPosition     | Use the current position instead of the T-Pose of the input occurrence.                                             |
| [ElementFilter](./algo_elementfilter)                          | sourceElements         | Defines the type of elements from which baking is performed (polygons or points).                                   |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### CombineMaterials

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CombineMaterials(OccurrenceList occurrences, BakeOption bakingOptions, bool overrideExistingUVs = true, bool singularizeOnAO = false)
```

Parameters

| Type                                                          | Name                | Description                                                                                                              |
| ------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Root occurrences to process.                                                                                             |
| [BakeOption](./algo_bakeoption)                               | bakingOptions       | Baking options.                                                                                                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If true, use axis-aligned bounding box mapping to regenerate new UVs, instead of repacking existing ones from channel 0. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | singularizeOnAO     | If true, singularize all instances in the selected subtree if we want to bake AO in the texture.                         |

### EndBakingSession

End and destroy an existing baking session.

```csharp
[HandleProcessCorruptedStateExceptions]
public void EndBakingSession(uint sessionId)
```

Parameters

| Type                                                         | Name      | Description                      |
| ------------------------------------------------------------ | --------- | -------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId | Id of the baking session to end. |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public BakedValue FetchBakedMap(uint sessionId, uint x, uint y, uint mapId = 0)
```

Parameters

| Type                                                         | Name      | Description                                       |
| ------------------------------------------------------------ | --------- | ------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId | Baking session Id.                                |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | x         | X coordinate of the map pixel to fetch.           |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | y         | Y coordinate of the map pixel to fetch.           |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | mapId     | Id of the map to fetch, if several are available. |

Returns

| Type                            | Description |
| ------------------------------- | ----------- |
| [BakedValue](./algo_bakedvalue) |             |

### FetchBakedVertex

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

```csharp
[HandleProcessCorruptedStateExceptions]
public BakedValue FetchBakedVertex(uint sessionId, uint n, uint dstId = 0)
```

Parameters

| Type                                                         | Name      | Description                                                                      |
| ------------------------------------------------------------ | --------- | -------------------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId | Baking session Id.                                                               |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | n         | ID of the vertex to check.                                                       |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | dstId     | Id of the destination occurrence the vertex belongs to, if several are provided. |

Returns

| Type                            | Description |
| ------------------------------- | ----------- |
| [BakedValue](./algo_bakedvalue) |             |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SetBakingSessionPadding(uint sessionId, int padding)
```

Parameters

| Type                                                         | Name      | Description                                                                |
| ------------------------------------------------------------ | --------- | -------------------------------------------------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | sessionId | Baking session Id.                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)   | padding   | Number of pixels to fill around baked islands. -1 means infinite dilation. |

### ConvexDecomposition

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

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList ConvexDecomposition(OccurrenceList occurrences, int maxCount, int vertexCount, bool approximate, int resolution = 100000, double concavity = 0.001)
```

Parameters

| Type                                                           | Name        | Description                                 |
| -------------------------------------------------------------- | ----------- | ------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | maxCount    | Maximum number of convex hull to generated. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | vertexCount | Maximum number of vertices per convex hull. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | approximate | Approximate method.                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution  | Resolution.                                 |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | concavity   | Concavity.                                  |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### ExplodeBodies

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodeBodies(OccurrenceList occurrences, bool groupOpenShells = false)
```

Parameters

| Type                                                          | Name            | Description                        |
| ------------------------------------------------------------- | --------------- | ---------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences     | Part occurrences to process.       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | groupOpenShells | Group all open shells in one part. |

### ExplodeByMaterials

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodeByMaterials(OccurrenceList occurrences)
```

Parameters

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

### ExplodeByTopoDimension

Separate polygons, lines and points into different occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList ExplodeByTopoDimension(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### ExplodeByVertexCount

Explode part occurrences to respect a maximum vertex count.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodeByVertexCount(OccurrenceList occurrences, int maxVertexCount, int maxTriangleCount, bool countMergedVerticesOnce = true)
```

Parameters

| Type                                                          | Name                    | Description                                                                                                          |
| ------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences             | Part occurrences to process.                                                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | maxVertexCount          | The maximum number of vertices by part.                                                                              |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | maxTriangleCount        | The maximum number of triangles by part (quadrangles count twice).                                                   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | countMergedVerticesOnce | If true, one vertex used in several triangles with different normals will be counted once (for Unity must be False). |

### ExplodeByVoxel

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodeByVoxel(OccurrenceList occurrences, double voxelSize)
```

Parameters

| Type                                                           | Name        | Description                  |
| -------------------------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Voxel size.                  |

### ExplodeConnectedMeshes

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodeConnectedMeshes(OccurrenceList occurrences, bool explodeNonManifoldEdges = false)
```

Parameters

| Type                                                          | Name                    | Description                                          |
| ------------------------------------------------------------- | ----------------------- | ---------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences             | Part occurrences to process.                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | explodeNonManifoldEdges | Split connected components along non-manifold edges. |

### ExplodePatches

Explode all parts by patch.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ExplodePatches(OccurrenceList occurrences)
```

Parameters

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

### CreateVisibilityInformation

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVisibilityInformation(OccurrenceList occurrences, SelectionLevel level, int resolution, int sphereCount, double fovX = 90, bool considerTransparentOpaque = false, uint root = 0, bool onHemisphereOnly = false)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of geometries to create visibility information on: Parts, Patches or Polygons.        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root                      | Specify another root for occluder scene.                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

### CreateVisibilityInformationAdvanced

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVisibilityInformationAdvanced(OccurrenceList occurrences, SelectionLevel level, double voxelSize, double minimumCavityVolume, int resolution, InnerOuterOption mode = InnerOuterOption.All, bool considerTransparentOpaque = false, uint root = 0)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of geometries to create visibility information on: Parts, Patches or Polygons.        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_innerouteroption)                    | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root                      | Specify another root for occluder scene.                                                    |

### CreateVisibilityInformationFromViewPoints

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVisibilityInformationFromViewPoints(OccurrenceList occurrences, Point3List cameraPositions, Point3List cameraDirections, Point3List cameraUps, int resolution, double fovX = 90, bool considerTransparentOpaque = false, uint root = 0)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [Point3List](./geom_point3list)                                | cameraPositions           | List of camera positions.                                                                   |
| [Point3List](./geom_point3list)                                | cameraDirections          | List of camera directions.                                                                  |
| [Point3List](./geom_point3list)                                | cameraUps                 | List of camera up vectors.                                                                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root                      | Specify another root for occluder scene.                                                    |

### FindOccludedPartOccurrences

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

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList FindOccludedPartOccurrences(OccurrenceList occurrences, int resolution, int sphereCount, double fovX = 90, bool considerTransparentOpaque = false, uint root = 0, bool onHemisphereOnly = false)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root                      | Specify another root for occluder scene.                                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### FindOccludedPartOccurrencesAdvanced

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

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList FindOccludedPartOccurrencesAdvanced(OccurrenceList occurrences, double voxelSize, double minimumCavityVolume, int resolution, InnerOuterOption mode = InnerOuterOption.All, bool considerTransparentOpaque = false, uint root = 0)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_innerouteroption)                    | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | root                      | Specify another root for occluder scene.                                                    |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### RemoveOccludedGeometries

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

```csharp
[HandleProcessCorruptedStateExceptions]
public BoolList RemoveOccludedGeometries(OccurrenceList occurrences, SelectionLevel level, int resolution, int sphereCount, double fovX = 90, bool considerTransparentOpaque = false, int adjacencyDepth = 1, OccurrenceList occluders = null, bool onHemisphereOnly = false)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_occurrencelist)                       | occluders                 | Specify other occurrences for occluder scene.                                               |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | onHemisphereOnly          | Create viewpoints only in the Y+ hemisphere of the bounding sphere.                         |

Returns

| Type                        | Description |
| --------------------------- | ----------- |
| [BoolList](./core_boollist) |             |

### RemoveOccludedGeometriesAdvanced

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

```csharp
[HandleProcessCorruptedStateExceptions]
public BoolList RemoveOccludedGeometriesAdvanced(OccurrenceList occurrences, SelectionLevel level, double voxelSize, double minimumCavityVolume, int resolution, InnerOuterOption mode = InnerOuterOption.All, bool considerTransparentOpaque = false, int adjacencyDepth = 1, OccurrenceList occluders = null)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_innerouteroption)                    | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_occurrencelist)                       | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                        | Description |
| --------------------------- | ----------- |
| [BoolList](./core_boollist) |             |

### RemoveOccludedGeometriesFromPoints

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

```csharp
[HandleProcessCorruptedStateExceptions]
public BoolList RemoveOccludedGeometriesFromPoints(OccurrenceList occurrences, SelectionLevel level, Point3List positions, int resolution, int sphereCount, double fovX = 90, bool considerTransparentOpaque = false, int adjacencyDepth = 1, OccurrenceList occluders = null)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of parts to remove : Parts, Patches or Polygons.                                      |
| [Point3List](./geom_point3list)                                | positions                 | List of positions.                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | sphereCount               | Number of viewpoints generated around the bounding sphere.                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_occurrencelist)                       | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                        | Description |
| --------------------------- | ----------- |
| [BoolList](./core_boollist) |             |

### RemoveOccludedGeometriesFromViewPoints

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

```csharp
[HandleProcessCorruptedStateExceptions]
public BoolList RemoveOccludedGeometriesFromViewPoints(OccurrenceList occurrences, SelectionLevel level, Point3List positions, Point3List directions, Point3List ups, int resolution, double fovX = 90, bool considerTransparentOpaque = false, int adjacencyDepth = 1, OccurrenceList occluders = null)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences of components to process.                                                       |
| [SelectionLevel](./algo_selectionlevel)                        | level                     | Level of geometries to remove : Parts, Patches or Polygons.                                 |
| [Point3List](./geom_point3list)                                | positions                 | List of positions.                                                                          |
| [Point3List](./geom_point3list)                                | directions                | List of directions.                                                                         |
| [Point3List](./geom_point3list)                                | ups                       | List of up vectors.                                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX                      | Horizontal field of view (in degree).                                                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | adjacencyDepth            | Mark neighbors polygons as visible.                                                         |
| [OccurrenceList](./scene_occurrencelist)                       | occluders                 | Specify other occurrences for occluder scene.                                               |

Returns

| Type                        | Description |
| --------------------------- | ----------- |
| [BoolList](./core_boollist) |             |

### CreateOcclusionMesh

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint CreateOcclusionMesh(OccurrenceList occurrences, CreateOccluder type, double voxelSize, int gap)
```

Parameters

| Type                                                           | Name        | Description                            |
| -------------------------------------------------------------- | ----------- | -------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.           |
| [CreateOccluder](./algo_createoccluder)                        | type        | Type of what we create.                |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Size of voxels.                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | gap         | Dilation iterations on the voxel grid. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### DualContouring

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint DualContouring(OccurrenceList occurrences, double filteringSize, double voxelSize, double tolerance, bool sameSizeOnAllAxis)
```

Parameters

| Type                                                           | Name              | Description                                                                |
| -------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences       | Occurrences of part to process.                                            |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | filteringSize     | Filtering size - must be a multiple of 2 of voxelSize.                     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize         | Voxel size used for the reconstruction.                                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance         | Tolerance for the quadric error used for the simplification of the octree. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | sameSizeOnAllAxis | If true, use the maximum axis length of the AABB for all axis.             |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### MarchingCubes

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint MarchingCubes(OccurrenceList occurrences, double voxelSize, ElementFilter elements = ElementFilter.Polygons, int dilation = 0, bool surfacic = false)
```

Parameters

| Type                                                           | Name        | Description                                                                                |
| -------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Size of voxels.                                                                            |
| [ElementFilter](./algo_elementfilter)                          | elements    | Type of elements used to detect the voxels, polygons or points or hybrid.                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | dilation    | Dilation iterations on the voxel grid (only if surfacic=false).                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | surfacic    | Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### ProxyMesh

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint ProxyMesh(OccurrenceList occurrences, double voxelSize, ElementFilter elements = ElementFilter.Polygons, int dilation = 0, bool surfacic = false)
```

Parameters

| Type                                                           | Name        | Description                                                                                |
| -------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize   | Size of voxels.                                                                            |
| [ElementFilter](./algo_elementfilter)                          | elements    | Type of elements used to detect the voxels, polygons or points or hybrid.                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | dilation    | Dilation iterations on the voxel grid (only if surfacic=false).                            |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | surfacic    | Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight. |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### Retopologize

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint Retopologize(OccurrenceList occurrences, int targetTriangleCount, bool pureQuad, bool pointCloud, double precision = -1)
```

Parameters

| Type                                                           | Name                | Description                                                                                                         |
| -------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Part occurrences to process.                                                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | targetTriangleCount | Target triangle count.                                                                                              |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | pureQuad            | Retopologize to a pure quad mesh if True, else the resulting mesh will be quad dominant but can contains triangles. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | pointCloud          | Set to true if occurrences are point cloud, else False.                                                             |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | precision           | If set, define the precision of the features to preserve.                                                           |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### Voxelize

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint Voxelize(OccurrenceList occurrences, double voxelSize, ElementFilter elements = ElementFilter.Polygons, int dilation = 0, bool useCurrentAnimationPosition = false)
```

Parameters

| Type                                                           | Name                        | Description                                                               |
| -------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences                 | Part occurrences to process.                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize                   | Size of voxels.                                                           |
| [ElementFilter](./algo_elementfilter)                          | elements                    | Type of elements used to detect the voxels, polygons or points or hybrid. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | dilation                    | Dilation iterations on the voxel grid.                                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useCurrentAnimationPosition | Use the current animation position instead of the t-pose.                 |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### ReplaceBy

Replace geometries by other shapes, or primitives.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ReplaceBy(OccurrenceList occurrences, ReplaceByOption replaceBy)
```

Parameters

| Type                                      | Name        | Description                           |
| ----------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)  | occurrences | Occurrences of components to replace. |
| [ReplaceByOption](./algo_replacebyoption) | replaceBy   | Shape replacement option.             |

### ReplaceByBox

Replace objects by a bounding box.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ReplaceByBox(OccurrenceList occurrences, ReplaceByBoxType boxType)
```

Parameters

| Type                                        | Name        | Description                                    |
| ------------------------------------------- | ----------- | ---------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)    | occurrences | Occurrences of components to replace.          |
| [ReplaceByBoxType](./algo_replacebyboxtype) | boxType     | Bounding box type, oriented, axis-aligned, ... |

### ReplaceByConvexHull

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void ReplaceByConvexHull(OccurrenceList occurrences)
```

Parameters

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

### ReplaceByPrimitive

Replace objects by a primitive shapes.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ReplaceByPrimitive(OccurrenceList occurrences, PrimitiveShapeParameters primitive, bool generateUV = true)
```

Parameters

| Type                                                          | Name        | Description                           |
| ------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences of components to replace. |
| [PrimitiveShapeParameters](./algo_primitiveshapeparameters)   | primitive   | Primitive type and parameters.        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | generateUV  | Primitive type and parameters.        |

### SawWithAABB

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SawWithAABB(OccurrenceList occurrences, AABB aabb, SawingMode mode, string innerSuffix = "_inner", string outerSuffix = "_outer")
```

Parameters

| Type                                                           | Name        | Description                                                           |
| -------------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                                          |
| [AABB](./geom_aabb)                                            | aabb        | Axis-Aligned Bounding Box.                                            |
| [SawingMode](./algo_sawingmode)                                | mode        | The sawing mode.                                                      |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |

### SawWithOBB

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SawWithOBB(OccurrenceList occurrences, OBB obb, SawingMode mode, string innerSuffix = "_inner", string outerSuffix = "_outer")
```

Parameters

| Type                                                           | Name        | Description                                                           |
| -------------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                                          |
| [OBB](./geom_obb)                                              | obb         | Minimum Bounding Box.                                                 |
| [SawingMode](./algo_sawingmode)                                | mode        | The sawing mode.                                                      |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |

### SawWithOctree

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint SawWithOctree(OccurrenceList occurrences, AABB aabb, int maxDepth, int maxTrianglesByLeaf = -1, double sawTolerance = 0)
```

Parameters

| Type                                                           | Name               | Description                                                                 |
| -------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Part occurrences to process.                                                |
| [AABB](./geom_aabb)                                            | aabb               | Octree Bounding Box.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | maxDepth           | Depth of the octree.                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | maxTrianglesByLeaf | Set the maximum triangle count on the leaf of the octree ( -1 to not use ). |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | sawTolerance       | Size in mm of the tolerance of the saw.                                     |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### SawWithPlane

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SawWithPlane(OccurrenceList occurrences, Point3 planeOrigin, Point3 planeNormal, SawingMode mode, string innerSuffix = "_inner", string outerSuffix = "_outer", double tolerance = 0)
```

Parameters

| Type                                                           | Name        | Description                                                           |
| -------------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.                                          |
| [Point3](./geom_point3)                                        | planeOrigin | The plane origin.                                                     |
| [Point3](./geom_point3)                                        | planeNormal | The plane normal.                                                     |
| [SawingMode](./algo_sawingmode)                                | mode        | The sawing mode.                                                      |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | innerSuffix | Only if mode is set to SawAndSplit, set the suffix of the inner part. |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | outerSuffix | Only if mode is set to SawAndSplit, set the suffix of the outer part. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance   | Set a tolerance to make the saw lose.                                 |

### 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).

```csharp
[HandleProcessCorruptedStateExceptions]
public void ConvertSimilarPartOccurrencesToInstances(OccurrenceList occurrences, bool checkMeshTopo, bool checkVertexPositions, int vertexPositionPrecision, bool checkUVTopo, bool checkUVVertexPositions, int UVPositionprecision)
```

Parameters

| Type                                                          | Name                    | Description                                                                               |
| ------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences             | Occurrence for which we want to find similar parts and create instances using prototypes. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | checkMeshTopo           |                                                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | checkVertexPositions    |                                                                                           |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | vertexPositionPrecision |                                                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | checkUVTopo             |                                                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | checkUVVertexPositions  |                                                                                           |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | UVPositionprecision     |                                                                                           |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ConvertSimilarPartOccurrencesToInstancesFast(OccurrenceList occurrences, double dimensionsSimilarity, double polycountSimilarity, bool ignoreSymmetry)
```

Parameters

| Type                                                           | Name                 | Description                                                                                                                                                                                                          |
| -------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences          | Root occurrences for which we want to find similar part occurrences and create instances using prototypes.                                                                                                           |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 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. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 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.   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | ignoreSymmetry       | If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.                                                                                                    |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList FindSimilarPartOccurrencesFast(OccurrenceList occurrences, double dimensionsSimilarity, double polycountSimilarity, bool ignoreSymmetry)
```

Parameters

| Type                                                           | Name                 | Description                                                                                                                                                                                                          |
| -------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences          | Occurrences for which we want to find similar part occurrences in the scene.                                                                                                                                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 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. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | 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.   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | ignoreSymmetry       | If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.                                                                                                    |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### AlignUVIslands

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void AlignUVIslands(OccurrenceList occurrences, int channel = 0, double usePolygonsWeights = 0, double useVerticesWeights = 0, AlignmentMode alignmentMode = AlignmentMode.Auto)
```

Parameters

| Type                                                           | Name               | Description                                                           |
| -------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Part occurrences to process.                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel            | UV channel to merge.                                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | usePolygonsWeights | Use polygons weights to give more importance to what must be aligned. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | useVerticesWeights | Use vertices weights to give more importance to what must be aligned. |
| [AlignmentMode](./algo_alignmentmode)                          | alignmentMode      | With which axis the UVs should be aligned.                            |

### ApplyUvTransform

Apply a transformation matrix on texture coordinates.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ApplyUvTransform(OccurrenceList occurrences, Matrix4 matrix, int channel = 0)
```

Parameters

| Type                                                       | Name        | Description                  |
| ---------------------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Part occurrences to process. |
| [Matrix4](./geom_matrix4)                                  | matrix      | Transformationmatrix.        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | channel     | UV channel to transform.     |

### AutomaticUVMapping

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void AutomaticUVMapping(OccurrenceList occurrences, int channel = 0, double maxAngleDistorsion = 0.5, double maxAreaDistorsion = -1, bool sharpToSeam = true, bool forbidOverlapping = true, uint resolution = 1024, uint padding = 1)
```

Parameters

| Type                                                           | Name               | Description                                                               |               |          |
| -------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------- | ------------- | -------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Part occurrences to process.                                              |               |          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel            | The UV channel which will contains the texture coordinates.               |               |          |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxAngleDistorsion | Maximum angle distorsion                                                  | 2PI-SumVtxAng | /2PI.    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxAreaDistorsion  | Maximum area distorsion before scale to 1.                                | 2DArea-3DArea | /3DArea. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | sharpToSeam        | If enabled, sharp edges are automatically considered as UV seams.         |               |          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | forbidOverlapping  | If enabled, UV cannot overlap.                                            |               |          |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | resolution         | Resolution wanted for the final map when repacking at the end.            |               |          |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | padding            | Set the padding (in pixels) between UV islands when repacking at the end. |               |          |

### CopyUV

Copy an UV channel to another UV channel.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CopyUV(OccurrenceList occurrences, int sourceChannel = 0, int destinationChannel = 0)
```

Parameters

| Type                                                       | Name               | Description                              |
| ---------------------------------------------------------- | ------------------ | ---------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences        | Part occurrences to process.             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | sourceChannel      | The source UV channel to copy.           |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | destinationChannel | The destination UV channel to copy into. |

### GetRatioUV3D

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

```csharp
[HandleProcessCorruptedStateExceptions]
public DoubleList GetRatioUV3D(OccurrenceList occurrences, RatioUV3DMode ratioMode, int channel = 0)
```

Parameters

| Type                                                       | Name        | Description                      |
| ---------------------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Part occurrences to process.     |
| [RatioUV3DMode](./algo_ratiouv3dmode)                      | ratioMode   | Choose how to compute the ratio. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | channel     | UV channel to use.               |

Returns

| Type                            | Description |
| ------------------------------- | ----------- |
| [DoubleList](./core_doublelist) |             |

### GetUVQualityMetrics

Compute UV mapping qualitative metrics.

```csharp
[HandleProcessCorruptedStateExceptions]
public GetUVQualityMetricsReturn GetUVQualityMetrics(OccurrenceList occurrences, uint channel)
```

Parameters

| Type                                                         | Name        | Description                  |
| ------------------------------------------------------------ | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                     | occurrences | Part occurrences to process. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | channel     | UV channel to use.           |

Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [GetUVQualityMetricsReturn](./algo_getuvqualitymetricsreturn) |             |

### GetUvAabr

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

```csharp
[HandleProcessCorruptedStateExceptions]
public AABR GetUvAabr(OccurrenceList occurrences, int channel = 0)
```

Parameters

| Type                                                       | Name        | Description                  |
| ---------------------------------------------------------- | ----------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Part occurrences to process. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | channel     | UV channel to transform.     |

Returns

| Type                | Description |
| ------------------- | ----------- |
| [AABR](./geom_aabr) |             |

### HasOverlappingUV

Check if a UV channel contains overlapping UVs.

```csharp
[HandleProcessCorruptedStateExceptions]
public bool HasOverlappingUV(OccurrenceList occurrences, uint channel, uint resolution = 1024)
```

Parameters

| Type                                                         | Name        | Description                                                  |
| ------------------------------------------------------------ | ----------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                     | occurrences | Part occurrences to process.                                 |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | channel     | UV channel to use.                                           |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | resolution  | Resolution of rasterization grid used to check for overlaps. |

Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### MapUvOnAABB

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnAABB(OccurrenceList occurrences, bool useLocalAABB, double uv3dSize, int channel = 0, bool overrideExistingUVs = true, bool ignoreScale = true)
```

Parameters

| Type                                                           | Name                | Description                                                  |
| -------------------------------------------------------------- | ------------------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Part occurrences to process.                                 |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useLocalAABB        | If enabled, uses part own bounding box, else use global one. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | uv3dSize            | 3D size of the UV space \[0-1].                              |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel             | The UV channel which will contains the texture coordinates.  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingUVs | If True, override existing UVs on channel.                   |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | ignoreScale         | If this and useLocalAABB are true, ignore local scale.       |

### MapUvOnBox

Generate texture coordinates using the projection on a box.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnBox(OccurrenceList occurrences, Box box, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                          | Name                | Description                                                 |
| ------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                |
| [Box](./algo_box)                                             | box                 | Box definition.                                             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MapUvOnCubicAABB

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnCubicAABB(OccurrenceList occurrences, double uv3dSize, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                           | Name                | Description                                                 |
| -------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Part occurrences to process.                                |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | uv3dSize            | 3D size of the UV space \[0-1].                             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MapUvOnCustomAABB

Generate texture coordinates using the projection on custom AABB.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnCustomAABB(OccurrenceList occurrences, AABB aabb, double uv3dSize, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                           | Name                | Description                                                 |
| -------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Part occurrences to process.                                |
| [AABB](./geom_aabb)                                            | aabb                | Axis aligned bounding box to project on.                    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | uv3dSize            | 3D size of the UV space \[0-1].                             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MapUvOnCylinder

Generate texture coordinates using the projection on a cylinder.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnCylinder(OccurrenceList occurrences, Cylinder cylinder, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                          | Name                | Description                                                 |
| ------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                |
| [Cylinder](./algo_cylinder)                                   | cylinder            | Cylinder definition.                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MapUvOnFittingCylinder

Generate texture coordinates using the projection on a fitting cylinder.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnFittingCylinder(OccurrenceList occurrences, int channel = 0, bool overrideExistingUVs = true, bool useAABB = true, Point3? forcedAxis = null)
```

Parameters

| Type                                                          | Name                | Description                                                                                                     |
| ------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                                                                    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates.                                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useAABB             | If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |
| [Point3](./geom_point3)                                       | forcedAxis          | Forced axis of the Cylinder.                                                                                    |

### MapUvOnFittingSphere

Generate texture coordinates using the projection on a fitting sphere.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnFittingSphere(OccurrenceList occurrences, int channel = 0, bool overrideExistingUVs = true, bool useAABB = true)
```

Parameters

| Type                                                          | Name                | Description                                                                                                     |
| ------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                                                                    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates.                                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useAABB             | If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |

### MapUvOnMBB

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnMBB(OccurrenceList occurrences, bool useLocalMBB, double uv3dSize, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                           | Name                | Description                                                  |
| -------------------------------------------------------------- | ------------------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Part occurrences to process.                                 |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | useLocalMBB         | If enabled, uses part own bounding box, else use global one. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | uv3dSize            | 3D size of the UV space \[0-1].                              |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel             | The UV channel which will contains the texture coordinates.  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | overrideExistingUVs | If True, override existing UVs on channel.                   |

### MapUvOnPlane

Generate texture coordinates using the projection on a plane.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnPlane(OccurrenceList occurrences, Plane plane, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                          | Name                | Description                                                 |
| ------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                |
| [Plane](./algo_plane)                                         | plane               | Plane definition.                                           |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MapUvOnSphere

Generate texture coordinates using the projection on a sphere.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MapUvOnSphere(OccurrenceList occurrences, Sphere sphere, int channel = 0, bool overrideExistingUVs = true)
```

Parameters

| Type                                                          | Name                | Description                                                 |
| ------------------------------------------------------------- | ------------------- | ----------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Part occurrences to process.                                |
| [Sphere](./algo_sphere)                                       | sphere              | Sphere definition.                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel             | The UV channel which will contains the texture coordinates. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | overrideExistingUVs | If True, override existing UVs on channel.                  |

### MergeUVIslandsAffine

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void MergeUVIslandsAffine(OccurrenceList occurrences, int channel = 0, double scaleWeights = 0, double maxScaleVariationFactor = 1.2, double curvatureWeights = -1, double usePolygonsWeights = 1, double useVerticesWeights = -1, TransformationType allowedTransformations = TransformationType.TRSOnly, bool allowUVInversion = false, double rotationStep = -1)
```

Parameters

| Type                                                           | Name                    | Description                                                                                                          |
| -------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences             | Part occurrences to process.                                                                                         |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel                 | UV channel to merge.                                                                                                 |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | scaleWeights            | Weight to assign to scale for the merging priority.                                                                  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxScaleVariationFactor | Maximum scaling factor allowed, -1 meaning no limits.                                                                |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | curvatureWeights        | Weight to assign to curvature for the merging priority.                                                              |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | usePolygonsWeights      | Use polygons weights to prioritize seams between polygons with less weight. The value represents the feature weight. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | useVerticesWeights      | Use vertices weights to prioritize seams where vertices with less weight. The value represents the feature weight.   |
| [TransformationType](./algo_transformationtype)                | allowedTransformations  | Allowed transformation: TRSOnly or TRS+Skew.                                                                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | allowUVInversion        | Allow merged UVs to be inverted.                                                                                     |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | rotationStep            | Constrains rotation steps to the specified angle (in degrees). If set to -1, allows free rotation.                   |

### 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).

```csharp
[HandleProcessCorruptedStateExceptions]
public void MergeUVIslandsRelaxed(OccurrenceList occurrences, int channel, int targetIslandCount = 0, double energyThreshold = 0.01, bool forceIsolatedFaces = true)
```

Parameters

| Type                                                           | Name               | Description                                                                                                                                 |
| -------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Part occurrences to process.                                                                                                                |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel            | UV channel to use.                                                                                                                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | targetIslandCount  | Target number of islands (zero means the algorithm runs until no more merging is possible).                                                 |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | energyThreshold    | Max energy allowed during local reparametrization.                                                                                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | forceIsolatedFaces | UV islands consisting in a single isolated face completely surrounded by another island are forced to be merged, without reparametrization. |

### NormalizeUV

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void NormalizeUV(OccurrenceList occurrences, int sourceUVChannel, int destinationUVChannel = -1, bool uniform = true, bool sharedUVSpace = true, bool ignoreNullIslands = false)
```

Parameters

| Type                                                          | Name                 | Description                                                                                                                     |
| ------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences          | Part occurrences to process.                                                                                                    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | sourceUVChannel      | UV Channel to normalize.                                                                                                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | destinationUVChannel | UV channel to store the normalized UV (if -1, sourceUVChannel will be replaced).                                                |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | uniform              | If true, the scale will be uniform. Else UV can be deformed with a non-uniform scale.                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | sharedUVSpace        | If true, all parts will be processed as if they were merged to avoid overlapping of their UV coordinates.                       |
| [bool](https://learn.microsoft.com/dotnet/api/system.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). |

### RemoveUV

Remove one or all UV channel(s).

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemoveUV(OccurrenceList occurrences, int channel = -1)
```

Parameters

| Type                                                       | Name        | Description                                   |
| ---------------------------------------------------------- | ----------- | --------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Part occurrences to process.                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | channel     | The UV channel to remove (all if channel=-1). |

### RepackUV

Pack existing UV (create atlas).

```csharp
[HandleProcessCorruptedStateExceptions]
public OccurrenceList RepackUV(OccurrenceList occurrences, int channel = 0, bool shareMap = true, int resolution = 1024, uint padding = 2, bool uniformRatio = false, int iterations = 3, bool removeOverlaps = true)
```

Parameters

| Type                                                          | Name           | Description                                                              |
| ------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences    | Part occurrences to process.                                             |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | channel        | The UV channel to repack.                                                |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | shareMap       | If True, the UV of all given parts will be packed together.              |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | resolution     | Resolution wanted for the final map.                                     |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | padding        | Set the padding (in pixels) between UV islands.                          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | uniformRatio   | If true, UV of different part will have the same ratio.                  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | iterations     | Fitting iterations.                                                      |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | removeOverlaps | Remove overlaps to avoid multiple triangles UVs to share the same pixel. |

Returns

| Type                                     | Description |
| ---------------------------------------- | ----------- |
| [OccurrenceList](./scene_occurrencelist) |             |

### ResizeUVsToTextureSize

Rescale the UV coordinates to fit the input texture size.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ResizeUVsToTextureSize(OccurrenceList occurrences, double TextureSize, int channel = 0)
```

Parameters

| Type                                                           | Name        | Description                                                  |
| -------------------------------------------------------------- | ----------- | ------------------------------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences to use for the rescaling.                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | TextureSize | Texture size to use for the UV coordinates (in millimeters). |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel     | UV channel to use.                                           |

### ScaleUV

Apply a scale on texture coordinates.

```csharp
[HandleProcessCorruptedStateExceptions]
public void ScaleUV(OccurrenceList occurrences, double scaleU, double scaleV, int channel = 0)
```

Parameters

| Type                                                           | Name        | Description                     |
| -------------------------------------------------------------- | ----------- | ------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Part occurrences to process.    |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | scaleU      | Scale to apply to U coordinate. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | scaleV      | Scale to apply to V coordinate. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel     | UV channel to transform.        |

### SwapUvChannels

Swap two UV channels.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SwapUvChannels(OccurrenceList occurrences, int firstChannel, int secondChannel)
```

Parameters

| Type                                                       | Name          | Description                  |
| ---------------------------------------------------------- | ------------- | ---------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences   | Part occurrences to process. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | firstChannel  | First UV Channel to swap.    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | secondChannel | Second UV Channel to swap.   |

### UnwrapUV

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void UnwrapUV(OccurrenceList occurrences, UnwrapUVMethod method, int channel = -1, bool createSeamsFromLoI = false, int iterMax = 50, double tolerance = 1E-05)
```

Parameters

| Type                                                           | Name               | Description                                                          |
| -------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences        | Part occurrences to process.                                         |
| [UnwrapUVMethod](./algo_unwrapuvmethod)                        | method             | Minimization method to use for unwrapping (isometric or conformal).  |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | channel            | The UV channel which will contains the texture coordinates.          |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | createSeamsFromLoI | Use Lines of Interest to generate UV islands.                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | iterMax            | For iterative solvers: set the maximum number of iterations allowed. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance          | For iterative solvers: set the maximum error threshold.              |

### GetFittingCylinder

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

```csharp
[HandleProcessCorruptedStateExceptions]
public Affine GetFittingCylinder(OccurrenceList occurrences, bool useAABB = true, Point3? forcedAxis = null)
```

Parameters

| Type                                                          | Name        | Description                                                                                     |
| ------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences to fit.                                                                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useAABB     | If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |
| [Point3](./geom_point3)                                       | forcedAxis  | Forced axis of the Cylinder when using MBB.                                                     |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Affine](./geom_affine) |             |

### GetFittingSphere

Returns the fitting sphere of a set of occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public Affine GetFittingSphere(OccurrenceList occurrences, bool useAABB = true)
```

Parameters

| Type                                                          | Name        | Description                                                                                     |
| ------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences | Occurrences to fit.                                                                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useAABB     | If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). |

Returns

| Type                    | Description |
| ----------------------- | ----------- |
| [Affine](./geom_affine) |             |

### ConvertNormalMap

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

```csharp
[HandleProcessCorruptedStateExceptions]
public uint ConvertNormalMap(OccurrenceList partOccurrences, uint normalMap, int uvChannel = 0, Space sourceSpace = Space.Object, Space destinationSpace = Space.Tangent, bool sourceIsRightHanded = true, bool destinationIsRightHanded = true, bool replaceMap = true, int resolution = -1, int padding = 1)
```

Parameters

| Type                                                          | Name                     | Description                                                                                                                                       |
| ------------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | partOccurrences          | Occurrences of components using the given map.                                                                                                    |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)  | normalMap                | Source normal map to convert.                                                                                                                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | uvChannel                | UV channel used on the given map.                                                                                                                 |
| [Space](./algo_space)                                         | sourceSpace              | Defines the space (object, world or tangent) from which the given normalMap is converted.                                                         |
| [Space](./algo_space)                                         | destinationSpace         | Defines the space (object, world or tangent) to which the given normalMap is converted.                                                           |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | sourceIsRightHanded      | Considers source normal map as part of a right-handed coordinates system.                                                                         |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | destinationIsRightHanded | Generate destination normal map as part of a right-handed coordinates system.                                                                     |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | replaceMap               | If true, the given normalMap will be replaced by the converted one.                                                                               |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | resolution               | New map resolution (if replaceMap=false), if resolution=-1, the input resolution will be used.                                                    |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | 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                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### CreateBillboard

Create a billboard imposter.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint CreateBillboard(OccurrenceList occurrences, int resolution = 1024, bool XPositive = true, bool XNegative = true, bool YPositive = true, bool YNegative = true, bool ZPositive = true, bool ZNegative = true, bool moveFacesToCenter = true, bool leftHandedNormalMap = false)
```

Parameters

| Type                                                          | Name                | Description                                                                                           |
| ------------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences         | Occurrences to bake in the billboard.                                                                 |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)    | resolution          | Total resolution of the billboard (contains all wanted faces).                                        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | XPositive           | Bake face facing X+.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | XNegative           | Bake face facing X-.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | YPositive           | Bake face facing Y+.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | YNegative           | Bake face facing Y-.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | ZPositive           | Bake face facing Z+.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | ZNegative           | Bake face facing Z-.                                                                                  |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | moveFacesToCenter   | If true, all face are moved to the center of the AABB of the occurrences, else it will shape an AABB. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | leftHandedNormalMap | If true, a left handed normal map will be generated.                                                  |

Returns

| Type                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### FillNormalMap

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void FillNormalMap(uint normalMap)
```

Parameters

| Type                                                         | Name      | Description                   |
| ------------------------------------------------------------ | --------- | ----------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | normalMap | Source normal map to convert. |

### OrientNormalMap

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientNormalMap(uint normalMap)
```

Parameters

| Type                                                         | Name      | Description           |
| ------------------------------------------------------------ | --------- | --------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | normalMap | Normal map to orient. |

### BarySmooth

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void BarySmooth(OccurrenceList occurrences, int iteration = 1)
```

Parameters

| Type                                                       | Name        | Description                           |
| ---------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences | Occurrences of components to process. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | iteration   | Number of iterations.                 |

### CrackMoebiusStrips

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void CrackMoebiusStrips(OccurrenceList occurrences, int maxEdgeCount = 3)
```

Parameters

| Type                                                       | Name         | Description                                                   |
| ---------------------------------------------------------- | ------------ | ------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences  | Occurrences of components to repair.                          |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | maxEdgeCount | Maximum number of edges to crack to remove one moebius strip. |

### CrackNonManifoldVertices

Splits non-manifold vertices.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CrackNonManifoldVertices(OccurrenceList occurrences)
```

Parameters

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

### CreateCavityOccurrences

Identify cavities and create occurrences to show them.

```csharp
[HandleProcessCorruptedStateExceptions]
public uint CreateCavityOccurrences(OccurrenceList occurrences, double voxelSize, double minimumCavityVolume, InnerOuterOption mode = InnerOuterOption.All, uint parent = 0)
```

Parameters

| Type                                                           | Name                | Description                                                                                                                             |
| -------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences         | Occurrences set to identify cavities.                                                                                                   |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize           | Size of the voxels in mm.                                                                                                               |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minimumCavityVolume | Minimum volume of a cavity in cubic meter.                                                                                              |
| [InnerOuterOption](./algo_innerouteroption)                    | mode                | Select where to place camera (all cavities, only outer or only inner cavities).                                                         |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | 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                                                         | Description |
| ------------------------------------------------------------ | ----------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) |             |

### InvertPolygonFacesOrientation

Invert the orientation of tessellation elements.

```csharp
[HandleProcessCorruptedStateExceptions]
public void InvertPolygonFacesOrientation(OccurrenceList occurrences)
```

Parameters

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

### MoebiusCracker

Splits moebius ring.

```csharp
[HandleProcessCorruptedStateExceptions]
public void MoebiusCracker(OccurrenceList occurrences)
```

Parameters

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

### OrientNormals

Orient existing normal according to the polygons clockwise.

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientNormals(OccurrenceList occurrences)
```

Parameters

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

### RemeshSurfacicHoles

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemeshSurfacicHoles(OccurrenceList occurrences, double maxDiameter = 0, bool refine = true, int numberOfNeighbors = 3, uint fillWithMaterial = 0)
```

Parameters

| Type                                                           | Name              | Description                                                   |
| -------------------------------------------------------------- | ----------------- | ------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences       | Occurrences of components to process.                         |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDiameter       | Maximum surfacic holes diameters.                             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | refine            | Refine mesh for more details in holes.                        |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | numberOfNeighbors | Number of neighboring vertices to use for the MLS projection. |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32)   | fillWithMaterial  | If set, the given material will be used to fill the holes.    |

### RemoveDegeneratedPolygons

Remove some kinds of degenerated polygons.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemoveDegeneratedPolygons(OccurrenceList occurrences, double tolerance)
```

Parameters

| Type                                                           | Name        | Description                           |
| -------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance   | Degenerated tolerance.                |

### RemoveMultiplePolygon

Remove multiple polygon.

```csharp
[HandleProcessCorruptedStateExceptions]
public void RemoveMultiplePolygon(OccurrenceList occurrences)
```

Parameters

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

### RemoveZFighting

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

```csharp
[HandleProcessCorruptedStateExceptions]
public double RemoveZFighting(OccurrenceList occurrences)
```

Parameters

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

Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) |             |

### RepairMesh

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void RepairMesh(OccurrenceList occurrences, double tolerance, bool crackNonManifold = true, bool orient = true)
```

Parameters

| Type                                                           | Name             | Description                                                           |
| -------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences      | Occurrences of components to process.                                 |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | tolerance        | Connection tolerance.                                                 |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | crackNonManifold | At the end of the repair process, crack resulting non-manifold edges. |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | orient           | If true reorient the model.                                           |

### RepairNullNormals

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void RepairNullNormals(OccurrenceList occurrences)
```

Parameters

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

### SeparateToManifold

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void SeparateToManifold(OccurrenceList occurrences)
```

Parameters

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

### SewBoundary

Sew boundaries between them.

```csharp
[HandleProcessCorruptedStateExceptions]
public void SewBoundary(OccurrenceList occurrences, double maxDistance)
```

Parameters

| Type                                                           | Name        | Description                          |
| -------------------------------------------------------------- | ----------- | ------------------------------------ |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to repair. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | maxDistance | Maximum distance between bundaries.  |

### VertexOffset

Move the vertices by the offsset along their normal.

```csharp
[HandleProcessCorruptedStateExceptions]
public void VertexOffset(OccurrenceList occurrences, double offset = 1)
```

Parameters

| Type                                                           | Name        | Description             |
| -------------------------------------------------------------- | ----------- | ----------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | offset      | Displacement.           |

### OrientFromFace

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientFromFace()
```

### OrientPolygonFaces

Orient tessellation elements.

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientPolygonFaces(OccurrenceList occurrences, bool makeOrientable = true, bool useArea = false, OrientStrategy orientStrategy = OrientStrategy.ExteriorOnly)
```

Parameters

| Type                                                          | Name           | Description                                              |
| ------------------------------------------------------------- | -------------- | -------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences    | Occurrences of components to process.                    |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | makeOrientable | Crack moebius strips to make the model orientable.       |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | useArea        | Use the area instead of counting the number of triangle. |
| [OrientStrategy](./algo_orientstrategy)                       | orientStrategy | Strategy to adopt with this algorithm.                   |

### OrientPolygonFacesAdvanced

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientPolygonFacesAdvanced(OccurrenceList occurrences, double voxelSize, double minimumCavityVolume, int resolution, InnerOuterOption mode = InnerOuterOption.All, bool considerTransparentOpaque = true, OrientStrategyAdvanced orientStrategy = OrientStrategyAdvanced.VisibilityByConnected)
```

Parameters

| Type                                                           | Name                      | Description                                                                                 |
| -------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences               | Occurrences to orient.                                                                      |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | voxelSize                 | Size of the voxels in mm (smaller it is, more viewpoints there are).                        |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | minimumCavityVolume       | Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are).       |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution                | Resolution of the visibility viewer.                                                        |
| [InnerOuterOption](./algo_innerouteroption)                    | mode                      | Select where to place camera (all cavities, only outer or only inner cavities).             |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean)  | considerTransparentOpaque | If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. |
| [OrientStrategyAdvanced](./algo_orientstrategyadvanced)        | orientStrategy            | Strategy to adopt with this algorithm.                                                      |

### OrientPolygonFacesFromCamera

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void OrientPolygonFacesFromCamera(OccurrenceList occurrences, Point3 cameraPosition, Point3 cameraDirection, Point3 cameraUp, int resolution, double fovX = 90)
```

Parameters

| Type                                                           | Name            | Description                           |
| -------------------------------------------------------------- | --------------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences     | Occurrences to orient.                |
| [Point3](./geom_point3)                                        | cameraPosition  | Camera position.                      |
| [Point3](./geom_point3)                                        | cameraDirection | Camera direction.                     |
| [Point3](./geom_point3)                                        | cameraUp        | Camera up vector.                     |
| [int](https://learn.microsoft.com/dotnet/api/system.int32)     | resolution      | Resolution of the visibility viewer.  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | fovX            | Horizontal field of view (in degree). |

### Equilateralize

Sswap edges to make triangles more equilateral.

```csharp
[HandleProcessCorruptedStateExceptions]
public void Equilateralize(OccurrenceList occurrences, int maxIterations = 1)
```

Parameters

| Type                                                       | Name          | Description                           |
| ---------------------------------------------------------- | ------------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                   | occurrences   | Occurrences of components to process. |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | maxIterations | Maximum number of swapping iteration. |

### Quadify

Merge all triangle polygons in the meshes to quadrangles.

```csharp
[HandleProcessCorruptedStateExceptions]
public void Quadify(OccurrenceList occurrences)
```

Parameters

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

### Requadify

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void Requadify(OccurrenceList occurrences, bool forceFullQuad = true)
```

Parameters

| Type                                                          | Name          | Description                                                                  |
| ------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                      | occurrences   | Occurrences of components to process.                                        |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | forceFullQuad | Force the results to be only full quad. It it's impossible, nothing is done. |

### Triangularize

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void Triangularize(OccurrenceList occurrences)
```

Parameters

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

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVertexWeightsFromVertexColors(OccurrenceList occurrences, double offset = 0, double scale = 1, VertexWeightStrategy strategy = VertexWeightStrategy.RedBlueDiff)
```

Parameters

| Type                                                           | Name        | Description                           |
| -------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | offset      | Offset value for weight computation.  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | scale       | Scale value for weight computation.   |
| [VertexWeightStrategy](./algo_vertexweightstrategy)            | strategy    | How vertex weights are computed.      |

### 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.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVertexWeightsFromVisibilityAttributes(OccurrenceList occurrences, double offset = 0, double scale = 1)
```

Parameters

| Type                                                           | Name        | Description                           |
| -------------------------------------------------------------- | ----------- | ------------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                       | occurrences | Occurrences of components to process. |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | offset      | Offset value for weight computation.  |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | scale       | Scale value for weight computation.   |

### DeleteVertexWeights

Remove any existing vertex weights attributes on given occurrences.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteVertexWeights(OccurrenceList occurrences)
```

Parameters

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

### CreateVisibilityAttributes

Create visibility attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void CreateVisibilityAttributes(OccurrenceList occurrences)
```

Parameters

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

### DeletePolygonalWeightAttribute

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeletePolygonalWeightAttribute(OccurrenceList occurrences)
```

Parameters

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

### DeleteVisibilityAttributes

Delete visibility attributes on tessellations.

```csharp
[HandleProcessCorruptedStateExceptions]
public void DeleteVisibilityAttributes(OccurrenceList occurrences)
```

Parameters

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

### FlagVisibilityAttributesOnTransparents

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void FlagVisibilityAttributesOnTransparents(OccurrenceList occurrences)
```

Parameters

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

### TransferVisibilityToPolygonalWeight

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

```csharp
[HandleProcessCorruptedStateExceptions]
public void TransferVisibilityToPolygonalWeight(OccurrenceList occurrences, VisibilityToWeightMode Mode)
```

Parameters

| Type                                                    | Name        | Description                      |
| ------------------------------------------------------- | ----------- | -------------------------------- |
| [OccurrenceList](./scene_occurrencelist)                | occurrences | Part occurrences to process.     |
| [VisibilityToWeightMode](./algo_visibilitytoweightmode) | Mode        | Mode used to compute visibility. |
