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.
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
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.
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.
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.
Yes, spot on! Thx Brian.