public static Path RoundedRectangle(float width, float height, float r, int segs = 1, bool grounded = false) { AXTurtle t = new AXTurtle(); t.mov(-width / 2 + r, -height / 2 + r); t.dir(0); t.fwd(width - 2 * r); t.arcl(90, r, segs); t.fwd(height - 2 * r); t.arcl(90, r, segs); t.fwd(width - 2 * r); t.arcl(90, r, segs); t.fwd(height - 2 * r); t.arcl(90, r, segs); return(t.getPath()); }
public static Path Rectangle(float width, float height, bool isCentered = true) { AXTurtle t = new AXTurtle(); if (isCentered) { t.mov(-width / 2, -height / 2); } else { t.mov(0, 0); } t.dir(90); t.right(width); t.fwd(height); t.left(width); return(t.getPath()); }