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
surfaceNameanyThe 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
surfaceNameanyThe 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
surfaceNameanyThe name of the surface to update.
geometryDataanySurface 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
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 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
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 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
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 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
surfaceNamesanyList of surface names to remesh.
paramsanyScreened 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
surfaceNamesanyList of surface names to remesh.
paramsanyUnscreened 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
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, 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
fileNameanyThe 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
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, 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.
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, 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'.
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.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.


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
targetSurfaceNameanyName of the surface onto which the text is projected.
textanyUTF-8 text to convert into surface geometry.
paramsanyFont, placement, scale, projection, and extrusion settings. Create using params = api.ProjectedTextParams().
resultSurfaceNameanyName 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
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].

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
surfaceNamesanyA list containing the names of the surfaces to clip.
primitiveNameanyThe name of the primitive object that defines the region of interest.
closedanyIf 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.
invertanyIf 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.
retainClippedRegionanyIf 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
surfaceNamesanyA list containing the names of the surfaces to cut.
primitiveNamesanyA list containing the names of the primitive objects to cut with.
retainCutRegionanyIf 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
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, api.SurfaceHollowResolution.High, or api.SurfaceHollowResolution.Maximum.
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

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
surfaceNamesanyList of surface names to transform.
translationanyTranslation vector [x, y, z] in model units.
rotationAnglesDegreesanyXYZ Euler rotation angles in degrees.
centeranyRotation center [x, y, z] (ignored if aroundObjectCentroid=True).
aroundObjectCentroidanyIf 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
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 = 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 = 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 of an existing surface to receive the merged result when createNewSurface=False. Ignored when createNewSurface=True (the new surface is auto-named).
mergePointsanyMerge duplicate (coincident) points after combining surfaces. Defaults to true.
removeInputSurfacesanyRemove input surfaces after merging. Defaults to false.
createNewSurfaceanyCreate 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
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. 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
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 up to the given maximum hole size.

Signature:

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

Parameters:

ParameterTypeDescription
surfaceNameanyThe name of the surface on which to perform hole filling.
maxHoleSizeanyThe 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.
methodanyThe 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
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, 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
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

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
surfaceNamesanyList of surface names to reduce.
desiredPercentageanyPercentage of triangles to remove (0.0-100.0) when useDesiredPercentage is true.
useDesiredPercentageanyIf true, uses desiredPercentage; otherwise uses desiredTriangles.
desiredTrianglesanyDesired 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
surfaceNamesanyList of surface names to reduce.
featureAngleanyFeature angle in degrees used to preserve sharp features.
desiredPercentageanyPercentage of triangles to remove (0.0-100.0) when useDesiredPercentage is true.
useDesiredPercentageanyIf true, uses desiredPercentage; otherwise uses desiredTriangles.
desiredTrianglesanyDesired 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
surfaceNamesanyList of surface names to reduce.
nearbyPointDistanceanyDistance 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
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