# Polygon Optimizer

Section Name [PLYGNOPTIMIZE]

## Process_(process number)

Specify the processes to run with a positive integer number (process number) to define the running order.
Processes will be performed in ascending order.
Please ensure to start the process number with zero and use serial numbers for the following processes.
Add “_(process number)” to parameter names as suffix to set parameters for an individual process instead of using a common parameter.
Sample:

    Process_3=RepairAllShortEdge
    PhShortLength_3=0.01
    .....
    Process_5=RepairAllShortEdge
    PhShortLength_5=0.1

- Values
  - AutoHeal: Auto Heal
  - Smooth: Smoothing Polygon
  - SharpenEdge: Sharpen Edge
  - Remesh: Remesh
  - Wrap: Wrapping
  - Offset: Offset
  - Decimate: Decimate
  - FillHole: Fill Hole
  - Stitch: Stitch
  - RepairAllSharpEdge: Repair All Sharp Edges
  - DeleteSharpEdgeAndFillHole: Delete All Sharp Edges and Fill Holes
  - RepairAllShortEdge: Repair All Short Edges
  - RepairAllLongEdge: Repair All Long Edges
  - RepairAllSliverTriangle: Repair All Sliver Triangles
  - RepairAllSmallShell: Repair All Small Shells
  - RepairAllSmallVolume: Repair All Small Volumes
  - RepairAllCavity: Repair All Inner Voids
  - RepairOverlappingTriangles: Heal Polygon | Repair Overlapping Polygons
  - Retopology: Regenerate Polygon
  - DenoisePointCloud: Remove Noise | Fair Point Cloud
  - RemovePointCloudOutliers: Remove Noise | Remove Outlier from Point Cloud
  - GeneratePolygons: Generate Polygon from Point Cloud
  - BreakPolygons: Generate Point Cloud from Polygon
  - End: Use this to stop the process. (Processes specified after this will be ignored.)

## ProcessNumberMax

Specify a value to control the processes to run by a positive integer number.
The processes whose process numbers are larger than this value will be ignored.

- Value: Positive integer number

## Process AutoHeal

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### ModifyPolygonFreeEdge

Specify whether to heal free edges

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonSharpEdge

Specify whether to heal sharp edges

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonShortEdge

Specify whether to heal short edges

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonLongEdge

Specify whether to heal long edges

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonSliverTriangle

Specify whether to heal sliver triangles

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonSmallShell

Specify whether to heal small shells

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonSmallVolume

Specify whether to heal small volumes

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyPolygonCavity

Specify whether to heal inner voids

- Default Value: 0
- Values
  - 0: Don’t heal
  - 1: Heal

### ModifyTunnel

Specify whether to repair tunnel errors.

- Default Value: 0
- Values
  - 0: Don’t repair tunnels
  - 1: Repair tunnels

### ModifyHandle

Specify whether to repair handle(*1) errors.

(*1): Polygons are making an “overhead crossing” shape which is connected with a single free edge loop. Filling holes without repairing this error will produce a tunnel error.

- Default Value: 0
- Values
  - 0: Don’t repair handles
  - 1: Repair handles

### ModifyFoldedPolygon

Specify whether to repair folded polygons by removing them and filling the produced holes.

- Default Value: 0
- Values
  - 0: Don’t repair folded polygons
  - 1: Repair folded polygons

### MaxHoleWidth

Specify the upper tolerance (maximum allowed value) on the hole width for healing PDQ errors
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### HoleExceptMostOuter

Exempt the widest hole from the target

- Default Value: 0
- Values
  - 0: Don’t exempt
  - 1: Exempt

### ModifyFilledSurface

Modify filled surface

- Default Value: 1
- Values
  - 0: Don’t modify
  - 1: Modify

### WeightOfOutsideForHole

Weight of shape outside a hole in modification of filled surface
Real number value between 0.0 and 1.0
0.0: Minimize surface area
1.0: Equalize surface curvature

- Default Value: 1

### HoleFillingQuality

Specify the quality level of the surface after filling holes.
Please note that it improves the quality, but increases the processing time as well, to specify a greater value.

- Default Value: 3
- Values
  - 1: Very low (Prioritize the speed)
  - 2: Low (Prioritize the speed while assuring a certain quality)
  - 3: Standard (Default value)
  - 4: High (Prioritize the quality)

### PhSharpAngle

Maximum edge angle for recognition of sharp edges
Positive real number value

- Default Value: 10

### PhShortLength

Maximum edge length for recognition of short edges
Positive real number value

- Default Value: 0.01

### PhLongLength

