Skip to main content

SurfaceOperations

Operations

Provides tools for creating, editing, and analyzing 3D surface objects. Supports import/export, primitive and projected-text 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 an api.SurfaceRenderPropertiesOperations object.

Signature:

get_render_properties_operations() -> SurfaceRenderPropertiesOperations

Returns: SurfaceRenderPropertiesOperations — The api.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
surfaceNamestrThe name of the surface to retrieve information for.

Returns: BasicSurfaceMeshInfo — The api.BasicSurfaceMeshInfo object containing the surface mesh information.


get_geometry_data​

Returns the surface geometry as vertices, triangle cells, and optional RGB color arrays. Triangle cells are returned as vertex index triplets. If the surface contains non-triangle faces, they are converted to triangles before the data is returned.

Signature:

get_geometry_data(surfaceName: str) -> SurfaceGeometryData

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to read.

Returns: SurfaceGeometryData — The api.SurfaceGeometryData object containing the mesh geometry and any available vertex or cell colors.


set_geometry_data​

Replaces the surface geometry using vertices, triangle cells, and optional RGB color arrays. The input must contain at least one triangle cell. Triangle indices are validated before any change is applied. Color arrays are optional. When provided, vertex colors must match the vertex count and cell colors must match the triangle count.

Signature:

set_geometry_data(surfaceName: str, geometryData: SurfaceGeometryData) -> None

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to update.
geometryDataSurfaceGeometryDataSurface geometry to apply. Create using api.SurfaceGeometryData().

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
movableSurfaceNameslistList of source/movable surface names to register.
fixedObjectNamestrName of the fixed target surface or mask.
targetObjectTypeRegistrationTargetObjectType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
registrationModeRegistrationModeRegistration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine.
startByMatchingCentroidsboolIf true, starts by aligning centroids before registration.
maximumLandmarksintMaximum number of landmarks to use for registration.

