Custom mesh visualization with Houdini

Preview in new tab(opens in a new tab)

Houdini is not the typical software used for scientific visualizations but the possibilities that Houdini offers are truly amazing.

However the first step to use Houdini is to instruct it how to read data. In this guide I’ll describe the steps to read an element mesh. I assume that the mesh data file is in some custom format.

One option is  to convert the custom file into a typical file format like wavefront .obj and then read via a file node.

The option I’ll describe here is to use a python node that reads a custom mesh file. The format of the file is as follows

where np is the number of mesh nodes and nel the number of mesh elements. The next np lines are the coordinates of the nodes followed by the node ids that the elements are made of. Note that the file reads either triangular or quadrilateral elements. The triangular elements are indicated by setting 0 as the fourth id of the node element.

By default Houdini interface is split into 3 main windows. Place the cursor anywhere inside the network view window(bottom right), press tab, start typing the word geometry, press enter to confirm and left click to place a geometry node.

Hou_001 Hou_002

Double click to enter inside the geo1 node. Select the default file node and press delete to… delete it!

Inside the geo1 node, with the cursor still located anywhere inside the network view, press tab, type python and press enter to confirm and left click to place the python node. The window above the network view is where the properties of the selected node are shown. For the python node there is just an almost empty area where one can write python code. I’ll add one more property which is a gui element to select the mesh file.

Find the gear button at the top right corner of the property window. Click once and choose Edit Parameter Interface…

Hou_004

At the left panel select the type file and click the arrow between the 2 panels (the one that points to the right) to add a new parameter.

Hou_005

Highlight the newly created property and rename the Name and label as shown in the figure below

Hou_006

Make sure you spell the Name exactly the same way

Next Apply and Accept to close the window and a new property will appear!

Hou_007

You can now click on the icon after the dropdown menu symbol to chose the mesh file.

Finally paste the following code inside the python Code area and you should be able to read a 2D mesh.

My example is a 2D mesh for the Central Valley groundwater basin

Hou_008

While this doesn’t seem to be something particularly interesting, it’s basic step for using the Houdini Beast!

Custom text appearance in QGIS

At a first glance when you add a label the options that QGIS offers to change the appearance of a text seem very limited, especially when you migrate from Arc, which offers a nice variety of predefined text styles. Below you can see the options you get in QGIS by default. There are options for changing fonts font style, font color but no options to add a shadow or a border around the text, effects that are quite common when creating maps. In the next figure you can see the default appearance, which in my case its not looking nice as the background colors are very saturated.

qgis_fonts1 qgis_fonts2

Here is the magic of QGIS:

There is a tick box Render as HTML right below where you type the text, that allows you to use html expressions to define text.

So instead of writing Willows as text you can add for example

which produce exactly the effect I was going for.

You can further tweak the appearance of the border by changing the 5px number to adjust the thickness and the color by inserting any html color code (https://htmlcolorcodes.com/).

The results with the above settings is:

qgis_fonts3

As you may have already guessed this opens endless possibilities for text styles.

 

 

 

Greek Bathing Water Profiles

The quality of bathing waters in Greece is systematically monitored since 1988 according to Directive 76/160/EEC “on the quality of bathing waters” under a Programme organized and coordinated by the MEECC (Ministry of Environment and Energy). Since 2010, the quality of bathing water is monitored in accordance with the new Directive 2006/7/EC “on the management of bathing water quality” as transposed to Greek legislation with JMD 8600/416/E103/2009 (GG 356V/2009) under the “Country’s Monitoring Programme for bathing water quality” (hereinafter called the “Programme”).

This is the google fusion version

This is the Google Map version