marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.05k stars 266 forks source link

can i save the outputs that I see visually? #357

Closed sahar-github closed 3 years ago

sahar-github commented 3 years ago

can i save the output results of vedo in any readable format of point clouds (las, ply, obj, off, ...)?

marcomusy commented 3 years ago

Yes, obviously! E.g.: mymesh.write("file.ply")

sahar-github commented 3 years ago

Thank you for your prompt response

On Wed, 31 Mar 2021, 23:41 Marco Musy, @.***> wrote:

Yes, obviously! E.g.: mymesh.write("file.ply")

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marcomusy/vedo/issues/357#issuecomment-811484494, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRG2E2GY6I5SRCN2ZJKN6LTGOJIVANCNFSM42FSZ3IA .

sahar-github commented 3 years ago

Actually my question was not very clear. I have a set of drawings including, mesh, lines, planes, ploygons, graphs and points which I can see them easily in visualizer. My purpose is to connect all these seperate objects into one and then write a file from all as a new mesh/object file. Could you please let me know how can I do this? Thanks in advance

On Wed, 31 Mar 2021, 23:41 Marco Musy, @.***> wrote:

Yes, obviously! E.g.: mymesh.write("file.ply")

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marcomusy/vedo/issues/357#issuecomment-811484494, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRG2E2GY6I5SRCN2ZJKN6LTGOJIVANCNFSM42FSZ3IA .

marcomusy commented 3 years ago

You can use function merge(myilstofmeshes) to merge multiple meshes into a single one, but this probably not what you want to do.. If you want to save a whole scene made of multiple objects to file, such file will not be neither ply nor off because these do not support scenes. So:

sahar-github commented 3 years ago

Thanks

I need to create a dwg/ dxf format of my results that I can open it later on in Autocad or similar softwar, is it possible to convert .npz to such formats probably?!

I have also another question, which will be very helpful if you could response. AS I mentioned, I have several 3D lines which are the borders of a 3D polygonal shape. But as I used the Line() command, they are disconnected. I would like to make a 3d polygon which fits inside these 3d lines/borders, is it something I can try with vedo? thanks

sahar-github commented 3 years ago

another question is how/if I can fit a plane inside a specific border points, I already saw there is an example which detects the border points of an existing plane, but how can I fit a plane inside the border points?

I am thinking may be I can fit planes inside the points and then merge all planes as a ply file which I can get usuable output of my data Is that possible? thanks in advace

marcomusy commented 3 years ago

I need to create a dwg/ dxf format of my results that I can open it later on in Autocad or similar softwar, is it possible to convert .npz to such formats probably?!

Sorry VTK does not support (afaik) those formats. You may need to write a converter from ply or numpy to those but I guess that would not be trivial.

I have also another question, which will be very helpful if you could response. AS I mentioned, I have several 3D lines which are the borders of a 3D polygonal shape. But as I used the Line() command, they are disconnected. I would like to make a 3d polygon which fits inside these 3d lines/borders, is it something I can try with vedo?

This sounds possible... You can disregard the lines as such, just take the ordered points and create a new line then you can try e.g. line.triangulate() or line.tomesh()

how can I fit a plane inside the border points?

what do you mean? You can fit a plane to points with fitPlane(pts)