Uses semi-transparent surfaces to view the heart and lungs through the muscle and fat layers and outer surface of the torso.
If you are using the firefox web browser and have installed the Zinc extension you can view this example online by using one of the links below:
#Example_a5: Multiple element groups and translucency: the torso model # # The torso model contains 6 separate element groups, each a boundary element # mesh separating a region of the torso. From the inside to out they are the # heart, left and right lungs, muscle, fat and the torso skin. This example # demonstrates the use of multiple graphical element groups and uses translucent # materials to view the inside and out of the torso simultaneously. It also # shows how to get around problems with semi-transparent materials by drawing # the groups in a set order from inside to out. # # Be sure to run the commands in this example in the order they are presented. # It is recommended that you read the comments then execute the commands that # follow them either individually or in groups if they are on consecutive lines. # #---------- # #Create some materials to be given to surfaces of the various torso parts. gfx create material heart diffuse 1. 0. 0. #Red heart gfx create material lungs diffuse 0.9 0.3 0.3 #Slightly pink lungs gfx create material fat diffuse 0.9 0.7 0.0 alpha 0.4 #Translucent yellow fat gfx create material muscle diffuse 1.0 0.1 0.0 alpha 0.5 #Translucent red muscle gfx create material torso diffuse 0.7 0.7 0.7 alpha 0.3 #Translucent grey torso gfx create material axes ambient 1 1 0 diffuse 1 1 0 #Yellow axes # # Read in the nodes. Note that we only read in one node group containing all the # nodes used in this example; the graphical element groups will each make a node # group containing just the nodes in that element group. gfx read node example body.exnode # # (In older versions of this example the element groups were read in alphabetical order, # and in older versions of cmgui it was necessary to reorder them to fix transparency. # In new new versions of cmgui groups no longer have separate graphics, so the # order graphics are added in the region is all that matters.) gfx read elem example body_heart.exelem gfx read elem example body_llung.exelem gfx read elem example body_rlung.exelem gfx read elem example body_muscle.exelem gfx read elem example body_fat.exelem gfx read elem example body_torso.exelem # # draw axes gfx modify g_element "/" general clear; gfx modify g_element "/" point as 1 glyph axes_xyz general size "100*100*100" select_on material axes selected_material default; # # In latest versions of cmgui nodes are not automatically added to groups. # The following commands manually add them: gfx modify egroup heart add group heart manage_subobjects; gfx modify egroup llung add group llung manage_subobjects; gfx modify egroup rlung add group rlung manage_subobjects; gfx modify egroup muscle add group muscle manage_subobjects; gfx modify egroup fat add group fat manage_subobjects; gfx modify egroup torso add group torso manage_subobjects; # # Modify the graphical finite elements to show lines plus surfaces in appropriate materials. gfx modify g_element heart lines coordinate coordinates material default; gfx modify g_element heart surfaces coordinate coordinates material heart; gfx modify g_element llung lines coordinate coordinates material default; gfx modify g_element llung surfaces coordinate coordinates material lungs; gfx modify g_element rlung lines coordinate coordinates material default; gfx modify g_element rlung surfaces coordinate coordinates material lungs; gfx modify g_element muscle lines coordinate coordinates material default; gfx modify g_element muscle surfaces coordinate coordinates material muscle; gfx modify g_element fat lines coordinate coordinates material default; gfx modify g_element fat surfaces coordinate coordinates material fat; gfx modify g_element torso lines coordinate coordinates material default; gfx modify g_element torso surfaces coordinate coordinates material torso; # # Create a 3-D graphics window: gfx create window 1 gfx modify window 1 view perspective # # The easiest way to get the transparency behaviour we expect is to turn on # 'slow_transparency'. This requires drawing the image twice and thus slows # down the display somewhat. The following command turns it on: gfx modify window 1 set slow_transparency # # If display speed is important and you don't mind the odd visual artefact, the # default 'fast_transparency' option should be used: gfx modify window 1 set fast_transparency # # The following reordering of graphics used to be necessary because each # group had its own graphics (groups appeared as pseudo regions). # They would still be necessary if we updated this example to put each # layer in a separate region. if (0) { # In this mode, the surfaces drawn first obscure any surfaces under them, so you # have to draw your objects from back to front/inside to outside to get the # expected view. # By default, graphics are drawn in the order the regions appear in their # parent. Hence, it is necessary to order the regions from inside to out: # gfx set order region heart before torso; gfx set order region llung before torso; gfx set order region rlung before torso; gfx set order region muscle before torso; gfx set order region fat before torso; } # # We now have the view we want. Next open the scene editor to list the # graphics for the model. gfx edit scene # # The scene editor lists all the graphics for the groups we have read in, # and we can select modify/remove and add graphics. Since we are looking at 2-D # boundary element meshes, there are fewer ways to view them than with 3-D # meshes. However, this example is good for demonstrating visibility of layers # and controlling discretization/tessellation. # # Hide the 'fat' layer by unchecking the visibility toggle left of its graphics. # Fo the same with group 'muscle'. Visibility changes always take effect immediately. # # Now select any surface or line graphic and open the tessellation editor using # the Edit... button next to the tessellation chooser. Change the refinement # factors to 1 (the minimum). Enter then click "apply" to see the changes in # all the graphics using them. Increase the number to 12 to see higher quality # graphics. If you choose a higher number there is an increasing delay before # the graphics update, and rendering slows. Be careful not to enter a very # large number as it applies in all 3 directions in 3-D elements! # # MAYA is a powerful rendering program produced by ALIAS/Wavefront, a division of # Silicon Graphics. It has numerous rendering features unavailable in CMGUI such # as raytracing and much greater control over lighting and material properties. # All the MAYA manuals are online (choose help when MAYA is running) and I (Shane) # can provide some help and have a hard copy of the manuals. # To export to MAYA we will write the volumes and surfaces to OBJ files. # By default 'gfx export wavefront' exports all the visible objects (which it can) # from the default scene, each graphics object is listed in its own file. Other # parameters allow you to export just a specific graphics_object by name, change # the scene or override the default filename. gfx export wavefront # # Many errors report the inability of the export wavefront routine to write the # line graphics objects, however in the directory you started a whole series of # .obj files are created. These ascii files describe the surfaces of the torso. # To load them into MAYA, start maya and then choose File->Import. You can then # change to the directory where the *.obj files were written and load them in # one by one. To change your viewpoint in a MAYA window you drag the mouse while # holding down the ALT key. To change the materials for the different surfaces # choose Window->Multilister, you should see spheres representing each surface # material. Double click to edit the material, within this dialog double click # a colour patch to edit it. To render your window, make sure Rendering is # your option on the chooser top left just below the menu bar, then the Render menu # is available on the top right. Choose Render->Render_globals. This dialog # controls your resolution and whether you raytrace or not (raytracing is off by # default). To actually do a render choose Render->Render_into_New_Window. #Set the command prompt to 'gfx' for entering further commands. gfx # #----------
Name Modified Size
example_a5.com 20-Apr-2012 8.1k COPYRIGHT 19-Apr-2012 504 body.exnode 20-Apr-2012 297k body_fat.exelem 20-Apr-2012 150k body_heart.exelem 20-Apr-2012 20k body_llung.exelem 20-Apr-2012 47k body_muscle.exelem 20-Apr-2012 150k body_rlung.exelem 20-Apr-2012 47k body_torso.exelem 20-Apr-2012 150k default.obj 20-Apr-2012 211 default.sdf 20-Apr-2012 644 default_axes.obj 20-Apr-2012 78 default_fat_0002_surfaces.obj 20-Apr-2012 606k default_fat_2.obj 20-Apr-2012 225k default_heart_0002_surfaces.obj 20-Apr-2012 65k default_heart_2.obj 20-Apr-2012 23k default_llung_0002_surfaces.obj 20-Apr-2012 178k default_llung_2.obj 20-Apr-2012 64k default_muscle_0002_surfaces.obj 20-Apr-2012 605k default_muscle_2.obj 20-Apr-2012 224k default_rlung_0002_surfaces.obj 20-Apr-2012 180k default_rlung_2.obj 20-Apr-2012 65k default_torso_0002_surfaces.obj 20-Apr-2012 608k default_torso_2.obj 20-Apr-2012 226k
Name Modified Size
examples_a_backup_a5.tar.gz 12-Aug-2014 1.6M
Status | Tested | Real time (s) | |
i686-linux | |||
cmgui-wx | Success | Sun Mar 6 00:11:58 2016 | 2 |
cmgui-wx-debug | Success | Sun Mar 6 00:16:26 2016 | 2 |
cmgui-wx-debug-memorycheck | Success | Sun Mar 6 00:16:19 2016 | 4 |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 01:19:40 2016 | 74 |
last break | Sun Mar 6 01:18:00 2016 | 74 | |
last success | Tue Feb 10 01:12:00 2015 | 80 | |
x86_64-linux | |||
cmgui-wx | Failure | Sun Mar 6 00:01:35 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:05:00 2015 | 1 | |
cmgui-wx-debug | Failure | Sun Mar 6 00:01:35 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:04:00 2015 | 1 | |
cmgui-wx-debug-memorycheck | Failure | Sun Mar 6 00:01:35 2016 | 0 |
last break | Sun Mar 6 00:01:00 2016 | 0 | |
last success | Wed Jun 3 00:05:00 2015 | 1 | |
cmgui-wx-debug-valgrind | Failure | Sun Mar 6 00:02:28 2016 | 10 |
last break | Sun Mar 6 00:02:00 2016 | 10 | |
last success | Wed Jun 3 00:41:00 2015 | 51 | |
cmgui-wx-gcc-cad-debug-valgrind | Success | Thu Jan 7 00:02:31 2016 | 7 |
x86_64-linux | |||
139 | cmgui-wx: | error exit status 139. | |
139 | cmgui-wx-debug: | error exit status 139. | |
139 | cmgui-wx-debug-memorycheck: | error exit status 139. | |
139 | cmgui-wx-debug-valgrind: | error exit status 139. |
i686-linux | |||
Success | cmgui-wx: | diff test: no differences with generic answer. | |
Success | cmgui-wx-debug: | diff test: no differences with generic answer. | |
Success | cmgui-wx-debug-memorycheck: | diff test: no differences with generic answer. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. | |
x86_64-linux | |||
Failure | cmgui-wx: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-memorycheck: | diff test: differences with generic answer; Test output. | |
Failure | cmgui-wx-debug-valgrind: | diff test: differences with generic answer; Test output. |
Html last generated: Sun Mar 6 05:50:50 2016
Input last modified: Wed May 23 10:44:30 2012