Irregular bone mesh surface manupulations

Hi all,
I’m new to Grasshopper and have some experience working with Rhino for surface scanning and layering. I have a likely basic question to get me started on identifying a bone plane that is necessary for orthopedic work.

I’m trying to identify 3 points on the mesh surface of a very irregular shape (femur) and create a plane out of it. When I try to pick with point prompt, it toggles to the C-plane, but c-plane itself is not easy to toggle to the three points i would want to start from. What’s the best way to generate a plane with points from a mesh? I figured out that hingepoints generate points on the surface so i don’t have to pick specifics, but i’m not sure how much that helped. Sorry for the basic question, hope you can help.

Can you post a screenshot of the bone and illustrate where you want the plane and point out what the plane should be based on? (the exact criteria for the correct points to pick).

A plane can be defined in many ways and in some cases it’s not trivial to arrive at plane with a very precise definition if it depends on the completeness of the scan as well as its quality, especially if the end goal is to automate the location and orientation of the plane. Example below of a tricky case I’ve dealt with (medial and inferor borders truncated and very bad scan quality).

Fig 1 Scapula plane (green)

// Rolf

Hi, looks similar to what i’m trying to achieve. I will initially create a plane on the distal two points of the femur condyles, and the distal femoral neck protrusion. This is the plane generated if you were to lay a femur flat on a table (how they defined it to begin with). The points that govern it can come from a variety of mesh intersections, so as long as it’s within the vicinity of the low points, the exact point is not critical or well defined since the surface is relatively flat at the point we want.

OK, so one manual way of finding the most lateral points would be the following:

  1. place a point on the same “height” as the first point. Important to place the point somewhat aligned with the center of the femur bone (as seen from top-down)

  2. place a second similar point at the lower end.

  3. Type the command ClosestPt ans select the femur mesh, and press Enter,
    3.b. Select the point (as the “Base point for closest point”) using “Point” as ObjectSnap.
    3.c. Repeat for the lower end.
    (The result should now look similar to Fig 1 below).

  4. Drag-Copy the lower point by holding down ALT and drag the point in the desired direction (in order to prepare for a 3-point definition of a Construction Plane).

  5. Invoke CPlane command, select the 3Point option, and pick the three points, starting with the lower point on the femur.

You should now have your plane aligned to the femur’s most lateral points.

Fig 1. Lateral points on the femur
bild

Fig 2. The oriented CPlane and it’s three orientation points in perspective :
bild

If you would like to automate this using Grasshopper it is quite simple to do so if the femur “basic orientation” is known (nearly axis aligned, same axes etc.)

femur_model.3dm (329.2 KB)

// Rolf

Thank you, this is going in the right direction but i’m still not clear on a couple of things. I’m trying to pick the posterior points of the femoral condyles, not the lateral, and the lesser trochanter point that is parallel to the posterior condyles. If you rest the femur on the ground on both condyles essentially, not on its side. For automating the process, I think I would be able to import an origin from a DICOM right? That would automatically define the coordinate system to pick those points faster. When i try to pick points in space and get closest points, it’s very sensitive to the orientation of the bone, is there a way to pick the points of the bone that protrude the most? Like the femoral head point farthest from the bone centroid, epicondyles, posterior and distal points of the bone to essentially create the bounding box. I tried bounding box but it’s dependent on the c-plane. My overall goal is to bound a box and pick those points to define the bone landmarks so the plane i’m trying to get is a step in that direction. Do you have any ideas on defining the C-plane to create the bounding box that will align the coordinate system to the DICOM axes?

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.
bild

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.

// Rolf

This is very useful, thank you. My main issue I think is the orientation of the bone when I import it is rotated compared to the global axis. The DICOM I meant is segmented in Mimics, then the 3d shape from that segmentation can be saved as an object or stl or anything else. I am looking for features only for now, so I import the surface model, then mesh it in grasshopper. I want to define unique points but the orientation of the c-planes is giving me a headache. When I create a point that is in a view perpendicular to the c-plane, then ask for the closest point, the second prompt is a scout point, correct? It seems to snap the closest point to an arbitrary point, depending on the protrusion and the plane orientation. Is there a way to rotate the imported object so it’s parallel to the global axis based on points I select from the object?

femur_model_brep.zip (5.1 MB) I was playing around with this scan using the Rhino 7 Quadmesh to SubD converter and then to a NURBS brep.

There are still some repair that could be done, but might this be useful? It can be exported as am IGES, but would need a bit of work to be a closed STEP solid. I attached an example.

I used this new feature:

1 Like

Very useful, thank you. Is this part of the WIP as in it can potentially have issues? or is it a stable release as part of the unstable 7 release? I assume the Rhino7 will still be released when it will be released, is there any udpate on the date?

We do not really have a date, but Rhino 7 is more then stable enough to do the work I show here. It does not replace Rhino 6 on your computer. So even just downloading it to do this work and then save it back to 6 is a good workflow if that is what you need.

1 Like