Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- F = BsplineFunction[model]; (* Model surface as B spline Function *)
- (* Surface Sampling Function *)
- SurfaceSampling[p_] := Flatten[Table[F[u, v], {u, 0, 1, p}, {v, 0, 1, p}], 1];
- ModelSurface = SurfaceSampling[0.005]; (* Actual sampling *)
- g = Drop[T1[[2]][[1]].Append[vec, 1], -1] (* T1 Geometric Transform of point "vec" *)
- (* CtrlPts is the point could *)
- T1 = FindGeometricTransform[Nearest[CtrlPts, ModelSurface], CtrlPts,
- "Transformation"- > "Rigid", Method -> "FindFit"];
- (* Apply found transformation to the ModelSurface *)
- ModelSurface = Map[g, ModelSurface]
- (* After a couple of iterations, T will become the optimal transformation *)
- T = T1[[2]][[1]].T;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement