MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem using PrincipalComponents to rotate 3D model data


Will,

Principal components, or the principal vectors can be reversed 
(mirrored) and still be valid principal vectors. If (j,k,l) are the 
principal vectors, then (-j,-k,-l) or any other combination is also 
possible.

Antti

will wrote:
> Dear Math Forum,
> 
> I am using PrincipalComponents[] (in Mathematica 6) to perform a rotation operation on some 3D data (effectively to align my data so that the maximum length of my models runs down the x axis,the maximum width down the y axis, and height max on the z axis).
> However, i have noticed that mathematica repeatedly reverses the normal (flips inside out) of and/or mirrors my models. I find this very odd, and was wondering if anyone else had encountered this problem? it seems to happen consistently with certain models, but i cannot see what is different in these models to those (few) that work as they should. if this problem is to do with my data,
> can anyone think of a way to rotate the models not using 
> PrincipalComponents[].
> 
> below is the code i have been using on STL (3D points and surface polygon data).
> 
> Needs["MultivariateStatistics`"];
> 
> 3Dmodel = Import["3Dmodel.stl"];
> 
> Rotated3Dmodel = 
>   Graphics3D[{EdgeForm[], 
>     Polygon[Partition[
>       PrincipalComponents[Flatten[3Dmodel[[1, 2, 1]], 1]], 3]]}, 
>    Boxed -> False];
> 
> Export["Rotated3Dmodel.stl", Rotated3Dmodel];
> 
> thank you,
> 
> William
> 


  • Prev by Date: double integral of long expression in Mathematica
  • Next by Date: Creation of temporary copies of arrays when using x[[a]]=b
  • Previous by thread: Problem using PrincipalComponents to rotate 3D model data
  • Next by thread: Re: Problem using PrincipalComponents to rotate 3D model data