vtp connectivity node table

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Aloma Blanch
Posts: 14
Joined: Mon Jun 17, 2019 8:31 am

vtp connectivity node table

Post by Aloma Blanch » Sun Jan 31, 2021 7:35 pm

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

User avatar
Martin Pfaller
Posts: 60
Joined: Tue Oct 01, 2019 10:23 am

Re: vtp connectivity node table

Post by Martin Pfaller » Mon Feb 01, 2021 9:14 am

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

User avatar
Aloma Blanch
Posts: 14
Joined: Mon Jun 17, 2019 8:31 am

Re: vtp connectivity node table

Post by Aloma Blanch » Mon Feb 01, 2021 10:11 am

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

User avatar
Aloma Blanch
Posts: 14
Joined: Mon Jun 17, 2019 8:31 am

Re: vtp connectivity node table

Post by Aloma Blanch » Thu Feb 04, 2021 6:45 pm

Dear All,
I am struggling to find a solution and I was wondering if it is possible at all.

Thanks for your help.

Aloma

User avatar
David Parker
Posts: 1651
Joined: Tue Aug 23, 2005 2:43 pm

Re: vtp connectivity node table

Post by David Parker » Thu Feb 04, 2021 11:46 pm

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

User avatar
Aloma Blanch
Posts: 14
Joined: Mon Jun 17, 2019 8:31 am

Re: vtp connectivity node table

Post by Aloma Blanch » Fri Feb 05, 2021 9:04 am

Thank you so much Dave,
It solves exactly the problem that I have.

Best,

Aloma

POST REPLY