Returns: list — A list of api.GlobalRegistrationResultRow() with RMSE values for each surface pair. Example usage: surface_operations = app.get_surface_operations() registration_result_rows = surface_operations.point_matching_registration(['movable'], 'fixed', api.RegistrationTargetObject.Surface, api.RegistrationMode.RigidBody) for row in registration_result_rows: registration_result_row : api.GlobalRegistrationResultRow = row print(registration_result_row.movable_surface) print(registration_result_row.fixed_target) print(registration_result_row.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
movableSurfaceNameslistList of source/movable surface names to register.
fixedObjectNamestrName of the fixed target surface or mask.
targetObjectTypeRegistrationTargetObjectType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
globalIterationsintNumber of global registration iterations.
overlapRadiusfloatRadius around a point for optimization (must exceed minimum patch distance).
curvatureThresholdfloatCurvature threshold value (lower = higher accuracy).

Returns: list — A list of api.GlobalRegistrationResultRow() with RMSE values for each surface pair. Example usage: surface_operations = app.get_surface_operations() registration_result_rows = surface_operations.feature_matching_registration(['movable'], 'fixed', api.RegistrationTargetObject.Surface) for row in registration_result_rows: registration_result_row : api.GlobalRegistrationResultRow = row print(registration_result_row.movable_surface) print(registration_result_row.fixed_target) print(registration_result_row.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
movableSurfaceNameslistList of source/movable surface names to register.
fixedObjectNamestrName of the fixed target surface or mask.
targetObjectTypeRegistrationTargetObjectType of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask.
registrationModeRegistrationModeRegistration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine.
startByMatchingCentroidsboolIf true, starts by aligning centroids before registration.
maximumLandmarksintMaximum number of landmarks to use for point matching.
globalIterationsintNumber of global feature matching iterations.
overlapRadiusfloatRadius around a point for feature optimization.
curvatureThresholdfloatCurvature threshold for feature matching.

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


poisson_remesh_screened​

Remeshes surfaces or point clouds by reconstructing a new watertight triangle mesh using screened Poisson surface reconstruction. The screened method incorporates the input points as soft positional constraints, which fits the reconstructed surface faithfully to the input data and preserves details and the overall shape while keeping the surface smooth. Recommended for most applications.

Signature:

poisson_remesh_screened(surfaceNames: list, params: SurfaceScreenedPoissonRemeshParams = SurfaceScreenedPoissonRemeshParams()) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to remesh.
paramsSurfaceScreenedPoissonRemeshParamsScreened Poisson reconstruction parameters. Create using params = api.SurfaceScreenedPoissonRemeshParams().

poisson_remesh_unscreened​

Remeshes surfaces or point clouds by reconstructing a new watertight triangle mesh using unscreened Poisson surface reconstruction. The unscreened method produces very smooth surfaces that robustly approximate noisy data, but it may over-smooth and shrink detailed regions compared to the screened method.

Signature:

poisson_remesh_unscreened(surfaceNames: list, params: SurfaceUnscreenedPoissonRemeshParams = SurfaceUnscreenedPoissonRemeshParams()) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to remesh.
paramsSurfaceUnscreenedPoissonRemeshParamsUnscreened Poisson reconstruction parameters. Create using params = api.SurfaceUnscreenedPoissonRemeshParams().

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
surfaceNamestrName of the surface to configure.
paramsVolumeMeshParamsVolume 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
surfaceNamestrName 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
fileNameslistA list containing the full paths of the surface files to import. Supported file extensions are: stl, ply, obj, wrl, vrml, gltf, glb, amf, step, stp, iges, igs, vtp, 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
fileNamestrThe full path of the surface file to import. Supported file extensions are: stl, ply, obj, wrl, vrml, gltf, glb, amf, step, stp, iges, igs, vtp, 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 = "stl", isASCII: bool = False) -> bool

Parameters:

ParameterTypeDescription
surfaceNameslistA list containing the names of the surfaces to export.
directoryPathstrThe path to the directory where the surface files will be saved.
fileExtensionstrThe file extension to use for the exported surface files. Supported file extensions are: stl, ply, obj, wrl, vrml, u3d, 3mf, amf, gltf, step, stp, iges, igs, vtp, vtk, byu, x3d, iv, and xyz. Only mesh data is exported; therefore, some file formats are only partially supported.
isASCIIboolIf 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
surfaceNamestrThe name of the surface to export.
fileNamestrThe path and name of the file to write the surface data to. Supported file extensions are: stl, ply, obj, wrl, vrml, u3d, 3mf, amf, gltf, step, stp, iges, igs, vtp, vtk, byu, x3d, iv, 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'.
isASCIIboolIf 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
namestrThe name for the created surface (if empty, auto-generated).
widthfloatThe width of the box.
heightfloatThe height of the box.
depthfloatThe depth of the box.
centerlistThe center position of the box [x, y, z].
resolutionintThe 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
namestrThe name of the cube.
edgeLengthfloatThe length of each edge of the cube.
centerlistThe center position of the cube [x, y, z].
resolutionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
radiusfloatThe radius of the sphere.
centerlistThe center position of the sphere [x, y, z].
ringsintNumber of rings (latitude resolution, default: 36).
sectorsintNumber 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
namestrThe name for the created surface (if empty, auto-generated).
radiusfloatThe radius of the sphere.
cutAngleDegfloatThe cut angle in degrees (0-180) to define the cap.
centerlistThe center position of the sphere [x, y, z].
ringsintNumber of rings (latitude resolution, default: 36).
sectorsintNumber 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
namestrThe name for the created surface (if empty, auto-generated).
radiusXfloatRadius along X-axis.
radiusYfloatRadius along Y-axis.
radiusZfloatRadius along Z-axis.
centerlistThe center position of the ellipsoid [x, y, z].
ringsintNumber of rings (default: 36).
sectorsintNumber 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
namestrThe name for the created surface (if empty, auto-generated).
radiusfloatThe radius of the cylinder.
heightfloatThe height of the cylinder.
centerlistThe center position of the cylinder [x, y, z].
resolutionintThe circumferential resolution (default: 36).
cappingboolWhether to cap the cylinder ends (default: true).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
radiusfloatThe radius of the capsule.
heightfloatThe height of the cylindrical part.
centerlistThe center position of the capsule [x, y, z].
resolutionintThe circumferential resolution (default: 36).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
outerRadiusfloatOuter radius of the tube.
thicknessfloatWall thickness of the tube.
heightfloatThe height of the tube.
centerlistThe center position of the tube [x, y, z].
resolutionintThe circumferential resolution (default: 36).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
radiusfloatBase radius of the cone.
heightfloatThe height of the cone.
centerlistThe center position of the cone [x, y, z].
resolutionintThe circumferential resolution (default: 36).
cappingboolWhether to cap the cone base (default: true).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
totalLengthfloatTotal length of the arrow.
shaftRadiusfloatRadius of the arrow shaft.
tipLengthfloatLength of the arrow tip.
tipRadiusfloatRadius of the arrow tip.
centerlistThe center position of the arrow [x, y, z].
resolutionintThe circumferential resolution (default: 32).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
innerRadiusfloatInner radius (ring radius).
outerRadiusfloatOuter radius (total radius).
centerlistThe center position of the torus [x, y, z].
resolutionintThe resolution for both U and V directions (default: 36).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
solidTypePlatonicSolidTypeType of platonic solid. Use api.PlatonicSolidType.Tetrahedron, api.PlatonicSolidType.Octahedron, api.PlatonicSolidType.Icosahedron, or api.PlatonicSolidType.Dodecahedron.
radiusfloatThe radius of the solid.
centerlistThe 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
namestrThe name for the created surface (if empty, auto-generated).
innerRadiusfloatInner radius of the disk.
outerRadiusfloatOuter radius of the disk.
centerlistThe center position of the disk [x, y, z].
radialResolutionintThe radial resolution (default: 18).
circumferentialResolutionintThe circumferential resolution (default: 36).
directionintThe 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
namestrThe name for the created surface (if empty, auto-generated).
widthfloatThe width of the plane.
heightfloatThe height of the plane.
centerlistThe center position of the plane [x, y, z].
resolutionintThe resolution for subdivisions (default: 1).
directionintThe direction axis (0=X, 1=Y, 2=Z, default: 2).

Returns: str — The name of the created surface.


create_projected_text​

Creates text projected onto a target surface as a separate surface object. The target surface is not modified and no Boolean operation is performed. The text is centered at the requested world-space position before projection rays are cast parallel to params.surfaceNormal. The returned surface includes the requested overlap so it can be used independently or combined later by the caller.

Signature:

create_projected_text(targetSurfaceName: str, text: str, params: ProjectedTextParams = ProjectedTextParams(), resultSurfaceName: str = "") -> str

Parameters:

ParameterTypeDescription
targetSurfaceNamestrName of the surface onto which the text is projected.
textstrUTF-8 text to convert into surface geometry.
paramsProjectedTextParamsFont, placement, scale, projection, and extrusion settings. Create using params = api.ProjectedTextParams().
resultSurfaceNamestrName for the created surface. An empty name selects a descriptive default.

Returns: str — The actual 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
surfaceNameslistList of surface names to rotate.
angleDegreesfloatRotation angle in degrees.
axislistRotation axis [x, y, z].
centerlistRotation center point [x, y, z] (ignored if aroundObjectCentroid=True).
aroundObjectCentroidboolIf true, rotates around object's bounding box centroid.

translate​

Translates surfaces by a specified vector.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to translate.
translationlistTranslation 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
surfaceNameslistList of surface names to scale.
scaleFactorslistScale factors [x, y, z].

transform​

Applies a transformation matrix to the specified surfaces.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to transform.
matrixlistTransformation matrix [16 elements].

clip_with_primitive​

Clips surfaces with a primitive object used as the region of interest. The primitive defines an analytic region, which is the same region the Clip tool uses: a plane primitive clips with its plane, a sphere primitive with its sphere, a cylinder primitive with an infinite cylinder along its axis (the cylinder caps are ignored), and a cube or cuboid primitive with its six faces. Point, line, circle, ellipsoid, capsule, tube, cone, arrow and spline primitives have no analytic region; use cutWithPrimitives() for those. Surfaces that the region leaves without any geometry are reported and left unchanged. The options supported by each region are the same as those offered by the Clip tool. Plane primitives support closed and invert. They also support retainClippedRegion when closed is false. Cube and cuboid primitives support closed. They support invert and retainClippedRegion only when closed is false. Sphere and cylinder primitives support invert, but do not support closed or retainClippedRegion. Passing an option that a primitive does not support raises an exception rather than being ignored silently.

Signature:

clip_with_primitive(surfaceNames: list, primitiveName: str, closed: bool = False, invert: bool = False, retainClippedRegion: bool = False) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistA list containing the names of the surfaces to clip.
primitiveNamestrThe name of the primitive object that defines the region of interest.
closedboolIf true, caps the clipped mesh so that the result stays a closed surface. Requires surfaces that are already closed and manifold. Surfaces that are not closed and manifold are reported and left unchanged.
invertboolIf true, keeps the region on the other side of the primitive. Closed cube and cuboid clipping always keeps what is inside the box, so it has no side left to invert.
retainClippedRegionboolIf true, the removed region is added to the scene as a new surface object.

cut_with_primitives​

Cuts surfaces with one or more primitive objects. The mesh of every primitive is subtracted from every input surface, which works with any primitive type. Unlike clipWithPrimitive(), the cut follows the mesh of the primitive rather than an analytic region, so a cylinder primitive cuts as a capped cylinder.

Signature:

cut_with_primitives(surfaceNames: list, primitiveNames: list, retainCutRegion: bool = False) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistA list containing the names of the surfaces to cut.
primitiveNameslistA list containing the names of the primitive objects to cut with.
retainCutRegionboolIf true, the removed region is added to the scene as a new surface object.

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
surfaceNameslistList of surface names to hollow.
methodSurfaceHollowMethodHollowing method. Use api.SurfaceHollowMethod.Fast (normal-based extrusion) or api.SurfaceHollowMethod.Robust (voxel-based).
directionSurfaceHollowDirectionHollow direction. Use api.SurfaceHollowDirection.Inward or api.SurfaceHollowDirection.Outward.
thicknessfloatWall thickness for the hollowed surfaces.
resolutionSurfaceHollowResolutionResolution preset for Robust method. Use api.SurfaceHollowResolution.Low, api.SurfaceHollowResolution.Medium, api.SurfaceHollowResolution.High, or api.SurfaceHollowResolution.Maximum.
createNewSurfaceboolCreate 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
surfaceNameslistList of surface names to smooth.
iterationsintNumber of times the smoothing algorithm should run (minimum: 2; default: 3). Higher values increase smoothing.
smoothFactorfloatSmoothing strength (relaxation factor). Higher values produce more smoothing (range: 0.001–1.0; default: 0.6).
featureEdgesboolIf true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed.
featureAnglefloatAngle 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
surfaceNameslistList of surface names to smooth.
iterationsintNumber of times the smoothing algorithm should run (minimum: 2; default: 20). Higher values increase smoothing.
smoothFactorfloatSmoothing strength (pass band value). Lower values produce more smoothing (range: 0.0001–1.0; default: 0.01).
featureEdgesboolIf true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed.
featureAnglefloatAngle 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
surfaceNameslistList of surface names to subdivide.
methodSurfaceSubdivisionMethodSubdivision method. Use api.SurfaceSubdivisionMethod.Linear, api.SurfaceSubdivisionMethod.Loop, api.SurfaceSubdivisionMethod.Butterfly, or api.SurfaceSubdivisionMethod.Adaptive.
subdivisionsintNumber of subdivision iterations (ignored for Adaptive method).
maxEdgeLengthfloatMaximum edge length for Adaptive subdivision (ignored for other methods).

General​

reorient​

Applies a six-parameter rigid reorientation to surfaces.

Signature:

reorient(surfaceNames: list, translation: list, rotationAnglesDegrees: list, center: list = [0.0, 0.0, 0.0], aroundObjectCentroid: bool = True) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to transform.
translationlistTranslation vector [x, y, z] in model units.
rotationAnglesDegreeslistXYZ Euler rotation angles in degrees.
centerlistRotation center [x, y, z] (ignored if aroundObjectCentroid=True).
aroundObjectCentroidboolIf true, rotates around object's bounding box centroid.

mirror​

Mirrors surfaces across specified axes.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to mirror.
mirrorXboolMirror across X axis.
mirrorYboolMirror across Y axis.
mirrorZboolMirror 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
surfaceNameslistList of surface names to move.

diagnose_surface​

Performs diagnostic checks on a surface and returns the results.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to diagnose.
checksSurfaceDiagnosticsChecksThe 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 = SurfaceDiagnosticsChecks()) -> None

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to be fixed.
checksSurfaceDiagnosticsChecksThe 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
surfaceNameslistList of surface names to merge (must have at least 2 surfaces).
targetSurfaceNamestrName of an existing surface to receive the merged result when createNewSurface=False. Ignored when createNewSurface=True (the new surface is auto-named).
mergePointsboolMerge duplicate (coincident) points after combining surfaces. Defaults to true.
removeInputSurfacesboolRemove input surfaces after merging. Defaults to false.
createNewSurfaceboolCreate a new surface instead of overwriting targetSurfaceName. Defaults to true.

