# class PartRemover

The PartRemover tool can identify unconnected sub-meshes, and remove meshes that fall below a set size threshold. This size threshold can be set globally for the entire geometry, or per-material to be able to remove things like decals effectively.

# Properties

Property Description
Geometry The geometry data object to run the part removal on. If a scene is set, this parameter is ignored by the reducer.
Scene The scene object to run the part removal on.
SizeThreshold The size threshold to be used when removing parts. If SizeThreshold is equal to, or greater than, the boundingbox radius of a part, then that part is removed. If UsePerMaterialSizeThresholds is true, this value will be ignored and the per-material values will be used instead.
UsePerMaterialSizeThresholds The UsePerMaterialSizeThresholds flag. If true, the global SizeThreshold value will be ignored and the per-material values in the PerMaterialSizeThresholds will be used instead.

# Methods

Method Description
GetClass Get the name of the PartRemover class.
GetPerMaterialSizeThresholds The per-material threshold array. These thresholds are mapped per material ID in the geometrydata object if UsePerMaterialSizeThresholds is true. The size and values in this array needs to be set up by the user, and material IDs that fall outside the set array will be ignored.
IsA Returns true if PartRemover is a or is a descendant of the class named as the type parameter.
IsNull Returns true if the PartRemover object is invalid.
RunPartRemoval Runs the part removal processing.

# 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 spPartRemover, and if this is the case, returns the object cast into spPartRemover.

# Properties details

# Geometry

The geometry data object to run the part removal on. If a scene is set, this parameter is ignored by the reducer.

# Syntax

// Setter
void SetGeometry( spGeometryData value );

// Getter
spGeometryData GetGeometry();

# SetGeometry parameters

Type Name Min Max Description
GeometryData value The geometry data to be used for processing.

# GetGeometry return value

Type: GeometryData

# Scene

The scene object to run the part removal on.

# Syntax

// Setter
void SetScene( spScene value );

// Getter
spScene GetScene();

# SetScene parameters

Type Name Min Max Description
Scene value The scene data to be used for processing.

# GetScene return value

Type: Scene

# SizeThreshold

The size threshold to be used when removing parts. If SizeThreshold is equal to, or greater than, the boundingbox radius of a part, then that part is removed. If UsePerMaterialSizeThresholds is true, this value will be ignored and the per-material values will be used instead.

# Syntax

// Setter
void SetSizeThreshold( real value );

// Getter
real GetSizeThreshold();

# SetSizeThreshold parameters

Type Name Min Max Description
real value The new value of SizeThreshold.

# GetSizeThreshold return value

Type: real

# UsePerMaterialSizeThresholds

The UsePerMaterialSizeThresholds flag. If true, the global SizeThreshold value will be ignored and the per-material values in the PerMaterialSizeThresholds will be used instead.

# Syntax

// Setter
void SetUsePerMaterialSizeThresholds( bool value );

// Getter
bool GetUsePerMaterialSizeThresholds();

# SetUsePerMaterialSizeThresholds parameters

Type Name Min Max Description
bool value The new value of UsePerMaterialSizeThresholds.

# GetUsePerMaterialSizeThresholds return value

Type: bool

# Methods details

# GetClass

Get the name of the PartRemover class.

# Syntax

spString GetClass();

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetPerMaterialSizeThresholds

The per-material threshold array. These thresholds are mapped per material ID in the geometrydata object if UsePerMaterialSizeThresholds is true. The size and values in this array needs to be set up by the user, and material IDs that fall outside the set array will be ignored.

# Syntax

spRealArray GetPerMaterialSizeThresholds();

# Parameters

GetPerMaterialSizeThresholds takes no parameters.

# Return value

Type: RealArray

# IsA

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

# Syntax

bool IsA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if PartRemover is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the PartRemover object is invalid.

# Syntax

bool IsNull();

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# RunPartRemoval

Runs the part removal processing.

# Syntax

void RunPartRemoval();

# Parameters

RunPartRemoval takes no parameters.

# Static methods details

# IsClassA

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

# Syntax

static bool IsClassA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# SafeCast

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

# Syntax

static spPartRemover SafeCast( spObject object );

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: PartRemover