Skip to content

Legacy_Mesh2Input

Fabian Brinkmann edited this page Jul 16, 2022 · 1 revision

This part of the package includes the python script export_mesh2hrtf.py and some standard evaluation grids. The python script is an add-on to the free, open source 3D computer graphics program Blender. The plugin takes the given mesh and exports the for the calculation necessary data. There are several export settings which are listed below. The Mesh2Input folder also contains some Standard- EvaluationGrids that can be used within the Blender script.

In the following, you will find a description of how to utilize this plugin:

Installation

  1. Download and install Blender (version 2.7 or above)
  2. Download latest version of Mesh2HRTF from Sourceforge (contains Mesh2Input, NumCalc, Output2HRTF and EvalTools)
  3. Open the python script exportmesh2hrtf.py (located in Mesh2Input\Source)
  4. In line 247 change the content of the variable programPath to the absolute path of the Mesh2HRTF folder (the folder containing the sub-folders Mesh2Input, NumCalc, etc.). This is to define the program folder where all the information for the numerical calculation (NumCalc) will be exported
  5. Start blender to install add-on scripts
  6. Go to User Preferences –> Add-Ons -> Install Add-on from File... and select exportmesh2hrtf.py (don’t forget to activate the add-on -> checkbox)

Preparing mesh for export

  1. The whole object must be named “Reference” (not the skin material)
  2. When using reciprocal calculation, the microphones must be defined as a material named “Left ear” and “Right ear”

Exporting data

  1. Go to OBJECT MODE in Blender (important, otherwise you'll get an error {..., context is incorrect})
  2. Export mesh by going to File -> export -> Mesh2HRTF
  3. Select export folder
  4. There are several options to choose from:
    • Selection of the ear to calculate (left, right, both)
    • Reciprocal calculation
    • Position of a point sound source
    • Selection of evaluation grids
    • Frequency steps (=lowest frequency) and highest frequency for calculation
    • Selection of CPUs (Denker) and number of used CPU cores
    • Selection of program path (see above - should be correct if you changed it in the source code of export_mesh2hrtf.py, otherwise add manually, but double check)

Result

  • folder: EvaluationGrids (contains evaluation grids as .txt files)
  • folder: ObjectMeshes (contains head mesh as .txt file)
  • folder: NumCalc (contains input files for numerical calculation with NumCalc, for every CPU and core)
  • file: Info.txt (contains information for the calculation and distribution of the CPUS (Denker)
  • file: Output2HRTF.m (for generating SOFA-files out of the BEM results)
  • file: 3d Model.blend (Blender file of the object to calculate)