Returns: str — The name of the merged surface when 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
surfaceNamestrName of the surface to separate.
numLargestShellsintNumber of largest shells to extract (0 = all shells).
removeInputSurfaceboolRemove 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
surfaceNamestrName of the surface to filter.
methodSurfaceFilterShellsMethodFilter method. Use api.SurfaceFilterShellsMethod.LargestShells, etc.
paramsSurfaceFilterShellsParamsFilter parameters including thresholds and retention settings. Create using params = api.SurfaceFilterShellsParams().

boolean_operation​

Performs boolean operations between surfaces. Input B surfaces are processed in list order. During a union, an Input B surface that has no contact with the accumulated result cannot be geometrically unioned. It is appended to the result as a separate disconnected shell at that processing step, and a warning identifies every surface handled this way. Later inputs are processed against the combined result and may intersect an appended shell. Intersection and difference operations report no contact as a failure and do not produce a result.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameInputAstrName of the first input surface.
surfaceNamesInputBlistList of names for the second input surfaces.
surfaceNameResultstrName for the resulting surface (only used if createNewSurface=False).
operationSurfaceBooleanOperationBoolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference.
createNewSurfaceboolCreate 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
surfaceNameInputAstrName of the first input surface.
surfaceNamesInputBlistList of names for the second input surfaces.
surfaceNameResultstrName for the resulting surface (only used if createNewSurface=False).
operationSurfaceBooleanOperationBoolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference.
voxelizationMethodSurfaceVoxelizeMethodVoxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast.
voxelSpacinglistVoxel spacing [x, y, z] for the operation (smaller values = higher quality).
smoothArtifactsboolSmooth artifacts in the resulting mesh (only applies to Voxelize method).
createNewSurfaceboolCreate 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 up to the given maximum hole size.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface on which to perform hole filling.
maxHoleSizefloatThe maximum hole radius (in surface/model units) that will be filled. Holes larger than this are left open. A value of 0 or less fills all holes regardless of size.
methodSurfaceHoleFillingMethodThe hole-filling method (api.SurfaceHoleFillingMethod.Angle, api.SurfaceHoleFillingMethod.Area, or api.SurfaceHoleFillingMethod.EarCut). The default is api.SurfaceHoleFillingMethod.Angle.