Minimum edge length for recognition of long edges
Positive real number value

- Default Value: 10

### PhSliverAngle

Maximum angle for recognition of sliver triangles
Positive real number value

- Default Value: 1.5

### PhTinyArea

Maximum area for recognition of small shells
Positive real number value

- Default Value: 0.001

### PhTinyVolume

Maximum volume for recognition of small volumes
Positive real number value

- Default Value: 0.0001

### MaxCavityVolume

Specify the upper tolerance (maximum allowed value) on the volume of the inner void for healing PDQ errors
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### FoldedPolygonAngle

Specify the upper tolerance of the angle in folded polygon detection.
Folded polygons making an angle smaller than this value will be removed and the produced holes will be filled.
Specify by a positive real number.
This is effective only when “ModifyFoldedPolygon=1”.

- Default Value: 45

## Process Smooth

### SmoothNum

Specify how many times to run the polygon smoothing process (internal computation).
Specify by a positive integer number.
The smaller value is set, the smoother the result polygon will be, but the lower the fidelity to the original polygon will be.

- Default Value: 3

## Process SharpenEdge

### SharpenNum

Specify how many times to run the edge sharpening process.
Specify by a positive integer number.

- Default Value: 20

## Process Remesh

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### RemeshLongEdgeLen

Specify the upper tolerance (maximum allowed value) on the length of the polygon edge.
Set a positive real number which is larger than the value set for “RemeshShortEdgeLen”
An appropriate value will be calculated automatically based on the length of polygon edges when this parameter is not set.

- Default Value:

### RemeshShortEdgeLen

Specify the lower tolerance (minimum allowed value) on the length of the polygon edge.
Set a positive real number which is smaller than the value set for “RemeshLongEdgeLen”
An appropriate value will be calculated automatically based on the length of polygon edges when this parameter is not set.

- Default Value:

### RemeshIter

Specify how many times to run the remeshing process.
Specify by a positive integer number.

- Default Value: 3

## Process Wrap

### MinVoxelSizeForWrap

Specify the resolution for dividing voxels
Set a positive real number.
An appropriate value will be applied based on the size of the polygon model when this parameter is not set.
Please note that it improves the accuracy, but increases the processing time / memory consumption at the same time to set a small value.

- Default Value:

### FillingTolForWrap

Tolerance to fill between the polygons
Positive real number value

- Default Value: 0

### WrapSimplify

Simplify the polygon data after wrapping

- Default Value: 0
- Values
  - 0: Don’t simplify
  - 1: Simplify

### WrapDeleteOriginal

Specify whether to delete original

- Default Value: 1
- Values
  - 0: Don’t delete To each top assembly a new part is inserted after a new assembly which includes all parts not included by any assembly is constructed
  - 1: Delete Output consists of just one part

## Process Offset

### PolygonOffset

Offset value
Negative values offset in the opposite direction of positive values
Real number value

- Default Value: 0

### PolygonOffsetSolidConstruction

Specify whether to construct closed solid model from the offset polygon and the original polygon

- Default Value: 0
- Values
  - 0: Don’t construct
  - 1: Construct

## Process Decimate

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### DecimateTargetRatio

Ratio of target triangle number
If you set this value along with DecimateTargetNum, this value takes a priority.
Real number value between 0.0 and 1.0

- Default Value: 0.8

### DecimateTargetNum

Target triangle number
If you set this value along with DecimateTargetRatio, DecimateTargetRatio takes a priority.
Positive integer

- Default Value:

## Process FillHole

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### MaxHoleWidth

Specify the upper tolerance (maximum allowed value) on the hole width for healing PDQ errors
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### HoleExceptMostOuter

Exempt the widest hole from the target

- Default Value: 0
- Values
  - 0: Don’t exempt
  - 1: Exempt

### ModifyFilledSurface

Modify filled surface

- Default Value: 1
- Values
  - 0: Don’t modify
  - 1: Modify

### WeightOfOutsideForHole

Weight of shape outside a hole in modification of filled surface
Real number value between 0.0 and 1.0
0.0: Minimize surface area
1.0: Equalize surface curvature

- Default Value: 1

### HoleFillingQuality

Specify the quality level of the surface after filling holes.
Please note that it improves the quality, but increases the processing time as well, to specify a greater value.

- Default Value: 3
- Values
  - 1: Very low (Prioritize the speed)
  - 2: Low (Prioritize the speed while assuring a certain quality)
  - 3: Standard (Default value)
  - 4: High (Prioritize the quality)

## Process Stitch

### PolygonStitch

Maximum width of gap to be filled
Positive real number value

