Non manifold assembly (3-matic 14.0)

In this tutorial some basic features of remeshing to create a non-manifold assembly are presented using the project BonePlate.mxp that is located in the 3-matic installation folder under folder DemoFiles.

import trimatic
import os

#Open the project BonePlate.mxp
application_exe = trimatic.get_application_path()
application_path = os.path.dirname(application_exe)
path = application_path + "/DemoFiles/BonePlate.mxp"
trimatic.open_project(path)

# get a list of the objects that exist in the file
bone = trimatic.find_part('Bone')
plate = trimatic.find_part('Plate_MovedSurface')
screws = trimatic.find_part('Screws')
trimatic.delete(trimatic.find_part('Plate'))
plate.name = 'Plate'

# Remesh separate objects prior to creating the NMA
trimatic.adaptive_remesh_expert(entities=(bone,plate,screws),shape_measure=trimatic.ShapeMeasures.height_base_n,shape_quality_threshold=0.3,maximum_geometrical_error=0.05, minimum_triangle_edge_length=0,maximum_triangle_edge_length=0.5, number_of_iterations=10, skip_bad_edges=False,preserve_surface_contours=False, preserve_sharp_edges=False,local_remesh_parameters=(), local_growth_rate=25)

# Duplicate objects to maintain a copy after NMA creation
bone2 = trimatic.duplicate(bone)
plate2 = trimatic.duplicate(plate)
screws2 = trimatic.duplicate(screws)
bone2.visible = False
plate2.visible = False
screws2.visible = False

# Create NMA
nma = trimatic.create_non_manifold_assembly_intersection(plate, (bone, screws))
nma.name = 'Non-manifold'

# Improve mesh of NMA
trimatic.adaptive_remesh_expert(entities=nma,shape_measure=trimatic.ShapeMeasures.height_base_n,shape_quality_threshold=0.3, maximum_geometrical_error=0.05,minimum_triangle_edge_length=0, maximum_triangle_edge_length=0.5,number_of_iterations=10,skip_bad_edges=False,preserve_surface_contours=False,preserve_sharp_edges=False, local_remesh_parameters=(), local_growth_rate=25)

# Create volume mesh
nma.visible = False
vol_mesh_nma = trimatic.duplicate(nma)
vol_mesh_nma.name = nma.name + "_volume_mesh"
trimatic.create_volume_mesh(part=vol_mesh_nma, maximum_edge_length=1)

# Analyze mesh quality
trimatic.analyze_mesh_quality_volume(vol_mesh_nma, shape_measure=trimatic.ShapeMeasuresAnalyzeMeshQualityVolume.abaqus_shape_factor_n,
						  shape_quality_threshold=0.0001)