Returns: int — The number of holes filled in the surface.


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 = True) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to remesh.
methodSurfaceRemeshMethodRemesh method. Use api.SurfaceRemeshMethod.Adaptive or api.SurfaceRemeshMethod.Regular.
qualitySurfaceRemeshQualityQuality preset. Use api.SurfaceRemeshQuality.Medium, api.SurfaceRemeshQuality.High, or api.SurfaceRemeshQuality.Maximum.
densityintTarget density as percentage of original vertex count (11 - 100).
preserveEdgesboolIf true, preserves the surface's open boundaries (holes) and its sharp feature edges (such as creases and ridges) so they are not smoothed away during remeshing. This may produce less uniformly shaped triangles in the areas immediately surrounding the preserved edges.

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
surfaceNameslistList of surface names to remesh.
voxelizationMethodSurfaceVoxelizeMethodVoxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast.
voxelSpacinglistVoxel spacing [x, y, z] for the operation (smaller values = higher quality).
smoothArtifactsboolSmooth artifacts in the resulting mesh (only applies to Voxelize method).

invert_triangles​

Reverses the winding order of the given triangles of a surface, flipping the direction they face. Use this to correct individual triangles whose normals point the wrong way. Normals are recomputed afterwards. Triangle indices refer to the triangle order returned by get_geometry_data.

