NewRail Logo
Newcastle University logo
Home Research Teaching Joy Welch E.C.T.
Home
Research
Teaching
Joy Welch E.C.T.
 
Research Websites:
Newcastle University
NewRail
Design, Manufacture & Materials
 
Personal Websites:
Alina Meridon
Crazy Wormhole

RegionReader

RegionReader is an application which displays and rotates a set of 3D polyhedra. It is written in Java and uses Java's OpenGL interface JOGL for the rendering, and works either as a Mac OS X application or as an applet. The Mac OS X application gives you the option to save the polyhedra in Initial Graphics Exchange Specification (IGES) 5.3 format, which can then be imported into ANSYS.

The main purpose of the application (although you need to edit the source to do this since the user interface is primitive) is to be able to crop or intersect the set of polyhedra at given planes.

1000 polyhedra viewed in RegionReader Screenshot of ANSYS showing polyhedra meshed Periodic unit cube with 10 polyhedra

1000 polyhedra in a semi-regular cubic lattice, viewed in RegionReader. (Background in RegionReader is usually black.)

100 polyhedra exported in IGES format, imported into ANSYS and meshed.

10 polyhedra (in a periodic arrangement [1]) cropped on 6 planes to make a periodic 'unit cube'.

Download

RegionReader is Copyright 2008 The University of Newcastle upon Tyne and is available as free software under the GNU General Public License (GPL), Version 3. See COPYRIGHT.txt or http://www.gnu.org/licenses/ for details.

Applet

The applet works on Mac OS X 10.4 and 10.5 in Safari, Firefox and Opera, although sometimes Opera gets confused while loading the JOGL resources from Sun's website. It also works fine on Microsoft Windows Internet Explorer, but - Warning! - the applet may ask you to allow it to disable DirectDraw since this conflicts with OpenGL. I don't think this is a problem, but decide for yourself...

Click here to see the applet in action. (Warning: Don't do this on an old computer!)

Technical Details

The applet uses JNLPAppletLauncher to load the various resources from the web, while the actual RegionReader applet code is in the file "RegionReader.jar". The address of this file needs to be given in the applet's archive attribute:

   <applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
       width="512"
       height="512"
       archive="http://download.java.net/media/applet-launcher/applet-launcher.jar,
		http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
		http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
		http://www.staff.ncl.ac.uk/f.j.franklin/JoyWelch/RegionReader.jar">
    

The RegionReader applet has two parameters:

RegionReader.xml_data_uri
The web address of the XML data file defining the set of polyhedra.
RegionReader.transparency
Switch to turn on (true) or off (false) transparency.

In the linked example above, these parameters are set as:

    <param name="RegionReader.xml_data_uri" value="http://www.staff.ncl.ac.uk/f.j.franklin/JoyWelch/ani.xml" /> 
    <param name="RegionReader.transparency" value="true" />
    

Format of input data

The input file is XML with the following format. (There is no DTD, Schema or namespace for this at the moment.)

<?xml version="1.0" encoding="ISO-8859-1"?>
<Voronoi-set>
 <Points count="100">
  <point id="p1300" x="0.2275817460717718" y="-0.0157841897961757" z="0.4432684323083291" />
  <point id="p1301" ...

There is one point per region, so the number of points (in <Points count="...">) should equal the number of regions (see below). Each point should have a unique "id" attribute starting with a lowercase 'p' followed immediately by a unique non-negative integer. The x, y and z attributes give the coordinate of the point.

 </Points>
 <Vertices count ="17580">
  <Vertex id="277" x="-0.2229230710986291" y="0.0627432962685409" z="0.4655647302512809" internal="yes"/>
  <Vertex id="291" ...

All vertices must be listed (and the total number of vertices given in <Vertices count ="...">). Each vertex should have a unique "id" attribute which should be a unique strictly positive integer. The x, y and z attributes give the coordinate of the vertex. The attribute "internal" is currently ignored and should be given the value "yes".

 </Vertices>
 <Regions count="100">
  <Region point="p1300" vertices="32" facets="18" internal="yes">
   <Facet vertices="5">10148	10147	10141	10145	10146	</Facet>
   <Facet vertices="5">10147 ...

The total number of regions (in <Regions count="...">) should equal the total number of points (see above).

Each region corresponds to a point, and the unique "id" attribute of the point should be stated in the "point" attribute of the Region element (<Region point="..." ...). The total number of vertices and facets in the region should be stated in the "vertices" and "facets" attributes respectively. The "internal" attribute is currently ignored and should be given the value "yes".

Within each region are a number of facets. The number of vertices in each facet should be stated in the "vertices" attribute. The vertices are then listed in clockwise order (looking from outside the region) as a list (in the character data) of integers corresponding to the unique "id" attribute of each vertex defined previously.

  </Region>
 </Regions>
</Voronoi-set>

A C++ program, facetfile.cpp, is included with the RegionReader source distribution. This uses Qhull [2] to generate a periodic set [1] of Voronoi polyhedra and saves in this XML format. The file ani.xml, used by the linked applet example above, was generated by facetfile.

References

[1] Nygårds, M. and Gudmundson, P. "Three-dimensional periodic Voronoi grain models and micromechanical FE-simulations of a two-phase steel", Computational Materials Science, 24, 513-519 (2002).

[2] Barber, C. B., Dobkin, D. P., and Huhdanpaa, H. T. "The Quickhull algorithm for convex hulls", ACM Trans. on Mathematical Software, 22(4):469-483 (1996) http://www.qhull.org/.

RegionReader is Copyright 2008 The University of Newcastle upon Tyne and is available as free software under the GNU General Public License (GPL), Version 3. See COPYRIGHT.txt or http://www.gnu.org/licenses/ for details.

RegionReader was developed by Francis J. Franklin of the University of Newcastle upon Tyne, U.K., and Anirudh Gahlot of Amity University, India, during June-August 2008 for a project funded by the Joy Welch Educational Charitable Trust.

Copyright © 2008-2010 Dr Francis J. Franklin

NewRail, School of Mechanical & Systems Engineering, Newcastle University, Newcastle upon Tyne, NE1 7RU, United Kingdom