Creating curved clips from splines

These are two related tools which create 2D curved “clips” from user-created splines. The tools do not create actual EnSight clip parts. Instead the final result is either an offset part (a type of elevated surface) or a second case with a single part and no variables. The “clip” geometry and mesh depend only on the splines, not on any parts.

Tool 1 – Curved clip from a single spline

splines

This will create a clip which is the shape of a spine extruded in a single direction.

Instructions

  1. Makes one or more splines
  2. Run the tool (if there is more than one spline the tool will ask you to select one)
  3. Set the extrusion distance and direction

The tool should run and a new part should be visible.

Options to set in the file before starting EnSight

grid_size – The clip mesh will be quad4 elements that are approximately square. The grid_size variable sets the desired length of one side of each element.
min_spline_points – In cases where the grid_size is too large relative to the length of the spline the number of elements could be very small. If the number of points along the spline is below the minimum specified here then the grid_size will be reduced to meet the minimum requirement.

Tool 2 – Curved clip from two splines

splines2

This will create a clip which is the shape of a spine extruded along the direction of a second spline.

Instructions

  1. Make two or more splines
  2. Run the tool
  3. Select the two splines to use (the order of the splines matters) and other options in the window

The tool should run and a new part should be visible. If there are critical errors a window should pop up with an error message. If the direction of the extrusion is in the wrong direction, invert the second spline and run the tool again.

Options to set in the file before starting EnSight

There are two methods the tool can use for creating clips.
1. The default is to write a new case file, load it in as a second case, and use CaseMap to color it by a variable. This method is much faster and more robust but it does require loading a second case. For that reason a second method is included.
2. Create a point part with triangle mesh, then use the point part to create an offset part. There are two sub-methods for how to create the point part. See below.

temp_file_type – chooses which method above to use.
‘case’ is for writing a new case file.
‘point’ is for creating a point part by writing a point part file.
‘none’ will create a point part without using a file.
grid_size – The grid_size variable sets the desired distance between neighboring nodes.
max_rectangles – (for ‘case’ only) If the given grid_size and spline lengths would result in more than max_rectangles then the grid_size will be increased.
max_triangles – (for ‘point’ and ‘none’ only) The tool can become prohibitively slow if there are too many triangles. The number depends on your hardware and OS but 10k triangles should take a few seconds, 100k triangles a few minutes. The time increase is faster than linear (i.e. n^2) so be careful how high you go. If the given grid_size and spline lengths would result in more than max_triangles then the grid_size will be increased.

Other

Creating point parts should be faster in 10.1.4a and later. Some text output is sent to the python tab.

spline_clip.zip (updated 2015-4-23)