Exemple #1
0
 private void writeBeams(PrintStream out, AmibeReader.SubMesh subMesh, int count)
     throws IOException {
   if (subMesh.getNumberOfBeams() > 0) {
     IntFileReader beams = subMesh.getBeams();
     long nb = beams.size() / 2;
     for (int i = 0; i < nb; i++) {
       out.println(
           FORMAT_I10.format(count) + "        21         2         1         5         2");
       out.println("         0         1         1");
       out.println(FORMAT_I10.format(beams.get() + 1) + FORMAT_I10.format(beams.get() + 1));
       count++;
     }
   }
 }
Exemple #2
0
 /**
  * @param out
  * @throws IOException
  */
 private int writeTriangles(PrintStream out, AmibeReader.SubMesh subMesh) throws IOException {
   int count = 1;
   if (subMesh.getNumberOfTrias() > 0) {
     IntFileReader trias = subMesh.getTriangles();
     long nb = trias.size() / 3;
     for (int i = 0; i < nb; i++) {
       int n1 = trias.get();
       int n2 = trias.get();
       int n3 = trias.get();
       if (n1 >= 0) MeshExporter.UNV.writeSingleTriangle(out, count, n1 + 1, n2 + 1, n3 + 1);
       count++;
     }
   }
   logger.log(Level.INFO, "Total number of triangles: {0}", count - 1);
   return count;
 }
Exemple #3
0
  /**
   * @param out
   * @param count id of the first beam
   * @throws IOException
   */
  private void writeGroups(PrintStream out, AmibeReader.SubMesh subMesh, int count)
      throws SAXException, IOException {
    out.println("    -1" + CR + "  2435");
    int i = 0;
    for (Group g : subMesh.getGroups()) {
      out.println(
          FORMAT_I10.format(i + 1)
              + "         0         0         0         0         0         0"
              + FORMAT_I10.format(g.getNumberOfTrias() + g.getNumberOfBeams()));

      out.println(g.getName());
      int countg = 0;
      for (int id : g.readTria3Ids()) {
        out.print("         8" + FORMAT_I10.format(id + 1) + "         0         0");
        countg++;
        if ((countg % 2) == 0) out.println();
      }
      for (int id : g.readBeamsIds()) {
        out.print("         8" + FORMAT_I10.format(id + count) + "         0         0");
        countg++;
        if ((countg % 2) == 0) out.println();
      }
      if ((countg % 2) != 0) out.println();
      i++;
    }
    out.println("    -1");
  }