Ejemplo n.º 1
0
  static Drawing drawBuilding3D() {
    Drawing d = new Drawing();
    d.setLineWidth(2);
    d.moveTo(0, 0, 0);
    d.setCheckIntersection(true);
    d.setFaceColor(Color.GRAY);
    Shape wall = d.rectangleXZ(30, 15);
    d.moveTo(0.3, 0, 0.3);
    Shape plate = d.rectangleXZ(30 - 0.4, 15 - 0.4);
    d.setFaceColor(Color.YELLOW);
    wall = d.extrude(wall, 3);
    d.setFaceColor(Color.CYAN);
    for (int i = 0; i < 10; i++) {
      d.moveTo(0.5 + i * 3, 0.8, 0);
      Shape window = d.box(1, 1.5, 0.2);
      d.delete(window);
      d.moveTo(0.5 + i * 3, 0.8, 15);
      window = d.box(1, 1.5, 0.2);
      d.delete(window);
    }
    d.array(wall, 10, 0, 3, 0);
    d.array(plate, 11, 0, 3, 0);
    d.moveTo(-20, 0, -20);
    d.setFaceColor(Color.GREEN);
    d.box(70, -30, 60);

    d.save("building.brep");
    return d;
  }
Ejemplo n.º 2
0
  static Drawing drawTest() {
    Drawing d = new Drawing();
    d.setFaceColor(Color.YELLOW);
    //		d.setTransparency(0.9);
    d.moveTo(0, 0, 0);
    d.line(2, 0, 0);
    d.line(0, 0, 2);
    d.line(-2, 0, 0);
    Shape rect = d.close();

    d.moveTo(0.2, 0, 0.2);
    d.line(1.6, 0, 0);
    d.line(0, 0, 1.6);
    d.line(-1.6, 0, 0);
    Shape intern = d.close();
    d.delete(intern);

    Shape fig = d.extrude(rect, 2);
    d.save("test.brep");

    d.setMeshSize(fig, 0.1);
    d.setMeshSize(fig, 2, 0, 0, 0.01);
    fig.setMeshSize(0, 0.5, 0, 50);

    return d;
  }
Ejemplo n.º 3
0
  static Drawing draw() {
    Drawing d = new Drawing();
    d.setCheckIntersection(false);
    Shape box = d.box(1, 1, 1);
    box = d.fillet(box, 0.2);
    d.moveTo(0.5, 0, 0.5);
    Shape cone = d.cone(0.2, 0.3, 1, Math.PI * 2);
    Shape fig = d.cut(box, cone);
    d.delete(cone);

    return d;
  }
Ejemplo n.º 4
0
  static Drawing drawBuilding() {
    Drawing d = new Drawing();
    d.setLineWidth(2);
    d.moveTo(0, 0, 0);
    d.setCheckIntersection(true);
    d.setFaceColor(Color.GRAY);
    Shape plate = d.rectangleXZ(30, 15);
    Shape wall = d.getEdges(plate);
    d.setFaceColor(Color.DARK_GRAY);
    Shape base = d.extrude(wall, -1.5);
    d.copy(plate, 0, -1.5, 0);
    d.setFaceColor(Color.YELLOW);
    wall = d.getEdges(plate);
    wall = d.extrude(wall, 3);
    d.setFaceColor(Color.CYAN);
    for (int i = 0; i < 10; i++) {
      d.moveTo(0.5 + i * 3, 0.8, 0);
      Shape window = d.rectangleXY(1, 1.7);
      d.delete(window);
      d.moveTo(0.5 + i * 3, 0.8, 15);
      window = d.rectangleXY(1, 1.7);
      d.delete(window);
    }
    d.setCheckIntersection(false);
    d.array(wall, 10, 0, 3, 0);
    d.array(plate, 11, 0, 3, 0);
    d.setCheckIntersection(true);

    d.moveTo(-20, 0, -20);
    d.setFaceColor(Color.GREEN);
    d.box(70, -30, 60);
    Shape excavation = d.extrude(plate, -1.5);
    d.delete(excavation);

    //	    d.delete(plate);

    d.save("building.brep");
    return d;
  }
Ejemplo n.º 5
0
  static Drawing drawWall() {
    Drawing d = new Drawing();

    d.setCheckIntersection(false);
    d.setFaceColor(Color.WHITE);
    d.setTransparency(0);
    d.moveTo(-0.4, 0, -0.4);
    Shape base = d.box(0.8, 0.2, 0.8);
    d.moveTo(0, 0.2, 0);
    Shape col = d.cone(0.3, 0.2, 3.8, Math.PI * 2);
    d.moveTo(0, 4, 0);
    Shape capitel1 = d.cone(0.2, 0.3, 0.2, Math.PI * 2);
    d.move(0, 0.2, 0);
    Shape capitel2 = d.cylinder(0.35, 0.15, Math.PI * 2);
    Shape column = d.fuse(base, col);
    column = d.fuse(column, capitel1);
    column = d.fuse(column, capitel2);
    d.moveTo(-1, 0, 0);
    Shape cutBox = d.box(5, 6, 1);
    column = d.cut(column, cutBox);
    d.delete(cutBox);
    Shape columns = d.array(column, 6, 2, 0, 0);
    d.moveTo(-0.4, 4.35, -0.4);
    Shape beam = d.box(5 * 2 + 0.8, 0.3, 0.4);

    d.moveTo(-0.4, 0, 0);
    d.setFaceColor(Color.GREEN);
    Shape wall = d.box(5 * 2 + 0.8, 4.65, 0.5);

    wall = d.fuse(wall, beam);
    d.fuse(columns, wall);

    d.setDirection(0, 0, 1);
    d.moveTo(1, 3, 0);
    Shape arch = d.cylinder(0.5, 0.5, Math.PI * 2);
    d.move(-0.5, 0, 0);
    Shape door = d.box(1, -3, 0.5);
    door = d.fuse(door, arch);
    wall = d.cut(wall, door);
    door = d.copy(door, 2, 0, 0);
    wall = d.cut(wall, door);
    door = d.copy(door, 2, 0, 0);
    wall = d.cut(wall, door);
    door = d.copy(door, 2, 0, 0);
    wall = d.cut(wall, door);
    door = d.copy(door, 2, 0, 0);
    wall = d.cut(wall, door);

    d.save("columns.brep");
    return d;
  }