Signature:

invert_triangles(surfaceName: str, triangleIds: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to modify.
triangleIdslistA list of triangle indices to invert. Indices outside the mesh are ignored.

invert_all_triangles​

Reverses the winding order of every triangle of the given surfaces, flipping the direction they face. Use this when a whole surface faces inwards. Normals are recomputed afterwards. To reverse only some triangles, use invert_triangles instead.

Signature:

invert_all_triangles(surfaceNames: list) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to invert.

delete_shells​

Removes the given shells of a surface and keeps the rest of it. A shell is one connected region of the mesh. Shells are numbered from 0 in the order the connectivity of the surface produces them, which is the number the Shells tab of the Diagnostics and Fixes tool keeps for each row, not the position of the row in the table. An index that matches no shell is ignored, and a list that names every shell leaves the surface unchanged.

Signature:

delete_shells(surfaceName: str, shellIds: list) -> None

Parameters:

ParameterTypeDescription
surfaceNamestrThe name of the surface to modify.
shellIdslistA list of shell indices to remove, counted from 0.

reduce​

Reduces (decimates) the number of triangles while preserving overall shape. Use this method for general-purpose surface simplification/decimation. You can reduce by percentage or by desired final triangle count. The final triangle count is approximate and may differ from the requested value depending on the mesh.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to reduce.
desiredPercentagefloatPercentage of triangles to remove (0.0-100.0) when useDesiredPercentage is true.
useDesiredPercentageboolIf true, uses desiredPercentage; otherwise uses desiredTriangles.
desiredTrianglesintDesired final triangle count when useDesiredPercentage is false.

reduce_by_features​

Reduces (decimates) triangles while prioritizing preservation of sharp features. Use featureAngle to control how aggressively sharp edges and corners are preserved during reduction. You can decimate by percentage or by desired final triangle count. Depending on geometry and feature constraints, actual reduction may be lower than requested.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to reduce.
featureAnglefloatFeature angle in degrees used to preserve sharp features.
desiredPercentagefloatPercentage of triangles to remove (0.0-100.0) when useDesiredPercentage is true.
useDesiredPercentageboolIf true, uses desiredPercentage; otherwise uses desiredTriangles.
desiredTrianglesintDesired final triangle count when useDesiredPercentage is false.

reduce_by_nearby_points​

Reduces mesh complexity (decimation) by joining nearby points. Points that are closer than nearbyPointDistance may be merged, which can reduce both vertex and triangle counts. In some cases, running this operation multiple times can produce additional decimation.

Signature:

reduce_by_nearby_points(surfaceNames: list, nearbyPointDistance: float = 1.0) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to reduce.
nearbyPointDistancefloatDistance threshold used to join nearby points.

project_to_plane​

Projects surfaces onto a specified plane.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to project.
planeOriginlistPlane origin point [x, y, z].
planeNormallistPlane 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
surfaceNameslistList of surface names to mirror.
planeOriginlistPlane origin point [x, y, z].
planeNormallistPlane 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
surfaceNameslistA list containing the names of the surfaces to convert.
voxelizationMethodSurfaceVoxelConversionMethodVoxelization method. Use api.SurfaceVoxelConversionMethod.Filled, api.SurfaceVoxelConversionMethod.ThickContour, api.SurfaceVoxelConversionMethod.ThinContour, or api.SurfaceVoxelConversionMethod.LineContour.
smoothArtifactsboolApply 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, elementType: VolumeMeshElementType = api.VolumeMeshElementType.SurfaceSetting, maintainConformity: bool = False) -> list

