Now I have used the “wave” command in 3-matic to select the triangular faces in the acetabular area. Now I want to extract the point coordinates of the point cloud using the selected triangular faces. So, does 3-matic have these commands, or are there any script commands that can help me achieve this function? Please note that I don’t want to use the “point” command. Instead, I want to do it by manually selecting points.strong text
Hi! You can use the “.get_triangles” function of the “marked_triangles” object to retrieve the coordinates of each triangle. Let me know if this is what you are looking for!
Try this:
import trimatic
all_parts = trimatic.find_parts(regex=".\*")
for part in all_parts:
if getattr(part, "number_of_marked_triangles", 0) <= 0:
continue
sel = part.get_marked_triangles()
if not sel:
continue
points, triangles = sel.get_triangles()
i = 1
for triangle in triangles:
p1 = points[triangle[0]]
p2 = points[triangle[1]]
p3 = points[triangle[2]]
print("Triangle {}: [{}, {}, {}]".format(i, p1, p2, p3))
print()
i += 1
