SurfaceOperations
Provides tools for creating, editing, and analyzing 3D surface objects. Supports import/export, primitive generation, mesh repair, transformation, boolean operations, remeshing, and conversion between surface and volume representations.
Import
import ScriptingApi as api
# Access via Application
app = api.Application()
ops = app.get_surface_operations()
Methods
Properties
get_render_properties_operations
Returns a SurfaceRenderPropertiesOperations object.
Signature:
get_render_properties_operations() -> SurfaceRenderPropertiesOperations
Returns: SurfaceRenderPropertiesOperations — A SurfaceRenderPropertiesOperations object.
get_basic_surface_mesh_info
Retrieves basic mesh information for a specified surface.
Signature:
get_basic_surface_mesh_info(surfaceName: str) -> BasicSurfaceMeshInfo
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | The name of the surface to retrieve information for. |
Returns: BasicSurfaceMeshInfo — A BasicSurfaceMeshInfo object containing the surface mesh information.
point_matching_registration
Performs point-based registration (ICP) to align source surfaces to a target.
Signature:
point_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, registrationMode: RegistrationMode = api.RegistrationMode.RigidBody, startByMatchingCentroids: bool = True, maximumLandmarks: int = 1000) -> list
Parameters:
| Parameter | Type | Description |
|---|---|---|
movableSurfaceNames | any | List of source/movable surface names to register. |
fixedObjectName | any | Name of the fixed target surface or mask. |
targetObjectType | any | Type of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask. |
registrationMode | any | Registration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine. |
startByMatchingCentroids | any | If true, starts by aligning centroids before registration. |
maximumLandmarks | any | Maximum number of landmarks to use for registration. |
Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Example usage: RegistrationResultRows = SurfaceOperations.point_matching_registration(['movable'], 'fixed', api.RegistrationMode.RigidBody) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)
feature_matching_registration
Performs feature-based registration using curvature matching to align surfaces.
Signature:
feature_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, globalIterations: int = 3, overlapRadius: float = 10.0, curvatureThreshold: float = 0.001) -> list
Parameters:
| Parameter | Type | Description |
|---|---|---|
movableSurfaceNames | any | List of source/movable surface names to register. |
fixedObjectName | any | Name of the fixed target surface or mask. |
targetObjectType | any | Type of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask. |
globalIterations | any | Number of global registration iterations. |
overlapRadius | any | Radius around a point for optimization (must exceed minimum patch distance). |
curvatureThreshold | any | Curvature threshold value (lower = higher accuracy). |
Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Example usage: RegistrationResultRows = SurfaceOperations.feature_matching_registration(['movable'], 'fixed', api.RegistrationMode.RigidBody) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)
point_plus_feature_matching_registration
Performs combined point and feature-based registration for improved alignment.
Signature:
point_plus_feature_matching_registration(movableSurfaceNames: list, fixedObjectName: str, targetObjectType: RegistrationTargetObject, registrationMode: RegistrationMode = api.RegistrationMode.RigidBody, startByMatchingCentroids: bool = True, maximumLandmarks: int = 1000, globalIterations: int = 3, overlapRadius: float = 10.0, curvatureThreshold: float = 0.001) -> list
Parameters:
| Parameter | Type | Description |
|---|---|---|
movableSurfaceNames | any | List of source/movable surface names to register. |
fixedObjectName | any | Name of the fixed target surface or mask. |
targetObjectType | any | Type of target object. Use api.RegistrationTargetObject.Surface or api.RegistrationTargetObject.Mask. |
registrationMode | any | Registration mode. Use api.RegistrationMode.RigidBody, api.RegistrationMode.Similarity, or api.RegistrationMode.Affine. |
startByMatchingCentroids | any | If true, starts by aligning centroids before registration. |
maximumLandmarks | any | Maximum number of landmarks to use for point matching. |
globalIterations | any | Number of global feature matching iterations. |
overlapRadius | any | Radius around a point for feature optimization. |
curvatureThreshold | any | Curvature threshold for feature matching. |
Returns: list — A list of GlobalRegistrationResultRow with RMSE values for each surface pair. Usage example: RegistrationResultRows = SurfaceOperations.point_plus_feature_matching_registration(['movable'], 'fixed', api.RegistrationTargetObject.Surface) for GlobalRegistrationResultRow in RegistrationResultRows: print(GlobalRegistrationResultRow.movable_surface) print(GlobalRegistrationResultRow.fixed_target) print(GlobalRegistrationResultRow.rmse_millimeters)
set_volume_mesh_parameters
Sets volume meshing parameters for a surface. Configures meshing quality and algorithm-specific options that will be used when converting the surface to a volume mesh. These parameters are stored in the surface object and persist until changed.
Signature:
set_volume_mesh_parameters(surfaceName: str, params: VolumeMeshParams) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | Name of the surface to configure. |
params | any | Volume 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:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | Name 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:
| Parameter | Type | Description |
|---|---|---|
fileNames | any | A list containing the full paths of the surface files to import. Supported file extensions are: stl, ply, obj, wrl, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is imported; as a result, some file formats are only partially supported. |
Returns: list — A list of strings containing the names of the imported surface objects. An empty list is returned if no files were imported successfully.
import_surface_from_disk
Imports a surface file from disk.
Signature:
import_surface_from_disk(fileName: str) -> str
Parameters:
| Parameter | Type | Description |
|---|---|---|
fileName | any | The full path of the surface file to import. Supported file extensions are: stl, ply, obj, wrl, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is imported; as a result, some file formats are only partially supported. |
Returns: str — Returns the name of the imported surface object if successful; otherwise, returns an empty string.
export_surfaces_to_disk
Exports surfaces specified by their names to disk files in a given directory with a specified file extension.
Signature:
export_surfaces_to_disk(surfaceNames: list, directoryPath: str, fileExtension: str, isASCII: bool = False) -> bool
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to export. |
directoryPath | any | The path to the directory where the surface files will be saved. |
fileExtension | any | The file extension to use for the exported surface files. Supported file extensions are: stl, ply, obj, wrl, u3d, 3mf, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is exported; therefore, some file formats are only partially supported. |
isASCII | any | If 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:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | The name of the surface to export. |
fileName | any | The path and name of the file to write the surface data to. Supported file extensions are: stl, ply, obj, wrl, u3d, 3mf, amf, gltf, step, iges, vtp, x3d, and xyz. Only mesh data is exported; therefore, some file formats are only partially supported. File name should include the file extension, e.g., 'C:/temp/surface.stl'. |
isASCII | any | If 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
width | any | The width of the box. |
height | any | The height of the box. |
depth | any | The depth of the box. |
center | any | The center position of the box [x, y, z]. |
resolution | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name of the cube. |
edgeLength | any | The length of each edge of the cube. |
center | any | The center position of the cube [x, y, z]. |
resolution | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radius | any | The radius of the sphere. |
center | any | The center position of the sphere [x, y, z]. |
rings | any | Number of rings (latitude resolution, default: 36). |
sectors | any | Number 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radius | any | The radius of the sphere. |
cutAngleDeg | any | The cut angle in degrees (0-180) to define the cap. |
center | any | The center position of the sphere [x, y, z]. |
rings | any | Number of rings (latitude resolution, default: 36). |
sectors | any | Number 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radiusX | any | Radius along X-axis. |
radiusY | any | Radius along Y-axis. |
radiusZ | any | Radius along Z-axis. |
center | any | The center position of the ellipsoid [x, y, z]. |
rings | any | Number of rings (default: 36). |
sectors | any | Number 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radius | any | The radius of the cylinder. |
height | any | The height of the cylinder. |
center | any | The center position of the cylinder [x, y, z]. |
resolution | any | The circumferential resolution (default: 36). |
capping | any | Whether to cap the cylinder ends (default: true). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radius | any | The radius of the capsule. |
height | any | The height of the cylindrical part. |
center | any | The center position of the capsule [x, y, z]. |
resolution | any | The circumferential resolution (default: 36). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
outerRadius | any | Outer radius of the tube. |
thickness | any | Wall thickness of the tube. |
height | any | The height of the tube. |
center | any | The center position of the tube [x, y, z]. |
resolution | any | The circumferential resolution (default: 36). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
radius | any | Base radius of the cone. |
height | any | The height of the cone. |
center | any | The center position of the cone [x, y, z]. |
resolution | any | The circumferential resolution (default: 36). |
capping | any | Whether to cap the cone base (default: true). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
totalLength | any | Total length of the arrow. |
shaftRadius | any | Radius of the arrow shaft. |
tipLength | any | Length of the arrow tip. |
tipRadius | any | Radius of the arrow tip. |
center | any | The center position of the arrow [x, y, z]. |
resolution | any | The circumferential resolution (default: 32). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
innerRadius | any | Inner radius (ring radius). |
outerRadius | any | Outer radius (total radius). |
center | any | The center position of the torus [x, y, z]. |
resolution | any | The resolution for both U and V directions (default: 36). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
solidType | any | Type of platonic solid. Use api.PlatonicSolidType.Tetrahedron, api.PlatonicSolidType.Cube, api.PlatonicSolidType.Octahedron, api.PlatonicSolidType.Icosahedron, or api.PlatonicSolidType.Dodecahedron. |
radius | any | The radius of the solid. |
center | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
innerRadius | any | Inner radius of the disk. |
outerRadius | any | Outer radius of the disk. |
center | any | The center position of the disk [x, y, z]. |
radialResolution | any | The radial resolution (default: 18). |
circumferentialResolution | any | The circumferential resolution (default: 36). |
direction | any | The 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:
| Parameter | Type | Description |
|---|---|---|
name | any | The name for the created surface (if empty, auto-generated). |
width | any | The width of the plane. |
height | any | The height of the plane. |
center | any | The center position of the plane [x, y, z]. |
resolution | any | The resolution for subdivisions (default: 1). |
direction | any | The direction axis (0=X, 1=Y, 2=Z, default: 2). |
Returns: str — The name of the created surface.
Modification
rotate
Rotates surfaces around a specified axis and center point.
Signature:
rotate(surfaceNames: list, angleDegrees: float, axis: list, center: list = [0.0, 0.0, 0.0], aroundObjectCentroid: bool = True) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to rotate. |
angleDegrees | any | Rotation angle in degrees. |
axis | any | Rotation axis [x, y, z]. |
center | any | Rotation center point [x, y, z] (ignored if aroundObjectCentroid=True). |
aroundObjectCentroid | any | If true, rotates around object's bounding box centroid. |
translate
Translates surfaces by a specified vector.
Signature:
translate(surfaceNames: list, translation: list) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to translate. |
translation | any | Translation vector [x, y, z] in model units. |
scale
Scales surfaces by specified factors along each axis.
Signature:
scale(surfaceNames: list, scaleFactors: list) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to scale. |
scaleFactors | any | Scale factors [x, y, z]. |
transform
Applies a transformation matrix to the specified surfaces.
Signature:
transform(surfaceNames: list, matrix: list) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to transform. |
matrix | any | Transformation matrix [16 elements]. |
hollow
Creates a hollow version of surfaces with specified wall thickness.
Signature:
hollow(surfaceNames: list, method: SurfaceHollowMethod, direction: SurfaceHollowDirection, thickness: float, resolution: SurfaceHollowResolution = api.SurfaceHollowResolution.Medium, createNewSurface: bool = False) -> list
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to hollow. |
method | any | Hollowing method. Use api.SurfaceHollowMethod.Fast (normal-based extrusion) or api.SurfaceHollowMethod.Robust (voxel-based). |
direction | any | Hollow direction. Use api.SurfaceHollowDirection.Inward or api.SurfaceHollowDirection.Outward. |
thickness | any | Wall thickness for the hollowed surfaces. |
resolution | any | Resolution preset for Robust method. Use api.SurfaceHollowResolution.Low, api.SurfaceHollowResolution.Medium, or api.SurfaceHollowResolution.High. |
createNewSurface | any | Create 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to smooth. |
iterations | any | Number of times the smoothing algorithm should run (minimum: 2; default: 3). Higher values increase smoothing. |
smoothFactor | any | Smoothing strength (relaxation factor). Higher values produce more smoothing (range: 0.001–1.0; default: 0.6). |
featureEdges | any | If true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed. |
featureAngle | any | Angle 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to smooth. |
iterations | any | Number of times the smoothing algorithm should run (minimum: 2; default: 20). Higher values increase smoothing. |
smoothFactor | any | Smoothing strength (pass band value). Lower values produce more smoothing (range: 0.0001–1.0; default: 0.01). |
featureEdges | any | If true, sharp interior edges are identified and preserved based on the feature angle. If false, all features are smoothed. |
featureAngle | any | Angle 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to subdivide. |
method | any | Subdivision method. Use api.SurfaceSubdivisionMethod.Linear, api.SurfaceSubdivisionMethod.Loop, api.SurfaceSubdivisionMethod.Butterfly, or api.SurfaceSubdivisionMethod.Adaptive. |
subdivisions | any | Number of subdivision iterations (ignored for Adaptive method). |
maxEdgeLength | any | Maximum edge length for Adaptive subdivision (ignored for other methods). |
General
mirror
Mirrors surfaces across specified axes.
Signature:
mirror(surfaceNames: list, mirrorX: bool = False, mirrorY: bool = False, mirrorZ: bool = False) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to mirror. |
mirrorX | any | Mirror across X axis. |
mirrorY | any | Mirror across Y axis. |
mirrorZ | any | Mirror 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to move. |
diagnose_surface
Performs diagnostic checks on a surface and returns the results.
Signature:
diagnose_surface(surfaceName: str, checks: SurfaceDiagnosticsChecks) -> SurfaceDiagnosticsResult
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | The name of the surface to diagnose. |
checks | any | The set of diagnostic checks to perform on the surface. Create using checks = api.SurfaceDiagnosticsChecks(). |
Returns: SurfaceDiagnosticsResult — A SurfaceDiagnosticsResult object containing the results of the diagnostic checks.
fix_surface
Applies specified fix operations to a surface identified by name.
Signature:
fix_surface(surfaceName: str, checks: SurfaceDiagnosticsChecks) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | The name of the surface to be fixed. |
checks | any | The 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to merge (must have at least 2 surfaces). |
targetSurfaceName | any | Name for the resulting merged surface. |
mergePoints | any | Merge duplicate points after combining surfaces. |
removeInputSurfaces | any | Remove input surfaces after merging. |
createNewSurface | any | Create a new surface instead of modifying the first input. |
Returns: str — The name of the merged surface in case of createNewSurface=True; otherwise, returns an empty string.
split
Separates a surface into multiple surfaces based on disconnected regions.
Signature:
split(surfaceName: str, numLargestShells: int = 0, removeInputSurface: bool = False) -> list
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | Name of the surface to separate. |
numLargestShells | any | Number of largest shells to extract (0 = all shells). |
removeInputSurface | any | Remove 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:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | Name of the surface to filter. |
method | any | Filter method. Use api.SurfaceFilterShellsMethod.LargestShells, etc. |
params | any | Filter parameters including thresholds and retention settings. Create using params = api.SurfaceFilterShellsParams(). |
boolean_operation
Performs boolean operations between surfaces.
Signature:
boolean_operation(surfaceNameInputA: str, surfaceNamesInputB: list, surfaceNameResult: str, operation: SurfaceBooleanOperation, createNewSurface: bool = True) -> str
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNameInputA | any | Name of the first input surface. |
surfaceNamesInputB | any | List of names for the second input surfaces. |
surfaceNameResult | any | Name for the resulting surface (only used if createNewSurface=False). |
operation | any | Boolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference. |
createNewSurface | any | Create 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNameInputA | any | Name of the first input surface. |
surfaceNamesInputB | any | List of names for the second input surfaces. |
surfaceNameResult | any | Name for the resulting surface (only used if createNewSurface=False). |
operation | any | Boolean operation type. Use api.SurfaceBooleanOperation.Union, api.SurfaceBooleanOperation.Intersection, or api.SurfaceBooleanOperation.Difference. |
voxelizationMethod | any | Voxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast. |
voxelSpacing | any | Voxel spacing [x, y, z] for the operation (smaller values = higher quality). |
smoothArtifacts | any | Smooth artifacts in the resulting mesh (only applies to Voxelize method). |
createNewSurface | any | Create a new surface instead of modifying input1. |
Returns: str — The name of the resulting surface in case of createNewSurface=True; otherwise, returns an empty string.
fill_holes
Fills holes in the specified surface using the given method and maximum hole size.
Signature:
fill_holes(surfaceName: str, maxHoleSize: int, method: SurfaceHoleFillingMethod = api.SurfaceHoleFillingMethod.Angle) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceName | any | The name of the surface on which to perform hole filling. |
maxHoleSize | any | The maximum size of holes (in surface units) that will be filled. |
method | any | The method used for hole filling. Use api.SurfaceHoleFillingMethod.Angle or api.SurfaceHoleFillingMethod.Area. |
remesh
Remeshes surfaces to improve triangle quality and distribution.
Signature:
remesh(surfaceNames: list, method: SurfaceRemeshMethod = api.SurfaceRemeshMethod.Adaptive, quality: SurfaceRemeshQuality = api.SurfaceRemeshQuality.Medium, density: int = 100, preserveEdges: bool = False) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to remesh. |
method | any | Remesh method. Use api.SurfaceRemeshMethod.Adaptive or api.SurfaceRemeshMethod.Regular. |
quality | any | Quality preset. Use api.SurfaceRemeshQuality.Medium, api.SurfaceRemeshQuality.High, or api.SurfaceRemeshQuality.Maximum. |
density | any | Target density as percentage of original vertex count (11 - 100). |
preserveEdges | any | If true, this option will retain any holes or edges found in the original mesh. |
voxel_remesh
Remeshes surfaces using voxel-based method.
Signature:
voxel_remesh(surfaceNames: list, voxelizationMethod: SurfaceVoxelizeMethod = api.SurfaceVoxelizeMethod.Fast, voxelSpacing: list = [1, 1, 1], smoothArtifacts: bool = True) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to remesh. |
voxelizationMethod | any | Voxelization method. Use api.SurfaceVoxelizeMethod.Accurate or api.SurfaceVoxelizeMethod.Fast. |
voxelSpacing | any | Voxel spacing [x, y, z] for the operation (smaller values = higher quality). |
smoothArtifacts | any | Smooth artifacts in the resulting mesh (only applies to Voxelize method). |
createNewSurface | any | Create new surfaces instead of modifying inputs. |
reduce_smart
Reduces the number of triangles in the specified surfaces using a smart reduction algorithm.
Signature:
reduce_smart(surfaceNames: list, desiredPercentage: float, useDesiredPercentage: bool = True, desiredTriangles: int = 3000) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to reduce. |
desiredPercentage | any | The desired reduction percentage (0.0 - 100.0). |
useDesiredPercentage | any | If true, uses the desired percentage; otherwise, uses the desired triangle count. |
desiredTriangles | any | The desired number of triangles after reduction. |
reduce_feature_based
Reduces the number of triangles in the specified surfaces based on a feature angle.
Signature:
reduce_feature_based(surfaceNames: list, featureAngle: float, desiredPercentage: float, useDesiredPercentage: bool = True, desiredTriangles: int = 3000) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to reduce. |
featureAngle | any | The feature angle to use for reduction (in degrees). |
desiredPercentage | any | The desired reduction percentage (0.0 - 100.0). |
useDesiredPercentage | any | If true, uses the desired percentage; otherwise, uses the desired triangle count. |
desiredTriangles | any | The desired number of triangles after reduction. |
reduce_join_near_by_points
Reduces the number of triangles in the specified surfaces by merging nearby points.
Signature:
reduce_join_near_by_points(surfaceNames: list, nearByPointDistance: float) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to reduce. |
nearByPointDistance | any | The distance threshold for merging nearby points. |
project_to_plane
Projects surfaces onto a specified plane.
Signature:
project_to_plane(surfaceNames: list, planeOrigin: list, planeNormal: list) -> None
Parameters:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to project. |
planeOrigin | any | Plane origin point [x, y, z]. |
planeNormal | any | Plane 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | List of surface names to mirror. |
planeOrigin | any | Plane origin point [x, y, z]. |
planeNormal | any | Plane 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to convert. |
voxelizationMethod | any | Voxelization method. Use api.SurfaceVoxelConversionMethod.Filled, api.SurfaceVoxelConversionMethod.ThickContour, api.SurfaceVoxelConversionMethod.ThinContour, or api.SurfaceVoxelConversionMethod.LineContour. |
smoothArtifacts | any | Apply 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:
| Parameter | Type | Description |
|---|---|---|
surfaceNames | any | A list containing the names of the surfaces to convert. |
method | any | Volume mesh generation method. Use api.VolumeMeshMethod.Auto3D or api.VolumeMeshMethod.Grid3D. |
Returns: list — A list of names for the created volume mesh objects.