Page 1 of 1

vtp connectivity node table

Posted: Sun Jan 31, 2021 7:35 pm
by aloma
Dear All,
I am trying to extract the connectivity table of a mesh surface .vtp file in the following format,
element_number face_ID node1 node2 node3 as it used to be on files .ebc.

I tried to use David Parker code (https://github.com/ktbolt/vtk/tree/mast ... esh/python) as a starting point, but I could not get the nodal information.

In this link (https://marq-my.sharepoint.com/:f:/g/pe ... Q?e=K9a8b8) I uploaded the files I am using, just in case.

Thank you for your help.

Aloma

Re: vtp connectivity node table

Posted: Mon Feb 01, 2021 9:14 am
by pfaller
Hi Aloma,

I had a brief look at your code. For printing the coordinates, I see

Code: Select all

format(i, node_id, x, y, x)
Should that be

Code: Select all

format(i, node_id, x, y, z)
If that's not the problem, let us know how exactly the code failed.

Best
Martin

Re: vtp connectivity node table

Posted: Mon Feb 01, 2021 10:11 am
by aloma
Thank you Martin,
I did not see that error.
But, I'm having another problem, in the code I attached I'm extracting the node information, in the following order:
element_node, node_id, x, y, z
Node 38165 ID: 56153 Coords: 1.05515 6.65914 6.42562

But, what I am trying to extract is the element_number, face_ID, node1, node2, node3 as it used to be saved on the old .ebc files.
I'm lost in what vtp Class Reference I need to use to achieve that.

Thank you for your help.

Aloma

Re: vtp connectivity node table

Posted: Thu Feb 04, 2021 6:45 pm
by aloma
Dear All,
I am struggling to find a solution and I was wondering if it is possible at all.

Thanks for your help.

Aloma

Re: vtp connectivity node table

Posted: Thu Feb 04, 2021 11:46 pm
by davep
Hi Aloma,

I modified the print_mesh.py script here https://github.com/ktbolt/vtk/tree/mast ... esh/python to work with .vtu and .vtp files. Try it out and let me know if it solves your problem.

Cheers,
Dave

Re: vtp connectivity node table

Posted: Fri Feb 05, 2021 9:04 am
by aloma
Thank you so much Dave,
It solves exactly the problem that I have.

Best,

Aloma