Starting Point:
I am starting with two 3D-models of some arbitrary part. The first model is from a 3D-scan of the raw part, that is to be machined to produce the final part, which is described in the second model. The raw part is pretty irregular due to its manufacturing (additive manufacturing, casting) and might have a wavy surface and/or shape deviations.
Also, the raw part is near net shaped, but up to 15% larger than the final part for machining allowance.
Goal:
The goal I am trying to achieve is to align those two models (only by rotation + translation), such that the final part lies fully within the raw part (or at least as optimal as possible).
What I have tried so far:
Using the Open3D Library and Python, I managed to align the point clouds that are sampled from the parts somewhat ok, but the process is not stable and tends to give bad / no results. The algorithms I used are RANSAC and ICP.
I suspect that for my problem these are not ideal as they are meant to align overlapping point clouds of the same scene/object.
Researching the topic with Chat-GPT input and with google, I was looking into nesting, which might be the right direction, but I could only find literature/libraries for stacking objects into 3D-printer build volumes.
My Question:
Can anyone point me to a library or a algorithm that can be used for solving the "move model A into model B such that it is fully contained within" problem?
Define some score for each position.
e.g. if the position is outside of the first model, score becomes to very very large, if it is inside, the score will be smaller the farther away from the surface of the first model.
With this, your problem becomes "minimization".
i.e. you can calculate "badness" of the 2nd model's position (e.g. as sum of scores for each vertiex position) .