Getting points from mesh

Technical discussions
Post Reply
atrev
Posts: 24
Joined: Tue Jul 30, 2013 9:19 am

Getting points from mesh

Post by atrev »

We need to be able to get all the points from a mesh, but can seem to only get them in local coords. We use the model explorer to move a mesh for example, but we need to be able to get all the points in the global axis scheme.

Also we need to set and get the location/rotation matrices for our data sets. Can this be done directly to a mesh or pointcloud for the whole object?

Thanks

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Getting points from mesh

Post by nickz »

Hi atrev
Yes all geometry is defined relative to local coordinates so it does not change when the local frame is moved.
You need : IModel > GetSection() > ISection > IFrame3 (or IFrameEx) > ToGlobal() . ToGlobal() will convert coordinates of the vertices or points in the point set to global ones

KC frames are a geometric way to represent matrixes. All properties of frames are managed by these interfaces: http://www.dynoinsight.com/Help/Interfa ... rview.aspx
They can be queried from ISection for any type of object

We also have internally multiplication and inversion of frames which is analogue of the same operations on matrixes. Let me know if you need that.

I do not think you need matrixes actually. All 3D point/vector operations can be done with frames. Just in case: You can convert a frame to a matrix for example by setting i-th row to the numbers returned by I3DObject.GetAxis(i, out mi1, out mi2, out mi3 ); (http://www.dynoinsight.com/Help/I3DObject.aspx )
The complete transformation also includes translation by the vector returned from I3DObject.GetOrigin()

ToGlobal(v) for examples multiplies v by the matrix, and adds the translation, that’s all
ToLocal(v) multiplies v by the inverse matrix and subtracts the translation (up to the opposite :D )
Nick

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Operations with frames

Post by nickz »

In the update v4.3.3756 we have added IFrame3.ToLocal(IFrame frame). It is the analogue of multiplying matrixes. IFrame3.ToGlobal(IFrame frame) corresponds to division of matrix this by matrix of frame (i.e. multiplication by the inverse matrix)

IMeshMods has also new ToLocal(IFrame frame), which changes coordinates of all elements in the mesh to make them local to frame, assuming the mesh was in global coordinates. This is slow of course. When there is another object, point or simple object like box, involved it is much faster to make sure the object is in same coordinates as the mesh instead

Nick

Post Reply