Example a_backup/isolines: Generating isolines and points on those lines.

Screenshot of example a_backup/isolines

The comfile run by this example is as follows:

# Example a/isolines:  Load an image and generate datapoints at threshold value.

# Read in some geometry to hold our texture and define coordinates.
gfx read node $example/transverse_155.exnode;
gfx read element $example/transverse_155.exelem;

# Read in our texture
gfx create texture image image $example/transverse_155.tif width 1 height 1;
gfx create material transverse_155 texture image;

# Define a gray spectrum useful for rendering out image field.
gfx create spectrum gray_spectrum clear overwrite_colour
gfx modify spectrum gray_spectrum linear range 0 1 extend_above extend_below monochrome colour_range 0 1 ambient diffuse component 1;

# Would really benefit from some image processing here!

# Use a fine discretization with for generating the isolines.
gfx modify g_element transverse_155 general element_discretization "512*512*512"

# Define the density field used to control the number of points generated below.
# Here we want a constant number of points per segment length.
gfx define field point_density constant 5;

# Create the isolines
gfx modify g_element transverse_155 iso_surfaces as isolines select_on iso_scalar image iso_value 0.09 use_elements select_on material white selected_material default_selected render_shaded data point_density;

gfx modify g_element transverse_155 surfaces as texture_surface select_on material transverse_155 texture_coordinates xi selected_material default_selected render_shaded;

if (!$TESTING)
	 gfx create window 1;
	 gfx mod win 1 set perturb_lines;
	 gfx modify window 1 layout 2d ortho_axes z -y;

# Generate points on the isolines calculated above.
gfx create ngroup data;
gfx convert graphics scene default.isolines render_surface_node_cloud region data coordinate coordinates;
# Alternative using regions:
#gfx create region data;
#gfx define field data/coordinates coordinate_system rectangular_cartesian finite_element number_of_components 3 coordinate real component_names x y z;
#gfx convert graphics scene default.isolines render_surface_node_cloud region data coordinate coordinates;

# Write out these points
gfx write nodes group data data_cloud.exnode;

if (!$TESTING)
	 gfx modify g_element data node_points glyph cross general size "2*2*2" centre 0,0,0 font default select_on material default selected_material default_selected;

Files used by this example are:

Name                   Modified     Size

isolines.com 20-Apr-2012 2.3k COPYRIGHT 19-Apr-2012 504 transverse_155.exelem 20-Apr-2012 2.2k transverse_155.exnode 20-Apr-2012 742 transverse_155.tif 20-Apr-2012 110k

Download the entire example:

Name                               Modified     Size

examples_a_backup_isolines.tar.gz 12-Aug-2014 163k

Testing status by version:

StatusTestedReal time (s)
cmgui-wxSuccessSun Mar 6 00:11:04 20163
cmgui-wx-debugSuccessSun Mar 6 00:15:26 20165
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:19:46 20165
cmgui-wx-debug-valgrindSuccessSun Mar 6 01:42:47 2016162
cmgui-wxSuccessThu Jan 7 00:01:30 20162
cmgui-wx-debugSuccessThu Jan 7 00:01:42 20162
cmgui-wx-debug-memorycheckSuccessThu Jan 7 00:01:49 20164
cmgui-wx-debug-valgrindFailureSun Mar 6 00:10:00 2016135
last breakSun Mar 6 00:07:00 2016135
last successWed Jun 3 01:00:00 2015126
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:11:13 2016134

Testing status by file:

Html last generated: Sun Mar 6 05:50:58 2016

Input last modified: Fri Apr 20 15:59:53 2012

CMISS Help / Examples / a_backup / isolines