- Default Value: 0.01

### PhShortLength

Maximum edge length for recognition of short edges
Positive real number value

- Default Value: 0.01

## Process RepairAllSharpEdge

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### PhSharpAngle

Maximum edge angle for recognition of sharp edges
Positive real number value

- Default Value: 10

## Process DeleteSharpEdgeAndFillHole

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### PhSharpAngle

Maximum edge angle for recognition of sharp edges
Positive real number value

- Default Value: 10

### HoleFillingQuality

Specify the quality level of the surface after filling holes.
Please note that it improves the quality, but increases the processing time as well, to specify a greater value.

- Default Value: 3
- Values
  - 1: Very low (Prioritize the speed)
  - 2: Low (Prioritize the speed while assuring a certain quality)
  - 3: Standard (Default value)
  - 4: High (Prioritize the quality)

## Process RepairAllShortEdge

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### PhShortLength

Maximum edge length for recognition of short edges
Positive real number value

- Default Value: 0.01

## Process RepairAllLongEdge

### PhLongLength

Minimum edge length for recognition of long edges
Positive real number value

- Default Value: 10

## Process RepairAllSliverTriangle

### PhTolerance

Specify the distance tolerance for modification
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

### PhSliverAngle

Specify the maximum angle for sliver triangle detection.
Specify by a positive real number.

- Default Value: 1.5

## Process RepairAllSmallShell

### PhTinyArea

Maximum area for recognition of small shells
Positive real number value

- Default Value: 0.001

## Process RepairAllSmallVolume

### PhTinyVolume

Maximum volume for recognition of small volumes
Positive real number value

- Default Value: 0.0001

## Process RepairAllCavity

### MaxCavityVolume

Specify the upper tolerance (maximum allowed value) on the volume of the inner void for healing PDQ errors
Set a positive real number
An appropriate value will be applied by an automatic calculation based on the length of polygon edges when this parameter is not set.

- Default Value:

## Process RepairOverlappingTriangles

### OverlappingTolerance

Specify the distance tolerance for overlapping polygon detection.
Polygon faces that exist parallel to each other within this distance will be merged.
Specify by a positive real number.

- Default Value: 1

## Process Retopology

### RetopologyFidelity

Specify the fidelity level to the original shape in mesh reconstruction.

- Default Value: 5
- Values
  - 0: Very low
  - 1: Low
  - 2: Mid-to-low
  - 3: Mid-to-high
  - 4: High
  - 5: Very high

## Process DenoisePointCloud

### FairingRadius

Specify the area to reference in noise reduction by the sphere radius from each point. (Unit: mm)
Each point will be re-located at an optimal location referencing the points in the specified area. The greater the specified value is, the smoother (details may be simplified) the result point cloud will be.
Specify by a positive real number, or an appropriate value will be set automatically when this is not set.

- Default Value:

### ResultDataSize

Specify how much you wish to reduce the data size through noise reduction by the ratio of the data size of the result point cloud to that of the original point cloud.
Specify by a positive real number between zero (0) to 1.

- Default Value: 1

## Process RemovePointCloudOutliers

### OutlierDistance

Specify the distance between points to use in grouping points. (Unit: mm)
A group of points will consist of points that are located within this distance to an adjacent point, and a new group will be created when a point is more distant than this value.
The groups that have a smaller number of points than the threshold (“OutlierSize”) will be detected as outliers and removed.
Specify by a positive real number.

- Default Value: 100

### OutlierSize

Specify the maximum number of points in a point group to detect as outlier points.
All points in the groups that have less than this number of points will be removed.
Specify by a positive integer number.

- Default Value: 10

## Process GeneratePolygons

### PoissonMeshFineness

Specify the fineness level of the meshes in polygon generation.

- Default Value: 10
- Values
  - 6: Very coarse
  - 7: Coarse
  - 8: Rather coarse
  - 9: Normal
  - 10: Rather fine
  - 11: Fine
  - 12: Very fine

### PoissonTrimmingArea

Specify the level of fidelity to the source point cloud by the trim amount of the sparse areas of point cloud in Poisson surface mesh generation.
The greater value you set, the higher fidelity the result polygon model will be.
The smaller value you set, the more fully the sparse areas will be complemented.

- Default Value: 3
- Values
  - 0: Very small (Fully complements holes due to low density of source point cloud)
  - 1: Small
  - 2: Rather small
  - 3: Normal (Recommended)
  - 4: Rather large
  - 5: Large
  - 6: Very large (Preserve the details and leave sparse areas as holes)

## Process BreakPolygons