Determine distance between bones and Antenna
Anatomical Models
2
Posts
2
Posters
348
Views
2
Watching
-
Hi, I would like to calculate the distance between an antenna and the bone surface perpendicular to the antenna. What would be the best way to approach this?
Thanks
-
To measure the shortest distance between two entities, you can use the Python API:
import XCoreModeling as xcm shell = xcm.GetActiveModel().SelectedEntities[0] coil = xcm.GetActiveModel().SelectedEntities[1] res = xcm.GetEntityEntityDistance(shell, coil) print(f"Shortest distance shell-coil: {res[0].Distance}") p1 = xcm.CreatePoint(res[0].ClosestPosition) p1.Name = "Point on Shell" p2 = xcm.CreatePoint(res[1].ClosestPosition) p2.Name = "Point on Coil" # This line is just to visualize where the measured distance was taken line = xcm.CreatePolyLine([res[0].ClosestPosition, res[1].ClosestPosition])
This would create something like this:
Some other snippets are shared here: https://forum.zmt.swiss/topic/565/geometry-modeling-snapping-to-endpoints-in-python-api/3?_=1747746585465