Skip to main content

SurfaceOperations

Operations

Provides tools for creating, editing, and analyzing 3D surface objects. Supports import/export, primitive generation, mesh repair, transformation, boolean operations, remeshing, and conversion between surface and volume representations.

Import

import ScriptingApi as api

# Access via Application
app = api.Application()
ops = app.get_surface_operations()

Methods

Properties

get_render_properties_operations

Returns a SurfaceRenderPropertiesOperations object.

Signature:

get_render_properties_operations() -> SurfaceRenderPropertiesOperations

Returns: SurfaceRenderPropertiesOperations — A SurfaceRenderPropertiesOperations object.


get_basic_surface_mesh_info

Retrieves basic mesh information for a specified surface.

Signature:

get_basic_surface_mesh_info(surfaceName: str) -> BasicSurfaceMeshInfo

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface to retrieve information for.

Returns: BasicSurfaceMeshInfo — A BasicSurfaceMeshInfo object containing the surface mesh information.


point_matching_registration

Performs point-based registration (ICP) to align source surfaces to a target.

Signature:

point_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, registrationMode: RegistrationMode = api.RegistrationMode.RigidBody, startByMatchingCentroids: bool = True, maximumLandmarks: int = 1000) -> list

Parameters:

ParameterTypeDescription
movableSurfaceNamesanyList of source/movable surface names to register.
fixedObjectNameanyName of the fixed target surface or mask.
targetObjectTypeanyType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
registrationModeanyRegistration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine.
startByMatchingCentroidsanyIf true, starts by aligning centroids before registration.
maximumLandmarksanyMaximum number of landmarks to use for registration.

Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Example usage: RegistrationResultRows = SurfaceOperations.point_matching_registration(['movable'], 'fixed', api.RegistrationMode.RigidBody) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)


feature_matching_registration

Performs feature-based registration using curvature matching to align surfaces.

Signature:

feature_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, globalIterations: int = 3, overlapRadius: float = 10.0, curvatureThreshold: float = 0.001) -> list

Parameters:

ParameterTypeDescription
movableSurfaceNamesanyList of source/movable surface names to register.
fixedObjectNameanyName of the fixed target surface or mask.
targetObjectTypeanyType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
globalIterationsanyNumber of global registration iterations.
overlapRadiusanyRadius around a point for optimization (must exceed minimum patch distance).
curvatureThresholdanyCurvature threshold value (lower = higher accuracy).

Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Example usage: RegistrationResultRows = SurfaceOperations.feature_matching_registration(['movable'], 'fixed', api.RegistrationMode.RigidBody) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)


point_plus_feature_matching_registration

Performs combined point and feature-based registration for improved alignment.

Signature:

point_plus_feature_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, registrationMode: RegistrationMode = api.RegistrationMode.RigidBody, startByMatchingCentroids: bool = True, maximumLandmarks: int = 1000, globalIterations: int = 3, overlapRadius: float = 10.0, curvatureThreshold: float = 0.001) -> list

Parameters:

ParameterTypeDescription
movableSurfaceNamesanyList of source/movable surface names to register.
fixedObjectNameanyName of the fixed target surface or mask.
targetObjectTypeanyType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
registrationModeanyRegistration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine.
startByMatchingCentroidsanyIf true, starts by aligning centroids before registration.
maximumLandmarksanyMaximum number of landmarks to use for point matching.
globalIterationsanyNumber of global feature matching iterations.
overlapRadiusanyRadius around a point for feature optimization.
curvatureThresholdanyCurvature threshold for feature matching.

Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Usage example: RegistrationResultRows = SurfaceOperations.point_plus_feature_matching_registration(['movable'], 'fixed', api.RegistrationTargetObject.Surface) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)


set_volume_mesh_parameters

Sets volume meshing parameters for a surface. Configures meshing quality and algorithm-specific options that will be used when converting the surface to a volume mesh. These parameters are stored in the surface object and persist until changed.

Signature:

set_volume_mesh_parameters(surfaceName: str, params: VolumeMeshParams) -> None

Parameters:

