The principle is the same - just place the “far-away” points at a distance in the axis-direction of your desired “hit-point”. The ClosestPoint method will find the closest point on the mesh starting from these two “probing” points.
If you have the femur meshes (.stl or .obj format) you just open or import them into Rhino. The process of [edit: extracting] DICOM [to mesh] is very advanced and I don’t know of any plugins that work with Grasshopper, so making a mesh from the DICOM data would have to be handled with other software.
(BTW, the DICOM data format is extreemly complex so I understand why there’s no DICOM import-plugin for Rhino. One guy mentioned he had worked only with DICOM format for five years, and still doesn’t master all of the definitions. That’s standards going terrible wrong…).
I don’t know of the DICOM axes other than the orientation in which the bone comes as a mesh. it is possible to align a BoundingBox to the bone, but then there’s risk for losing the “rotation” orintation in some axes. An illustration would be better to see exactly how you want it.
Find an example of how to automate finding the plane - if the bone is “nearly axis aligned” (with the world axes) attached.
femur_plane.gh (271.5 KB)
Fig 1. here the “attractions points” are copy-moved to the far right. The basic principle of course works in any direction. Thee green surface is the final CPlane.
Of course the femur bone doesn’t have to be perfectly aligned. The ClosestPoint approach only depends on where you place the, lets call them, “attraction points” for the ClosestPt operation. Trying to automagically find a certain orientation can sometimes be very tricky since you have both orientation and rotation of the bone (around its longitduinal axis) to regard, unless the orientation is always very consistent when taken from the DICOM. You would also like to mirror the left or the right side when you automate, becaue you wouldn’t like to make two solutions… (just mirror back after all the processing is done). Aso.