< Back to IRCAM Forum

How to read 3D mesh files in Modalys for Max

Hi, I’m new to both of those software so I’m still clueless to most features here, and I’m using Windows so it’s just Max and I don’t have ModaLisp. In what directory should I place the mesh file? How do I properly read that .mesh/.msh file without error? Is the read-from-file object treated as a resonator? Does it have to be a hexahedral mesh, or can it be triangular? Last, how do the position settings work here?
Attached is the test file I’m trying to read (triangular mesh) agong.mesh (342.9 KB)

Hello,

Your triangular polygon “agong.mesh” does not work in ModaLisp.

— The location of the mesh file should specified with a path within the mlys or maxpat file. The easiest would just put everything into the same folder.
— The extension could indeed be .mesh, .msh, .data or whatever you want at the condition it is not a binary mesh. Modalys does not take STL files.
— Modalys very unfortunately does NOT work with triangular meshes; but rather hexahedral ones. You then need to remesh it using another software. That process is not so easy and I did not find any simple software doing that.
If you know something easy running under MacOS… I could not find out if MeshLab or Gmsh were doing it. I am using Rhino for now but, unless you are doing other stuff with it, it is a bit cumbersome for such a direct conversion.

O.

Thanks for the reply! So you use Rhino to convert to hexahedral mesh? I’ll look around for software and try to work on making a hexahedral mesh first, then I’ll update afterwards. For the file path, what is the syntax? Is the file path and name typed after the “read from file” object?

Hi,

So you use Rhino to convert to hexahedral mesh?

I am using it for other means so I indeed also use it for hexahedral meshing.
But I am also looking for a quick workflow and therefore a way to re-mesh from triangular polygons to hexahedral ones.

For the file path, what is the syntax? Is the file path and name typed after the “read from file” object?

You can simply use the filepath syntax from your system…

For instance, if you wanna import a mesh from MacOS in a Modalys LISP file:
(setq diapason (make-mesh 'read-from-file "/my/path/mymesh.mesh"))

Or from Max’s Mlys on MacOS:
Object = make_object('read-from-file','/my/path/mymesh.mesh')

Or, on MacOS, within the ‘mlys.read-from-file’ Max object argument:
mlys.read-from-file 1 2 @name Object @filename /my/path/mymesh.mesh

I guess I was able to get Max to read the file, but now it says “ERROR: bad ModalObject data in file”. This was with a hexahedral mesh I was able to make with gmsh, unless I did that wrong. I used this tutorial (7:10 onwards) https://www.youtube.com/watch?v=U5GCClyaxWo
-Imported a STEP file
-Went to tools > options > mesh > general
-MeshAdapt for 2D algorithm, MMG3D for 3d algo
-All hexas subdivision algorithm

Hi, I’m also an enthousiast Rhino user who’s looking for the right method to import my mesh into modalys and generate a modal file from it.

This way I could load it in max and play in real time using the mlys.read-from-file object

I’ve quandrangulate my Mesh then exported to .obj, but I can’t find a way to convert the file into .mesh format either with blender or meshlab…
any updates on this ?
thanks for your help !

Hello !

Sorry for my late answer !! :wink:

— You can indeed quadrangulate some meshes using… “quadrangulate” in Grasshopper for instance. This does not always work well though.
Rhino 7 now allows the creation of quad meshes from surfaces, solids, meshes, or SubDs (!!) and works better for complex forms.
— After Baking with Grasshopper, I personally export that Rhino mesh as a STL file and convert into a .mesh (INRIA mEdit file) file using the lovely Gmsh (https://gmsh.info).
— However, these are quad meshes and not hexa… So this is probably not working for ModaLisp ? Any “ERROR: bad ModalObject data in file” message ?

I cannot wait having a cool and easy FEM sound generator in Rhino and my little finger tells me there is going to be an experimental one soon. :wink:

O.

1 Like

Hello,

Couldn’t any among MeshLab’s many remeshing modes function for this purpose?

Thanks a lot ! Just saw Rhino 7 includes the Mesh Quadrangulate command and that Modalys 3.6 now support .obj files ! Light at the end of the tunnel ? :grinning:

Please feel free to share .obj meshes made with Rhino7. That’s going to be interesting for testing.
And by the way, Modays 3.6 will be published later today :wink:
Robert
Update: I am including a .obj import example in 3.6…