ParameterTypeDescription
surfaceNameanyName of the surface to configure.
paramsanyVolume meshing parameters including method, resolution, and algorithm-specific settings. Create using params = api.VolumeMeshParams().

get_volume_mesh_parameters

Gets volume meshing parameters from a surface. Retrieves the currently configured meshing parameters stored in the surface object.

Signature:

get_volume_mesh_parameters(surfaceName: str) -> VolumeMeshParams

Parameters:

ParameterTypeDescription
surfaceNameanyName of the surface to query.

Returns: VolumeMeshParams — Volume meshing parameters currently stored in the surface object.


File System

import_surfaces_from_disk

Imports surface files from disk.

Signature:

import_surfaces_from_disk(fileNames: list) -> list

Parameters:

ParameterTypeDescription
fileNamesanyA list containing the full paths of the surface files to import. Supported file extensions are: stl, ply, obj, wrl, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is imported; as a result, some file formats are only partially supported.

Returns: list — A list of strings containing the names of the imported surface objects. An empty list is returned if no files were imported successfully.


import_surface_from_disk

Imports a surface file from disk.

Signature:

import_surface_from_disk(fileName: str) -> str

Parameters:

ParameterTypeDescription
fileNameanyThe full path of the surface file to import. Supported file extensions are: stl, ply, obj, wrl, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is imported; as a result, some file formats are only partially supported.

Returns: str — Returns the name of the imported surface object if successful; otherwise, returns an empty string.


export_surfaces_to_disk

Exports surfaces specified by their names to disk files in a given directory with a specified file extension.

Signature:

export_surfaces_to_disk(surfaceNames: list, directoryPath: str, fileExtension: str, isASCII: bool = False) -> bool

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to export.
directoryPathanyThe path to the directory where the surface files will be saved.
fileExtensionanyThe file extension to use for the exported surface files. Supported file extensions are: stl, ply, obj, wrl, u3d, 3mf, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is exported; therefore, some file formats are only partially supported.
isASCIIanyIf true, exports the files in ASCII format; otherwise, exports in binary format. Defaults to false. isASCII is only applicable for stl and ply file formats.

Returns: bool — Returns true if all surfaces were successfully exported; otherwise, returns false.


export_surface_to_disk

Exports a surface to a file on disk.

Signature:

export_surface_to_disk(surfaceName: str, fileName: str, isASCII: bool = False) -> bool

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface to export.
fileNameanyThe path and name of the file to write the surface data to. Supported file extensions are: stl, ply, obj, wrl, u3d, 3mf, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is exported; therefore, some file formats are only partially supported. File name should include the file extension, e.g., 'C:/temp/surface.stl'.
isASCIIanyIf true, exports the surface in ASCII format; otherwise, exports in binary format. Defaults to false. isASCII is only applicable for stl and ply file formats.

Returns: bool — True if the export was successful; false otherwise.


Creation

create_box

Creates a box primitive surface.

Signature:

create_box(name: str, width: float, height: float, depth: float, center: list = [0, 0, 0], resolution: int = 10) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
widthanyThe width of the box.
heightanyThe height of the box.
depthanyThe depth of the box.
centeranyThe center position of the box [x, y, z].
resolutionanyThe resolution for subdivisions (default: 10).

Returns: str — The name of the created surface.


create_cube

Creates a cube primitive surface.

Signature:

create_cube(name: str, edgeLength: float, center: list = [0, 0, 0], resolution: int = 10) -> str

Parameters:

ParameterTypeDescription
nameanyThe name of the cube.
edgeLengthanyThe length of each edge of the cube.
centeranyThe center position of the cube [x, y, z].
resolutionanyThe resolution for subdivisions (default: 10).

Returns: str — A string representing the created cube, such as its identifier or a description.


create_sphere

Creates a sphere primitive surface.

Signature:

create_sphere(name: str, radius: float, center: list = [0, 0, 0], rings: int = 36, sectors: int = 36) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusanyThe radius of the sphere.
centeranyThe center position of the sphere [x, y, z].
ringsanyNumber of rings (latitude resolution, default: 36).
sectorsanyNumber of sectors (longitude resolution, default: 36).

Returns: str — The name of the created surface.


create_capped_sphere

Creates a capped sphere primitive surface.

Signature:

create_capped_sphere(name: str, radius: float, cutAngleDeg: float, center: list = [0, 0, 0], rings: int = 36, sectors: int = 36) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusanyThe radius of the sphere.
cutAngleDeganyThe cut angle in degrees (0-180) to define the cap.
centeranyThe center position of the sphere [x, y, z].
ringsanyNumber of rings (latitude resolution, default: 36).
sectorsanyNumber of sectors (longitude resolution, default: 36).

Returns: str — The name of the created surface.


create_ellipsoid

Creates an ellipsoid primitive surface.

Signature:

create_ellipsoid(name: str, radiusX: float, radiusY: float, radiusZ: float, center: list = [0, 0, 0], rings: int = 36, sectors: int = 36) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusXanyRadius along X-axis.
radiusYanyRadius along Y-axis.
radiusZanyRadius along Z-axis.
centeranyThe center position of the ellipsoid [x, y, z].
ringsanyNumber of rings (default: 36).
sectorsanyNumber of sectors (default: 36).

Returns: str — The name of the created surface.


create_cylinder

Creates a cylinder primitive surface.

Signature:

create_cylinder(name: str, radius: float, height: float, center: list = [0, 0, 0], resolution: int = 36, capping: bool = True, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusanyThe radius of the cylinder.
heightanyThe height of the cylinder.
centeranyThe center position of the cylinder [x, y, z].
resolutionanyThe circumferential resolution (default: 36).
cappinganyWhether to cap the cylinder ends (default: true).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_capsule

Creates a capsule primitive surface.

Signature:

create_capsule(name: str, radius: float, height: float, center: list = [0, 0, 0], resolution: int = 36, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusanyThe radius of the capsule.
heightanyThe height of the cylindrical part.
centeranyThe center position of the capsule [x, y, z].
resolutionanyThe circumferential resolution (default: 36).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_tube

Creates a tube primitive surface.

Signature:

create_tube(name: str, outerRadius: float, thickness: float, height: float, center: list = [0, 0, 0], resolution: int = 36, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
outerRadiusanyOuter radius of the tube.
thicknessanyWall thickness of the tube.
heightanyThe height of the tube.
centeranyThe center position of the tube [x, y, z].
resolutionanyThe circumferential resolution (default: 36).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_cone

Creates a cone primitive surface.

Signature:

create_cone(name: str, radius: float, height: float, center: list = [0, 0, 0], resolution: int = 36, capping: bool = True, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
radiusanyBase radius of the cone.
heightanyThe height of the cone.
centeranyThe center position of the cone [x, y, z].
resolutionanyThe circumferential resolution (default: 36).
cappinganyWhether to cap the cone base (default: true).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_arrow

Creates an arrow primitive surface.

Signature:

create_arrow(name: str, totalLength: float, shaftRadius: float, tipLength: float, tipRadius: float, center: list = [0, 0, 0], resolution: int = 32, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
totalLengthanyTotal length of the arrow.
shaftRadiusanyRadius of the arrow shaft.
tipLengthanyLength of the arrow tip.
tipRadiusanyRadius of the arrow tip.
centeranyThe center position of the arrow [x, y, z].
resolutionanyThe circumferential resolution (default: 32).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_torus

Creates a torus primitive surface.

Signature:

create_torus(name: str, innerRadius: float, outerRadius: float, center: list = [0, 0, 0], resolution: int = 36, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
innerRadiusanyInner radius (ring radius).
outerRadiusanyOuter radius (total radius).
centeranyThe center position of the torus [x, y, z].
resolutionanyThe resolution for both U and V directions (default: 36).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_platonic_solid

Creates a platonic solid primitive surface.

Signature:

create_platonic_solid(name: str, solidType: PlatonicSolidType, radius: float, center: list = [0, 0, 0]) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
solidTypeanyType of platonic solid. Use api.PlatonicSolidType.Tetrahedron, api.PlatonicSolidType.Cube, api.PlatonicSolidType.Octahedron, api.PlatonicSolidType.Icosahedron, or api.PlatonicSolidType.Dodecahedron.
radiusanyThe radius of the solid.
centeranyThe center position of the solid [x, y, z].

Returns: str — The name of the created surface.


create_disk

Creates a disk primitive surface.

Signature:

create_disk(name: str, innerRadius: float, outerRadius: float, center: list = [0, 0, 0], radialResolution: int = 18, circumferentialResolution: int = 36, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
innerRadiusanyInner radius of the disk.
outerRadiusanyOuter radius of the disk.
centeranyThe center position of the disk [x, y, z].
radialResolutionanyThe radial resolution (default: 18).
circumferentialResolutionanyThe circumferential resolution (default: 36).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_plane

Creates a plane primitive surface.

Signature:

create_plane(name: str, width: float, height: float, center: list = [0, 0, 0], resolution: int = 1, direction: int = 2) -> str

Parameters:

ParameterTypeDescription
nameanyThe name for the created surface (if empty, auto-generated).
widthanyThe width of the plane.
heightanyThe height of the plane.
centeranyThe center position of the plane [x, y, z].
resolutionanyThe resolution for subdivisions (default: 1).
directionanyThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


Modification

rotate

Rotates surfaces around a specified axis and center point.

Signature:

rotate(surfaceNames: list, angleDegrees: float, axis: list, center: list = [0.0, 0.0, 0.0], aroundObjectCentroid: bool = True) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to rotate.
angleDegreesanyRotation angle in degrees.
axisanyRotation axis [x, y, z].
centeranyRotation center point [x, y, z] (ignored if aroundObjectCentroid=True).
aroundObjectCentroidanyIf true, rotates around object's bounding box centroid.

translate

Translates surfaces by a specified vector.

Signature:

translate(surfaceNames: list, translation: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to translate.
translationanyTranslation vector [x, y, z] in model units.

scale

Scales surfaces by specified factors along each axis.

Signature:

scale(surfaceNames: list, scaleFactors: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to scale.
scaleFactorsanyScale factors [x, y, z].

transform

Applies a transformation matrix to the specified surfaces.

Signature:

transform(surfaceNames: list, matrix: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to transform.
matrixanyTransformation matrix [16 elements].

hollow

Creates a hollow version of surfaces with specified wall thickness.

Signature:

hollow(surfaceNames: list, method: SurfaceHollowMethod, direction: SurfaceHollowDirection, thickness: float, resolution: SurfaceHollowResolution = api.SurfaceHollowResolution.Medium, createNewSurface: bool = False) -> list

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to hollow.
methodanyHollowing method. Use api.SurfaceHollowMethod.Fast (normal-based extrusion) or api.SurfaceHollowMethod.Robust (voxel-based).
directionanyHollow direction. Use api.SurfaceHollowDirection.Inward or api.SurfaceHollowDirection.Outward.
thicknessanyWall thickness for the hollowed surfaces.
resolutionanyResolution preset for Robust method. Use api.SurfaceHollowResolution.Low, api.SurfaceHollowResolution.Medium, or api.SurfaceHollowResolution.High.
createNewSurfaceanyCreate new surfaces instead of modifying inputs.

Returns: list — A list of names for the hollowed surfaces in case of createNewSurface=True; otherwise, returns an empty list.


smooth_laplacian

Applies Laplacian smoothing to the specified surfaces. This method iteratively moves each vertex toward the average position of its neighbors, resulting in a more uniform and flatter mesh. The process may cause the mesh to shrink slightly. You can control the number of iterations, smoothing strength, and whether to preserve sharp features.

Signature:

smooth_laplacian(surfaceNames: list, iterations: int = 3, smoothFactor: float = 0.6, featureEdges: bool = True, featureAngle: float = 85) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to smooth.
iterationsanyNumber of times the smoothing algorithm should run (minimum: 2; default: 3). Higher values increase smoothing.
smoothFactoranySmoothing strength (relaxation factor). Higher values produce more smoothing (range: 0.001–1.0; default: 0.6).
featureEdgesanyIf true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed.
featureAngleanyAngle threshold (in degrees, range: 0–180; default: 85) for identifying sharp edges to preserve. Smaller values preserve more features; higher values result in more smoothing.

smooth_smart

Applies Smart smoothing to the specified surfaces. This method reduces noise and smooths the mesh while better preserving the overall shape, with less shrinkage or distortion compared to basic smoothing. You can control the number of iterations, smoothing strength, and whether to preserve sharp features.

Signature:

smooth_smart(surfaceNames: list, iterations: int = 20, smoothFactor: float = 0.01, featureEdges: bool = True, featureAngle: float = 85) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to smooth.
iterationsanyNumber of times the smoothing algorithm should run (minimum: 2; default: 20). Higher values increase smoothing.
smoothFactoranySmoothing strength (pass band value). Lower values produce more smoothing (range: 0.0001–1.0; default: 0.01).
featureEdgesanyIf true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed.
featureAngleanyAngle threshold (in degrees, range: 0–180; default: 85) for identifying sharp edges to preserve. Smaller values preserve more features; higher values result in more smoothing.

subdivide

Subdivides surfaces to increase triangle count.

Signature:

subdivide(surfaceNames: list, method: SurfaceSubdivisionMethod, subdivisions: int = 1, maxEdgeLength: float = 1.0) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to subdivide.
methodanySubdivision method. Use api.SurfaceSubdivisionMethod.Linear, api.SurfaceSubdivisionMethod.Loop, api.SurfaceSubdivisionMethod.Butterfly, or api.SurfaceSubdivisionMethod.Adaptive.
subdivisionsanyNumber of subdivision iterations (ignored for Adaptive method).
maxEdgeLengthanyMaximum edge length for Adaptive subdivision (ignored for other methods).

General

mirror

Mirrors surfaces across specified axes.

Signature:

mirror(surfaceNames: list, mirrorX: bool = False, mirrorY: bool = False, mirrorZ: bool = False) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to mirror.
mirrorXanyMirror across X axis.
mirrorYanyMirror across Y axis.
mirrorZanyMirror across Z axis.

move_to_active_volume_center

Moves surfaces to the center of the active volume image.

Signature:

move_to_active_volume_center(surfaceNames: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to move.

diagnose_surface

Performs diagnostic checks on a surface and returns the results.

Signature:

diagnose_surface(surfaceName: str, checks: SurfaceDiagnosticsChecks) -> SurfaceDiagnosticsResult

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface to diagnose.
checksanyThe set of diagnostic checks to perform on the surface. Create using checks = api.SurfaceDiagnosticsChecks().

Returns: SurfaceDiagnosticsResult — A SurfaceDiagnosticsResult object containing the results of the diagnostic checks.


fix_surface

Applies specified fix operations to a surface identified by name.

Signature:

fix_surface(surfaceName: str, checks: SurfaceDiagnosticsChecks) -> None

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface to be fixed.
checksanyThe checks indicating which fixes to apply. Create using checks = api.SurfaceDiagnosticsChecks().

merge

Merges multiple surfaces into a single surface.

Signature:

merge(surfaceNames: list, targetSurfaceName: str, mergePoints: bool = True, removeInputSurfaces: bool = False, createNewSurface: bool = True) -> str

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to merge (must have at least 2 surfaces).
targetSurfaceNameanyName for the resulting merged surface.
mergePointsanyMerge duplicate points after combining surfaces.
removeInputSurfacesanyRemove input surfaces after merging.
createNewSurfaceanyCreate a new surface instead of modifying the first input.

Returns: str — The name of the merged surface in case of createNewSurface=True; otherwise, returns an empty string.


split

Separates a surface into multiple surfaces based on disconnected regions.

Signature:

split(surfaceName: str, numLargestShells: int = 0, removeInputSurface: bool = False) -> list

Parameters:

ParameterTypeDescription
surfaceNameanyName of the surface to separate.
numLargestShellsanyNumber of largest shells to extract (0 = all shells).
removeInputSurfaceanyRemove the input surface after separation.

Returns: list — A list of names for the newly created surfaces.


filter_shells

Filters shells from a surface based on specified criteria.

Signature:

filter_shells(surfaceName: str, method: SurfaceFilterShellsMethod, params: SurfaceFilterShellsParams) -> None

Parameters:

ParameterTypeDescription
surfaceNameanyName of the surface to filter.
methodanyFilter method. Use api.SurfaceFilterShellsMethod.LargestShells, etc.
paramsanyFilter parameters including thresholds and retention settings. Create using params = api.SurfaceFilterShellsParams().

boolean_operation

Performs boolean operations between surfaces.

Signature:

boolean_operation(surfaceNameInputA: str, surfaceNamesInputB: list, surfaceNameResult: str, operation: SurfaceBooleanOperation, createNewSurface: bool = True) -> str

Parameters:

ParameterTypeDescription
surfaceNameInputAanyName of the first input surface.
surfaceNamesInputBanyList of names for the second input surfaces.
surfaceNameResultanyName for the resulting surface (only used if createNewSurface=False).
operationanyBoolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference.
createNewSurfaceanyCreate a new surface instead of modifying input1.

Returns: str — The name of the resulting surface in case of createNewSurface=True; otherwise, returns an empty string.


voxel_boolean_operation

Performs voxel-based boolean operations between surfaces.

Signature:

voxel_boolean_operation(surfaceNameInputA: str, surfaceNamesInputB: list, surfaceNameResult: str, operation: SurfaceBooleanOperation, voxelizationMethod: SurfaceVoxelizeMethod = api.SurfaceVoxelizeMethod.Fast, voxelSpacing: list = [1, 1, 1], smoothArtifacts: bool = True, createNewSurface: bool = True) -> str

Parameters:

ParameterTypeDescription
surfaceNameInputAanyName of the first input surface.
surfaceNamesInputBanyList of names for the second input surfaces.
surfaceNameResultanyName for the resulting surface (only used if createNewSurface=False).
operationanyBoolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference.
voxelizationMethodanyVoxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast.
voxelSpacinganyVoxel spacing [x, y, z] for the operation (smaller values = higher quality).
smoothArtifactsanySmooth artifacts in the resulting mesh (only applies to Voxelize method).
createNewSurfaceanyCreate a new surface instead of modifying input1.

Returns: str — The name of the resulting surface in case of createNewSurface=True; otherwise, returns an empty string.


fill_holes

Fills holes in the specified surface using the given method and maximum hole size.

Signature:

fill_holes(surfaceName: str, maxHoleSize: int, method: SurfaceHoleFillingMethod = api.SurfaceHoleFillingMethod.Angle) -> None

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface on which to perform hole filling.
maxHoleSizeanyThe maximum size of holes (in surface units) that will be filled.
methodanyThe method used for hole filling. Use api.SurfaceHoleFillingMethod.Angle or api.SurfaceHoleFillingMethod.Area.

remesh

Remeshes surfaces to improve triangle quality and distribution.

Signature:

remesh(surfaceNames: list, method: SurfaceRemeshMethod = api.SurfaceRemeshMethod.Adaptive, quality: SurfaceRemeshQuality = api.SurfaceRemeshQuality.Medium, density: int = 100, preserveEdges: bool = False) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to remesh.
methodanyRemesh method. Use api.SurfaceRemeshMethod.Adaptive or api.SurfaceRemeshMethod.Regular.
qualityanyQuality preset. Use api.SurfaceRemeshQuality.Medium, api.SurfaceRemeshQuality.High, or api.SurfaceRemeshQuality.Maximum.
densityanyTarget density as percentage of original vertex count (11 - 100).
preserveEdgesanyIf true, this option will retain any holes or edges found in the original mesh.

voxel_remesh

Remeshes surfaces using voxel-based method.

Signature:

voxel_remesh(surfaceNames: list, voxelizationMethod: SurfaceVoxelizeMethod = api.SurfaceVoxelizeMethod.Fast, voxelSpacing: list = [1, 1, 1], smoothArtifacts: bool = True) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to remesh.
voxelizationMethodanyVoxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast.
voxelSpacinganyVoxel spacing [x, y, z] for the operation (smaller values = higher quality).
smoothArtifactsanySmooth artifacts in the resulting mesh (only applies to Voxelize method).
createNewSurfaceanyCreate new surfaces instead of modifying inputs.

reduce_smart

Reduces the number of triangles in the specified surfaces using a smart reduction algorithm.

Signature:

reduce_smart(surfaceNames: list, desiredPercentage: float, useDesiredPercentage: bool = True, desiredTriangles: int = 3000) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to reduce.
desiredPercentageanyThe desired reduction percentage (0.0 - 100.0).
useDesiredPercentageanyIf true, uses the desired percentage; otherwise, uses the desired triangle count.
desiredTrianglesanyThe desired number of triangles after reduction.

reduce_feature_based

Reduces the number of triangles in the specified surfaces based on a feature angle.

Signature:

reduce_feature_based(surfaceNames: list, featureAngle: float, desiredPercentage: float, useDesiredPercentage: bool = True, desiredTriangles: int = 3000) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to reduce.
featureAngleanyThe feature angle to use for reduction (in degrees).
desiredPercentageanyThe desired reduction percentage (0.0 - 100.0).
useDesiredPercentageanyIf true, uses the desired percentage; otherwise, uses the desired triangle count.
desiredTrianglesanyThe desired number of triangles after reduction.

reduce_join_near_by_points

Reduces the number of triangles in the specified surfaces by merging nearby points.

Signature:

reduce_join_near_by_points(surfaceNames: list, nearByPointDistance: float) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to reduce.
nearByPointDistanceanyThe distance threshold for merging nearby points.

project_to_plane

Projects surfaces onto a specified plane.

Signature:

project_to_plane(surfaceNames: list, planeOrigin: list, planeNormal: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to project.
planeOriginanyPlane origin point [x, y, z].
planeNormalanyPlane normal vector [x, y, z].

mirror_to_plane

Mirrors (reflects) surfaces across a specified plane. Each surface point P is reflected as P' = P - 2 * dot(P - O, N) * N, where O is the plane origin and N is the unit normal vector. After reflection, cell winding is reversed and normals are recomputed.

Signature:

mirror_to_plane(surfaceNames: list, planeOrigin: list, planeNormal: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamesanyList of surface names to mirror.
planeOriginanyPlane origin point [x, y, z].
planeNormalanyPlane normal vector [x, y, z].

convert_to_mask

Converts surfaces to mask objects using voxelization. Voxelizes the selected surfaces and creates new mask objects. The active volume must be present before calling this function.

Signature:

convert_to_mask(surfaceNames: list, voxelizationMethod: SurfaceVoxelConversionMethod = api.SurfaceVoxelConversionMethod.Filled, smoothArtifacts: bool = True) -> list

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to convert.
voxelizationMethodanyVoxelization method. Use api.SurfaceVoxelConversionMethod.Filled, api.SurfaceVoxelConversionMethod.ThickContour, api.SurfaceVoxelConversionMethod.ThinContour, or api.SurfaceVoxelConversionMethod.LineContour.
smoothArtifactsanyApply smoothing to reduce voxelization artifacts.

Returns: list — A list of names for the created mask objects.


convert_to_volume_mesh

Converts surfaces to tetrahedral volume meshes. Generates tetrahedral volume meshes from closed manifold surfaces using either Auto3D or Grid3D algorithms. Parameters must be set first using set_volume_mesh_parameters() to configure meshing quality and method-specific options.

Signature:

convert_to_volume_mesh(surfaceNames: list, method: VolumeMeshMethod = api.VolumeMeshMethod.Auto3D) -> list

Parameters:

ParameterTypeDescription
surfaceNamesanyA list containing the names of the surfaces to convert.
methodanyVolume mesh generation method. Use api.VolumeMeshMethod.Auto3D or api.VolumeMeshMethod.Grid3D.

Returns: list — A list of names for the created volume mesh objects.


See Also