Create a mesh in memory?

Create a mesh in memory?

hanskellner
Autodesk Autodesk
784 Views
5 Replies
Message 1 of 6

Create a mesh in memory?

hanskellner
Autodesk
Autodesk

In the API there's the following support for creating a mesh:

 

MeshBodyList MeshBodies.add( string fullFilename, MeshUnits units )

 

But is there a way to create a mesh in memory? I would like to create a mesh surface from data I'm generating programmatically and not from a file.

 

Thanks.



Hans Kellner
Senior Manager, Principal Engineer
0 Likes
785 Views
5 Replies
Replies (5)
Message 2 of 6

marshaltu
Autodesk
Autodesk

Hello,

 

Unfortunately there was no way to create a mesh in memory by API.

 

We have a command named "BRep to Mesh" in direct modeling environment. We can probably export the functionality by API in future releases. Then users can create BRep body by feature API(e.g. extrude) and convert it to Mesh.

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes
Message 3 of 6

ekinsb
Alumni
Alumni

What is it that you're trying to do?  A mesh object in memory wouldn't be very useful but would basicallyl just be a wrapper over the mesh data.  Most mesh formats are fairly simple so it wouldn't be hard to read the original file itself and get the same information.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 4 of 6

hanskellner
Autodesk
Autodesk

The data is generated programmatically... as I mentioned in my post 😉

 

"I would like to create a mesh surface from data I'm generating programmatically and not from a file."

 

I'm creating surfaces and at the moment I have to generate the data, export it out to an STL or OBJ file, then load that file back in using the API call I mentioned. If the API supported creation of the mesh dynamically rather than loading through a file that would be great.

 

Or maybe there's some other way to do this?

 

Thanks.



Hans Kellner
Senior Manager, Principal Engineer
0 Likes
Message 5 of 6

ekinsb
Alumni
Alumni

I think I misunderstood your original question.  If I understand correctly now, you're saying that you already have mesh data of your own format in memory and you want to directly create a mesh body in Fusion without having to first write out your mesh data into some format on disk that Fusion can read in.  Is that right?  If so, that's a reasonable request but isn't something that the API currently supports.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 6 of 6

hanskellner
Autodesk
Autodesk

Yes, spot on!  Thx Brian.



Hans Kellner
Senior Manager, Principal Engineer
0 Likes