Clear Filters
Clear Filters

How to get xyz coordinates of a 3d object

15 views (last 30 days)
Paula Daella
Paula Daella on 22 Sep 2015
Answered: Anandh on 21 Jun 2019
I need to get the xyz coordinate points of a 3d object that I've loaded in MATLAB.
So far, I've been able to load the .stl file and I can already rotate it. The part I'm having trouble in is getting the xyz coordinates of the object before rotating it.
Basically, what I need is to get the xyz coordinate points in that blue line, rotate it, and then get the xyz coordinates again, and so on, and so forth until I got all the xyz coordinates of the 3d object.
Is it possible to do this? And can anyone point me in the right direction?
I'm sorry because I'm fairly new to Matlab and 3d processing.
Thanks in advance!
  6 Comments
Walter Roberson
Walter Roberson on 22 Sep 2015
I am known by many names but Matthew is not one of them ;)
I will need to think about an implementation. Are the faces all in a consistent "handedness" that allow you to know which way is inside? Consistent orientation is needed for proper lighting so they might be in consistent order in the model file. Consistent order allows some linear algebra approaches to determine whether a given point is inside or outside.
Paula Daella
Paula Daella on 22 Sep 2015
Oops, I'm sorry. I don't know where I got Matthew from. :) It looks like I need to take a little break from this project.
I'm not really sure I know the answer to your question. But I will try to think about it and get back to you on that. Thank you.

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 22 Sep 2015
So create a cubiod grid of the x and y points you want to test together with z sampled over a fine enough interval for your purpose. Then put the grid through the above routine along with the geometry. This will voxelize the geometry into binary inside or outside test. Then for any given row and column indices the positions where the third dimension is true are the coordinates you are looking for.
  1 Comment
Paula Daella
Paula Daella on 22 Sep 2015
I get it in theory and I will try to implement it. Thanks for this Walter!

Sign in to comment.


Anandh
Anandh on 21 Jun 2019
Hi, I need a help. I have a 3D MRI data. I want to get the x,y,z coordinate matrices of the data. Can you please help me?
Thanks in advance!
Anandh.

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!