double[] point = Math2.ORIGIN_3D;
Element layersElement = geometryElement.getChild("layers");
int materialIndex;
IMaterialScatterModel material;
double thickness;
int layerIndex = 0;
for (Element layerElement : layersElement.getChildren()) {
try {
materialIndex =
layerElement.getAttribute("material").getIntValue();
thickness =
layerElement.getAttribute("thickness")
.getDoubleValue();
} catch (DataConversionException e) {
throw new IOException(e);
}
material = materials.get(materialIndex);
shape =
MultiPlaneShape
.createFilm(normal, point, thickness);
new IndexedRegion(chamber, material, shape, ++layerIndex);
// Calculate next point
point =
Math2.minus(point,
Math2.multiply(thickness, Math2.Z_AXIS));
}
// Substrate
Element substrateElement = geometryElement.getChild("substrate");
if (substrateElement != null) {
int substrateMaterialIndex;
try {
substrateMaterialIndex =
substrateElement.getAttribute("material")
.getIntValue();
} catch (DataConversionException e) {
throw new IOException(e);
}
IMaterialScatterModel substrateMaterial =
materials.get(substrateMaterialIndex);
thickness = 0.1; // 10 cm
shape = MultiPlaneShape.createFilm(normal, point, thickness);
new IndexedRegion(chamber, substrateMaterial, shape,