Parameters:

ParameterTypeDescription
surfaceNameslistA list containing the names of the surfaces to convert.
methodVolumeMeshMethodVolume mesh generation method. Use api.VolumeMeshMethod.Auto3D or api.VolumeMeshMethod.Grid3D.
elementTypeVolumeMeshElementTypeElement type of the generated meshes. Use api.VolumeMeshElementType.SurfaceSetting, api.VolumeMeshElementType.Linear4Node, or api.VolumeMeshElementType.Quadratic10Node. The default uses the element type stored on the first surface.
maintainConformityboolTrue to keep the meshes of touching surfaces conforming at their shared interfaces. Used only by api.VolumeMeshMethod.Grid3D. The default is False.

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


Analysis​

recompute_normals​

Rebuilds the normals of the given surfaces from their current geometry. Use this after an edit that left the normals of a surface stale or missing. At least one of the two normal kinds has to be requested.

Signature:

recompute_normals(surfaceNames: list, faceNormals: bool = True, pointNormals: bool = True) -> None

Parameters:

ParameterTypeDescription
surfaceNameslistList of surface names to recompute the normals of.
faceNormalsboolTrue to rebuild the normal of every triangle. Default: True.
pointNormalsboolTrue to rebuild the normal of every point. Default: True.

See Also​