×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to create a mesh from a set of segments?

How to create a mesh from a set of segments?

How to create a mesh from a set of segments?

(OP)
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.



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

RE: How to create a mesh from a set of segments?

(OP)
No one?

RE: How to create a mesh from a set of segments?

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

RE: How to create a mesh from a set of segments?

(OP)
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!

RE: How to create a mesh from a set of segments?

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

RE: How to create a mesh from a set of segments?

(OP)
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.

RE: How to create a mesh from a set of segments?

You would have to use a cell array for the connections instead of a matrix. Not tricky at all.

M

--
Dr Michael F Platten

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources