*It’s important to mention that this is a custom sorting of the points within each candidate zone, where we make the (A) Z value of the points have a greater ‘influence’ than their (B) distance to the local base plane, but we still get a sum of A and B to sort the points.
With that we try to force a finding of the closest-lowest point () at each of the candidate regions, to fit a line between them:
We then project this line to the local plane and use Rotate Direction again:
This time the first-and-lowest point of contact isn’t the same as before; it’s now the first closest-lowest point as I mentioned above, so it tries to make sure the plane doesn’t cut through the anatomy piece.
Another idea I had in mind was using a local axis for the mesh (for instance, the fitted line through all vertices) to rotate a plane about it and grab a bunch of mesh cross sections to then determine the biggest cross section and start messing with extreme points so we find the two contact points that way.
In essence I do make the mesh fall onto the base plane, attempting to anchor it from the lowest point then make it fall flushed with the base plane using the solid and plane collision component. Once it falls and settles, we get an intersection (base plane and collided mesh), consisting of two planar curves. The centers of these intersections can now be pulled to the mesh via Mesh Closest Point . From these points we can find the closest vertices and fit a line to use when rotating the direction of the base plane without compromising the position of the mesh.
Thank-you for this! You definitely should be proud. It is very close. It took me quite some time to follow the algorithm, but I think I understand most of except for the rational of the Z weighting vs. distance. Anyway it is a viable solution.
FWIW, the orientation of the femur was random for the exercise. I did not realize how “flat” the lowest regional was for the distal lateral femoral condyle (furtherest contact point from the origin) was. But it serves as a good test for algorithms which use approximation methods.
This seems to be very accurate. I had played around with Kangaroo earlier in the week but abandoned it.
What is interesting is that both methods work, but the more accurate one (Kangaroo) requires much more processing overhead. I’m on a generic PC and the lag due to the Kangaroo physics is noticeable. So the less accurate method may actually be better is some applications.
Anyway, thank-you for your help on this! I’m amazed at the talent here and the creative approaches to problem solving.
This is another great solution! As I understand your approach, you project an outline (reducing 3D to 2D), remove redundant points, create a hull, separate the hull into segments, filter the desired segment, use line segment to reconstruct plane. Simple, yet clever! Thank-you Thomas!
I wish there was a way to select more than one solution for a thread as all three latter solutions work for my purposes. Rene wins out as his solution was first, but I will also be using Thomas solution. Thank-you again!
Done, glad you are not offended. Your efforts were not in vain though. I learned a lot from your filtering methods and will be adapting your Kangaroo solution to a future problem. So this speed bump is solved, but I am expecting another one soon…but I will take several stabs at it first when I get there.
It makes me curious about other pieces you’re trying this with. Could you show us in the near future?
In the first method I shared I was also going with mesh shadows and convex hulls, but detoured from that because I didn’t know if reorienting was allowed; and it was! Like you said, as long as it wasn’t arbitrary. What Thomas did isn’t I broke my own rule of not over-constraining myself the whole time.
Though most likely unnecessary for this particular scenario, I kept looking into kangaroo, I think it’s definitely possible to improve and speed up rigid body collision, perhaps optimizing what’s shown here, here, or even here. while still constraining displacement along certain axes.
*At this point I guess you’d just use the 3D hull of the mesh to speed things up, drop it to the ground without it tumbling, then use some mesh-mapping from start 3D hull to target {dropped} 3D hull and reconstruct the original mesh…blah blah…
Back to what Thomas showed us and what I was doing in the beginning, I would have ended up with something like this:
Sure, but in case it wasn’t obvious, this GH newbie’s near future is still a ways out. Right now, I just trying to figure out possible workflows.
I’m really excited about the possibilities of Kangaroo. That is what I hope to learn more of as time permits. I had abandoned it for this problem as the videos and GH files I found all simulated the physics of bouncing around, simulating gravity. I was concerned about losing mesh alignment. So I probably should have investigated earlier. Anyway, I see other potential uses for Kangaroo.
Not sure how I taught anything, but I know I learned a lot and the journey continues. Now we about the capabilities of hull, which likely surpasses the intentions of its developer.
It’s all about curiosity! One time I managed to influence the decision-making of an orthopedic surgeon after putting together a model using CT files. Not that I know what I am doing, but I love how we can forget about our actual ‘fields of work’ some times, step into geometry/data world to play and solve problems, then come back to the mundane realm.
So yes, thanks - I love using words like “effective radius” from now on!
Makes a lot of sense for the fabrication terminology we use in our shop!