How to Manually Assign Explicit Feature Edges for snappyHexMesh with Blender

@Runmin ZHAO  July 26, 2018

Manually-assigned feature edges can give users more control over where they want to refine, without bothering with the two angles, i.e. includeAngle & resolveFeatureAngle, and worrying about whether the wanted edges would be resolved, as is introduced in the last post.

Actually, We can stay with a not-that-small resolveFeatureAngle value and still refine at the edge we want, even when the neighbouring patches of the edge are (almost) parallel.

In this post, I am going to introduce the workflow of manually assigning explicit feature edges using Blender. We will

  • Generate the geometry in Blender;
  • Extract the feature edges in Blender;
  • Export the lines to an obj file;
  • Convert the obj file to an eMesh file.

Generate the geometry stl file in Blender

This step is dead easy if you are familiar with Blender.

If you want to import the stl geometry formerly prepared, just click File>Import>Stl(.stl).

Extract the feature edges in Blender

  • Press Tab to enter the edit mode of Blender, then in the bottom toolbar, click the Edge Selectbutton.
  • Right-click on the edges you want to select, you may need to press the Shift key to select multiple lines.
  • When the selection is done Press P, and click the first item, meaning ''separate selected geometry into a new mesh'.
  • Find the extracted mesh in the right panel. Give it a new name.
  • It is OK to extract multiple times if there are a lot of lines. We can export them as a whole later

Export the lines to an obj file

  • While pressing Shift, click the items we just extracted in the right panel and select them all
  • Click File>Export>Wavefront(obj)
  • In the left bottom, make sure whether you need the coordinate system to be Y Up or Z Up
  • Do check the item Selection Only, otherwise, it will export the whole model
  • Give the file name and export

Convert the obj file to an eMesh file

We can put the obj file in the ./constant/triSurface directory and in the same directory, run the command

surfaceFeatureConvert Edges.obj featureEdges.eMesh

Now a eMesh file storing the edges is ready for snappyHexMesh to read.

Add a New Comment

  1. raffaele

    thanks for sharing