Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a mesh from a set of segments?

Status
Not open for further replies.

bjni7565

Computer
Sep 26, 2005
4
Hi everyone,

I´m looking for a way to create a 3d-model from a set of measurements made on an object. The sets of measurement data are represented as segments/slices of the object, as can be seen from this picture.

set.jpg


Each and every segment is a matrix containing [x,y,z] values (,z in the length direction) and will most likely not contain an equal set of cordinates.

Is there a known method on how to do this? I´m somewhat of a newbie on matlab and would appreciate any help from you guys. Perhaps just a point in the right direction?

Thanks!

-Björn Nilsson
 
Replies continue below

Recommended for you

Take a look at "Tessellation and Interpolation of Scattered Data" in Matlab's demos.
 
Thanks guys.

I´m currently trying to solve my problem using "convhulln". It´s a rough approximation but I think it suits my needs.

Thanks for your help!
 
Sorry, I misread your post. You want a wireframe model not a a filled-in one.

You already have vectors defining the x, y and z coordinates of each node.
You need a second matrix defining which nodes are connected to which by lines. e.g. if node 5 is connected to node 9 then you should have a column in your line definition matrix which reads [5 9]
You can then use the "line" command to plot the lines.

Here's a very simple 2D example I used recently. It defines the undeformed base wireframe model for plotting some mode shapes. It extends vey easilty to 3D:
Code:
% x coordinates of nodes
nodesx = [0 0.2 0.333 0.5 0.666 0.8 1 0.2 0.8];
% y coordinates of nodes
nodesy = [0 0 0 0 0 0 0 -0.1 -0.1];
% define connections between nodes
connections = [1 2 2 3 4 5 6 6
               2 8 3 4 5 6 9 7];
% plot the lines
figure
line(nodesx(connections),nodesy(connections));
axis equal

% you can also define the connections using more that 2 nodes
% in the example above you could trace out the shape using 
% a single line which will plot a little quicker.
% connections = [1 2 8 2 3 4 5 6 9 6 7]'
% In your case, you could define a line for each of the circles
% and a line for each of the axial lines connecting the cirlces

--
Dr Michael F Platten
 
Thanks for your comments MikeyP.

I have to ask: won´t this method be somewhat tricky if I dont have the same amount of datapoints in all of the "slices"? Say for example that I have 500 data points in one
"slice" and 600 in another.
 
You would have to use a cell array for the connections instead of a matrix. Not tricky at all.

M

--
Dr Michael F Platten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor