Visualising in Python standalone projects

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
sumudu9112
Posts: 1
Joined: Tue Oct 30, 2018 11:58 am

Visualising in Python standalone projects

Post by sumudu9112 »

Hello Louise,

I'm working with Linux OS and hence not being priviledged to use the GUI.
The example on http://texgen.sourceforge.net/index.php ... ne_scripts worked well(I used the pweave.tg3 meshfile from ~/TexGen/Python/Scripts/Standalone) and I could visualise the .vtk file in Paraview without a problem.

1) My next step is to get a weftKnit.py example and do the same as in the above example. I'm not really clear on writing the .vtk file for that weftKnit.py example on your github repo since it's written to be used in the GUI.
2) Also when I run 2dweave.py in the ~/TexGen/Python/Scripts/Standalone , it complains the following. Any suggestions to get this sorted?

File "2dweave.py", line 4, in <module>
from TexGen.Renderer import *
ModuleNotFoundError: No module named 'TexGen.Renderer'

Any leads on above issues would be highly appreadiated.
Best
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Visualising in Python standalone projects

Post by louisepb »

Hi,

It should be possible to build on Linux including the GUI (but it can be time consuming as you have to build VTK, wxWidgets etc). If you just want to render you will need to build the render module. I assume that the error message saying you don't have a module named Renderer is because you haven't done this. (If you have built it then I guess it's a path issue and Python doesn't know where to look for it).

You can build the Renderer model by selecting BUILD_RENDERER in cmake. You will need to build the VTK libraries in order to do this. If you get this built then the standalone scripts should open a render window and display the TexGen model in that.

Your link makes me realise that the page that you linked to is quite old! If you follow the method up to the point where you've created the mesh you should then be able to just call the mesher.SaveVolumeMeshToVTK( filename) function.

Any of the scripts should work as standalone if you remove the AddTextile command.

Hope that helps,
Louise
Post Reply