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; }
static Drawing drawFigure() { Drawing d = new Drawing(); d.setCheckIntersection(true); d.setLineWidth(2); d.setFaceColor(Color.CYAN); d.moveTo(0, 0, 0); d.line(1, 0, 0); d.line(0, 0, 1); d.line(-1, 0, 0); Shape rect = d.close(); d.setFaceColor(Color.YELLOW); d.move(0.2, 0, 0.2); d.line(0.6, 0, 0); d.line(0, 0, 0.6); d.line(-0.6, 0, 0); Shape rect1 = d.close(); d.moveTo(0, 0, 2); d.setDirection(0, 1, 0); Shape s = d.extrude(rect, 0.5); // d.fillet(s); // d.setDirection(1, 0, 0); // Shape shape = d.revolve(rect, Math.PI/4); //// d.setCheckIntersection(false); // d.setVirtualDrawingMode(true); // d.moveTo(0, 1, 0.6); // Shape circle = d.circle(0.15); // Shape cylinder = d.extrude(circle, 1); // d.setVirtualDrawingMode(false); // // //// d.add(cylinder); // shape = d.cut(shape, cylinder); // // d.moveTo(0,0,0); // d.setDirection(-1, 0, 0); // Shape rev = d.revolve(rect1, Math.PI); // d.delete(rev); // d.delete(d.getCommon()); // // //// d.setCheckIntersection(false); //// int n = 10; //// double dist = 2; //// Shape line = d.array(shape, n, dist, 0, 0); //// Shape area = d.array(line, n, 0, dist, 0); //// Shape cube = d.array(area, n, 0, 0, dist); //// //// d.setCheckIntersection(true); // //// d.copy(shape, 2,0,0); // //// Shape shape1 = d.copy(shape, 2, 0, 0); //// //// shape1 = d.scale(shape1, 0.5); //// //// d.moveTo(2, 0, 0); //// d.setDirection(0, 0, 1); //// shape1 = d.rotate(shape1, Math.PI/4); //// // //// rect1.setSelected(true); ////// d.save("figure.brep"); ////// d.explode(shape); return d; }