In this tutorial basic measurements operations are presented using the project Femur.mxp that is located in the 3-matic installation folder under folder DemoFiles. To open the project, first launch 3-matic and select File -> Open project .
The first step in this tutorial is to manually mark the femur head, the neck and the femur shaft. To mark areas click on the menu Mark -> Brush Mark -> Wave Brush Mark and select the area of interest. To make sure that the triangles are marked through the selected area, hold the SHIFT button while selecting.
The Marked triangles of the regions are then separated into different surfaces. To create a new surface, right click on the Marked triangles that appear in the Object tree after the selection of the desired area, click Separate -> Move to Surface -> Create New .
Rename the created surfaces to head, neck and shaft for the femoral head, neck and shaft area respectively.
import trimatic # Assign to variables the part and the created surfaces femur = trimatic.find_part("femur") shaftsurface = femur.find_surface('Shaft') necksurface = femur.find_surface('Neck') headsurface = femur.find_surface('Head') # Create an analytical sphere and fit lines headsphere = trimatic.create_sphere_fit(headsurface) neckline = trimatic.create_line_fit_ruled_surface(necksurface) shaftline = trimatic.create_line_fit_ruled_surface(shaftsurface) #to check if the analytical entities are present in the correct positions, set the femur to high transparency femur.transparency=0.5 # print the radius of the head of the sphere print("Radius of the femur head is ",headsphere.radius) print("\n \n") # Calculate the angle between the neck and the femur and print the value femurangle = trimatic.create_angle_measurement_line_to_line(shaftline,neckline) print("Angle between femur neck and femur shaft is ",femurangle.value)