Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. F = BsplineFunction[model]; (* Model surface as B spline Function *)
  2. (* Surface Sampling Function *)
  3. SurfaceSampling[p_] := Flatten[Table[F[u, v], {u, 0, 1, p}, {v, 0, 1, p}], 1];
  4.  
  5.  
  6. ModelSurface = SurfaceSampling[0.005]; (* Actual sampling *)
  7. g = Drop[T1[[2]][[1]].Append[vec, 1], -1] (* T1 Geometric Transform of point "vec" *)
  8.  
  9. (* CtrlPts is the point could *)
  10. T1 = FindGeometricTransform[Nearest[CtrlPts, ModelSurface], CtrlPts,
  11. "Transformation"- > "Rigid", Method -> "FindFit"];
  12.  
  13. (* Apply found transformation to the ModelSurface *)
  14. ModelSurface = Map[g, ModelSurface]
  15. (* After a couple of iterations, T will become the optimal transformation *)
  16. T = T1[[2]][[1]].T;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement