Message Boards Message Boards

0
|
8606 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Extracting Imported Mesh Data as List and Manipulating them

Posted 10 years ago

Hello, I am new to Mathematica and still in the trial phase and I am having a hard time achieving something I assume would be relatively simple to do in Mathematica:

What I want to do:

  • a) Import a mesh from the file system then extract the data as a List.
  • b) Transform the data by applying a matrix transform to all {x,y,z} vector.
  • c) render a new mesh that results from the transformed data.

I found some examples of Import and a few other examples related to this so here is what I was able to do and what I could not do: - I am able to import a 3D file - I get a display of the file BUT I cannot extract {x,y,z} data from the file as list of vector coordinates. - I am able to perform matrices computation on list data I enter manually but then I cannot display the mash data on screen.

People familiar with OpenGL will recognize the above as basic steps of working with 3D models, I turned to Mathematica because it is supposed to provide a friendlier environment for 3D algebraic computations but I find myself struggling with the syntax, I think I need a bit of help or at least some pointers from people that have already done that.

POSTED BY: LV VS

I haven't worked very much with the new mesh functionality, so let me know if I've misunderstood your question.

(* Make a random Mesh to play with for this example*)
example = TriangulateMesh@DelaunayMesh[RandomReal[1, {50, 3}]]

(* Define a transformation matrix *)
myMat = {{1, 0, 0}, {2, 0, 1}, {0, 1, 0}};

(* Transform the mesh according to that matrix *)
TransformedRegion[example, myMat.{#1, #2, #3} &]

TransformedRegion can apparently take an arbitrary well defined function. So it's not just stuck with linear transforms.

If you want to work directly with the points defined inside of the mesh, that's possible as well but probably not necesssary. It can be done with http://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract