# class ReductionSettings

Settings for the ReductionProcessor class. Handles all the settings for Simplygons simplification algorithms. The user can tell the reduction processor which features are important by using the 'FeatureFlags' parameter, and also the relative importance of these features using the Set{feature}Importance methods. Also settings for things like symmetry are set here.

# Properties

Property Description
AllowDegenerateTexCoords The AllowDegenerateTexCoords flag. If true, texture coordinates are allowed to become degenerate (triangles can have 0 area in texture space). This may sometimes look better, but if tangent space normals are used, tangent spaces may become degenerate.
CreateGeomorphGeometry The CreateGeomorphGeometry value. If set, the reducer will create a GeometryData object that is a morphed version of the original GeometryData, that can be used to morph between the original geometry and the reduced geometry. Should not be used together with TJunctionRemover, NormalRecalculation or Material LOD.
CurvatureImportance This importance is deprecated and disabled.
DataCreationPreferences The flag that specifies how big "freedom" Simplygon has when it comes to altering vertex/triangle data. Allowing more altered data means it will be easier to create good looking LODs, but without altered data it will be easier to keep the memory-usage in the LOD-chain more optimized. Note: When using OnlyUseOriginalData, the geometry being reduced can not have a node transformation matrix other than the identity matrix.
EdgeSetImportance The importance value of user selected edges. Can be used when a Boolean UserCornerField with the name SgEdgeSelectionSet is added to the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
GenerateGeomorphData The flag for if the reduction process should store geomorph data in the processed GeometryData object. This data is an array with same size as the vertexcount was before the reduction process, and will have the coordinates for each vertex on its corresponding position on the reduced GeometryData surface. Can be used to give smooth transition from a highlevel LOD to a lowlevel LOD. This array can be accessed with the GeometryData custom field "SgMappedVertexCoords".
GeometryImportance The importance value of the position of the vertices and triangles of the Geometry, or the silhouette of the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
GroupImportance The importance value of the boundary between triangles from different sub-geometries. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
InwardMoveMultiplier The inward move multiplier, how much the mesh is allowed to shrink its silhouette perimeter.
KeepSymmetry The KeepSymmetry flag. If set, the reducer will detect symmetric features, and retain symmetry during processing. Please note that for a geometry to be considered symmetrical, also the texture coordinates must be mirrored.
KeepUnprocessedSceneMeshes If false, the processor will remove all geometry and scene meshes which were not selected for processing from the scene. If true, only the geometry in the ProcessSelectionSet will be replaced or updated, while the rest of the scene tree is kept intact. New geometry is always added as the last child of the scene root. If generating a mappingimage to cast materials, new materialIds will also be appended to the end of the old material table instead of replacing the old ones.
LockGeometricBorder If set, will lock the geometric border of the geometry, and not reduce at all. This setting might be useful if the geometry needs to fit a neighbor geometry, but will reduce overall reduction quality (geometric quality over reduction ratio)
MaterialImportance The importance value of the boundary between triangles with different materials. For example, if triangles with a metallic material are connected to triangles with a wood material, this setting will determine how important it is to keep the border between them intact. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
MaxEdgeLength The maximum length of the triangles edges after reduction. Can be used to limit output triangle size.
MergeGeometries The processor will merge all the geometries in the scene into a single geometry if MergeGeometries is enabled.
OutwardMoveMultiplier The outward move multiplier, how much the mesh is allowed to grow its silhouette perimeter.
ProcessSelectionSetID Which selection set should be processed. If set to -1, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.
ProcessSelectionSetName Which selection set should be processed. If the name is not found, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.
ReductionHeuristics The flag that decides how precise the reducer will be during the mesh reduction. Fast -> Reducer will be faster, but onscreensize and trianglecount will not match perfectly. Consistent -> Reducer will be slower, but onscreensize and trianglecount will consistently give matching results.
ReductionTargetMaxDeviation The MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.
ReductionTargetMaxDeviationEnabled Enable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.
ReductionTargetOnScreenSize The OnScreenSize value, used to calculate the maximum surface-deviation allowed, by assuming errors less than 1 pixel onscreen will not be noticable.
ReductionTargetOnScreenSizeEnabled Enable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.
ReductionTargetStopCondition The stop condition for the reducer. Any -> the reducer will stop when any single one of the set reduction targets have been reached. All -> the reducer will stop when all enabled reduction targets have been set.
ReductionTargetTriangleCount The wanted triangle count. The range is 0->inf.
ReductionTargetTriangleCountEnabled Enable triangle count as a reduction target. The reducer will stop when the set triangle count has been reached.
ReductionTargetTriangleRatio The wanted reduction ratio. The range is 0->1.
ReductionTargetTriangleRatioEnabled Enable triangle ratio as a reduction target. The reducer will stop when the set triangle-ratio has been reached.
ShadingImportance The importance value of the vertex-normals of the Geometry, both the sharp edges, as well as how the normals interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
SkinningImportance The importance value of the bone-weights of the vertices. The more impact a vertex has on the skinning of the Geometry (for example, vertices close to joints), the more likely it is to be kept. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
SymmetryAxis Set what axis to be used for symmetry calculations.
SymmetryDetectionTolerance The tolerance used when detecting symmetry. Values in the ranges 1e-5 to 1e-3 will usually produce good results. This specific tolerance corresponds to the off-plane tolerance, ie. the tolerance of the coordinate components that are not the symmetry axis. The in-plane tolerance is always 10 times the off-plane tolerance. This value is relative to the size of the Geometry, so 0.01 would mean 1% of the bounding box size of the Geometry.
SymmetryOffset Set SymmetryOffset, the position on the symmetry axis where the symmetry plane is placed.
TextureImportance The importance value of the UV coordinates of the Geometry, both the boundary of the UV charts, as well as the UV stretch across the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
UseAutomaticSymmetryDetection The AutomaticSymmetryDetection flag. If set, and KeepSymmetry is on, the reducer will detect any X,Y,Z symmetry plane and will override any user set symmetry plane with the detected one. If no symmetry is found, KeepSymmetry will be turned off before reduction.
UseHighQualityNormalCalculation Set to true and the reducer will do a much more precise way of calculating the vertex normals. It will however be slower. Set to false and it will do a much more rough estimation of what the vertex normals will look like, but faster.
UseSymmetryQuadRetriangulator The UseSymmetryQuadRetriangulator flag. If true, and KeepSymmetry is on, any triangles that have been triangulated from symmetrical quads into unsymmetrical triangles are detected and fixed. The edges of said triangles are flipped across the old quad so that the mesh becomes symmetrical again.
VertexColorImportance The importance value of the vertex-colors of the Geometry, both the boundary between triangles with different colors, as well as how the colors interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

# Methods

Method Description
GetBoolParameter Get a named parameter boolean value.
GetClass Get the name of the ReductionSettings class.
GetDoubleParameter Get a named parameter floating point value.
GetErrorString Returns a string describing the error that was found the last time ValidateSettings was performed.
GetIntParameter Get a named parameter integer value.
GetStringParameter Get a named parameter string value.
GetUIntParameter Get a named parameter unsigned integer value.
IsA Returns true if ReductionSettings is a or is a descendant of the class named as the type parameter.
IsNull Returns true if the ReductionSettings object is invalid.
SetBoolParameter Set a named parameter boolean value.
SetDoubleParameter Set a named parameter floating point value.
SetIntParameter Set a named parameter integer value.
SetReductionTargets Set reduction targets and stop condition used in the reduction.
SetStringParameter Set a named parameter string value.
SetUIntParameter Set a named parameter unsigned integer value.
SetValidateParameterNames Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.
ToJSON Get settings as JSON for debugging purposes.
ValidateSettings Validates the current settings values.

# Static methods

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter.
SafeCast SafeCast makes sure the input object is of a class that can be cast into spReductionSettings, and if this is the case, returns the object cast into spReductionSettings.

# Properties details

# AllowDegenerateTexCoords

The AllowDegenerateTexCoords flag. If true, texture coordinates are allowed to become degenerate (triangles can have 0 area in texture space). This may sometimes look better, but if tangent space normals are used, tangent spaces may become degenerate.

    # CreateGeomorphGeometry

    The CreateGeomorphGeometry value. If set, the reducer will create a GeometryData object that is a morphed version of the original GeometryData, that can be used to morph between the original geometry and the reduced geometry. Should not be used together with TJunctionRemover, NormalRecalculation or Material LOD.

      # CurvatureImportance

      This importance is deprecated and disabled.

        # DataCreationPreferences

        The flag that specifies how big "freedom" Simplygon has when it comes to altering vertex/triangle data. Allowing more altered data means it will be easier to create good looking LODs, but without altered data it will be easier to keep the memory-usage in the LOD-chain more optimized. Note: When using OnlyUseOriginalData, the geometry being reduced can not have a node transformation matrix other than the identity matrix.

          # EdgeSetImportance

          The importance value of user selected edges. Can be used when a Boolean UserCornerField with the name SgEdgeSelectionSet is added to the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

            # GenerateGeomorphData

            The flag for if the reduction process should store geomorph data in the processed GeometryData object. This data is an array with same size as the vertexcount was before the reduction process, and will have the coordinates for each vertex on its corresponding position on the reduced GeometryData surface. Can be used to give smooth transition from a highlevel LOD to a lowlevel LOD. This array can be accessed with the GeometryData custom field "SgMappedVertexCoords".

              # GeometryImportance

              The importance value of the position of the vertices and triangles of the Geometry, or the silhouette of the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                # GroupImportance

                The importance value of the boundary between triangles from different sub-geometries. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                  # InwardMoveMultiplier

                  The inward move multiplier, how much the mesh is allowed to shrink its silhouette perimeter.

                    # KeepSymmetry

                    The KeepSymmetry flag. If set, the reducer will detect symmetric features, and retain symmetry during processing. Please note that for a geometry to be considered symmetrical, also the texture coordinates must be mirrored.

                      # KeepUnprocessedSceneMeshes

                      If false, the processor will remove all geometry and scene meshes which were not selected for processing from the scene. If true, only the geometry in the ProcessSelectionSet will be replaced or updated, while the rest of the scene tree is kept intact. New geometry is always added as the last child of the scene root. If generating a mappingimage to cast materials, new materialIds will also be appended to the end of the old material table instead of replacing the old ones.

                        # LockGeometricBorder

                        If set, will lock the geometric border of the geometry, and not reduce at all. This setting might be useful if the geometry needs to fit a neighbor geometry, but will reduce overall reduction quality (geometric quality over reduction ratio)

                          # MaterialImportance

                          The importance value of the boundary between triangles with different materials. For example, if triangles with a metallic material are connected to triangles with a wood material, this setting will determine how important it is to keep the border between them intact. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                            # MaxEdgeLength

                            The maximum length of the triangles edges after reduction. Can be used to limit output triangle size.

                              # MergeGeometries

                              The processor will merge all the geometries in the scene into a single geometry if MergeGeometries is enabled.

                                # OutwardMoveMultiplier

                                The outward move multiplier, how much the mesh is allowed to grow its silhouette perimeter.

                                  # ProcessSelectionSetID

                                  Which selection set should be processed. If set to -1, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.

                                    # ProcessSelectionSetName

                                    Which selection set should be processed. If the name is not found, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.

                                      # ReductionHeuristics

                                      The flag that decides how precise the reducer will be during the mesh reduction. Fast -> Reducer will be faster, but onscreensize and trianglecount will not match perfectly. Consistent -> Reducer will be slower, but onscreensize and trianglecount will consistently give matching results.

                                        # ReductionTargetMaxDeviation

                                        The MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.

                                          # ReductionTargetMaxDeviationEnabled

                                          Enable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.

                                            # ReductionTargetOnScreenSize

                                            The OnScreenSize value, used to calculate the maximum surface-deviation allowed, by assuming errors less than 1 pixel onscreen will not be noticable.

                                              # ReductionTargetOnScreenSizeEnabled

                                              Enable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.

                                                # ReductionTargetStopCondition

                                                The stop condition for the reducer. Any -> the reducer will stop when any single one of the set reduction targets have been reached. All -> the reducer will stop when all enabled reduction targets have been set.

                                                  # ReductionTargetTriangleCount

                                                  The wanted triangle count. The range is 0->inf.

                                                    # ReductionTargetTriangleCountEnabled

                                                    Enable triangle count as a reduction target. The reducer will stop when the set triangle count has been reached.

                                                      # ReductionTargetTriangleRatio

                                                      The wanted reduction ratio. The range is 0->1.

                                                        # ReductionTargetTriangleRatioEnabled

                                                        Enable triangle ratio as a reduction target. The reducer will stop when the set triangle-ratio has been reached.

                                                          # ShadingImportance

                                                          The importance value of the vertex-normals of the Geometry, both the sharp edges, as well as how the normals interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                                                            # SkinningImportance

                                                            The importance value of the bone-weights of the vertices. The more impact a vertex has on the skinning of the Geometry (for example, vertices close to joints), the more likely it is to be kept. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                                                              # SymmetryAxis

                                                              Set what axis to be used for symmetry calculations.

                                                                # SymmetryDetectionTolerance

                                                                The tolerance used when detecting symmetry. Values in the ranges 1e-5 to 1e-3 will usually produce good results. This specific tolerance corresponds to the off-plane tolerance, ie. the tolerance of the coordinate components that are not the symmetry axis. The in-plane tolerance is always 10 times the off-plane tolerance. This value is relative to the size of the Geometry, so 0.01 would mean 1% of the bounding box size of the Geometry.

                                                                  # SymmetryOffset

                                                                  Set SymmetryOffset, the position on the symmetry axis where the symmetry plane is placed.

                                                                    # TextureImportance

                                                                    The importance value of the UV coordinates of the Geometry, both the boundary of the UV charts, as well as the UV stretch across the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                                                                      # UseAutomaticSymmetryDetection

                                                                      The AutomaticSymmetryDetection flag. If set, and KeepSymmetry is on, the reducer will detect any X,Y,Z symmetry plane and will override any user set symmetry plane with the detected one. If no symmetry is found, KeepSymmetry will be turned off before reduction.

                                                                        # UseHighQualityNormalCalculation

                                                                        Set to true and the reducer will do a much more precise way of calculating the vertex normals. It will however be slower. Set to false and it will do a much more rough estimation of what the vertex normals will look like, but faster.

                                                                          # UseSymmetryQuadRetriangulator

                                                                          The UseSymmetryQuadRetriangulator flag. If true, and KeepSymmetry is on, any triangles that have been triangulated from symmetrical quads into unsymmetrical triangles are detected and fixed. The edges of said triangles are flipped across the old quad so that the mesh becomes symmetrical again.

                                                                            # VertexColorImportance

                                                                            The importance value of the vertex-colors of the Geometry, both the boundary between triangles with different colors, as well as how the colors interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

                                                                              # Methods details

                                                                              # GetBoolParameter

                                                                              Get a named parameter boolean value.

                                                                                # GetClass

                                                                                Get the name of the ReductionSettings class.

                                                                                  # GetDoubleParameter

                                                                                  Get a named parameter floating point value.

                                                                                    # GetErrorString

                                                                                    Returns a string describing the error that was found the last time ValidateSettings was performed.

                                                                                      # GetIntParameter

                                                                                      Get a named parameter integer value.

                                                                                        # GetStringParameter

                                                                                        Get a named parameter string value.

                                                                                          # GetUIntParameter

                                                                                          Get a named parameter unsigned integer value.

                                                                                            # IsA

                                                                                            Returns true if ReductionSettings is a or is a descendant of the class named as the type parameter.

                                                                                              # IsNull

                                                                                              Returns true if the ReductionSettings object is invalid.

                                                                                                # SetBoolParameter

                                                                                                Set a named parameter boolean value.

                                                                                                  # SetDoubleParameter

                                                                                                  Set a named parameter floating point value.

                                                                                                    # SetIntParameter

                                                                                                    Set a named parameter integer value.

                                                                                                      # SetReductionTargets

                                                                                                      Set reduction targets and stop condition used in the reduction.

                                                                                                        # SetStringParameter

                                                                                                        Set a named parameter string value.

                                                                                                          # SetUIntParameter

                                                                                                          Set a named parameter unsigned integer value.

                                                                                                            # SetValidateParameterNames

                                                                                                            Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.

                                                                                                              # ToJSON

                                                                                                              Get settings as JSON for debugging purposes.

                                                                                                                # ValidateSettings

                                                                                                                Validates the current settings values.

                                                                                                                  # Static methods details

                                                                                                                  # IsClassA

                                                                                                                  Returns true if the class is a or is a descendant of the class named as the type parameter.

                                                                                                                    # SafeCast

                                                                                                                    SafeCast makes sure the input object is of a class that can be cast into spReductionSettings, and if this is the case, returns the object cast into spReductionSettings.