### Drawing Lines and Ellipses with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Demonstrates drawing a circle, an ellipse, and a line using the Rough.js drawing context. Shows the parameters for each primitive. ```js rc.circle(80, 120, 50); // centerX, centerY, diameter rc.ellipse(300, 100, 150, 80); // centerX, centerY, width, height rc.line(80, 120, 300, 100); // x1, y1, x2, y2 ``` -------------------------------- ### Filling Shapes with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Illustrates various fill options for shapes, including solid fill, hachure fill with custom color, weight, angle, and gap. Shows how to apply fill styles using the options object. ```js rc.circle(50, 50, 80, { fill: 'red' }); // fill with red hachure rc.rectangle(120, 15, 80, 80, { fill: 'red' }); rc.circle(50, 150, 80, { fill: "rgb(10,150,10)", fillWeight: 3 // thicker lines for hachure }); rc.rectangle(220, 15, 80, 80, { fill: 'red', hachureAngle: 60, // angle of hachure, hachureGap: 8 }); rc.rectangle(120, 105, 80, 80, { fill: 'rgba(255,0,200,0.2)', fillStyle: 'solid' // solid fill }); ``` -------------------------------- ### Drawing SVG Paths with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Demonstrates drawing complex shapes by providing standard SVG path data strings to the `rc.path()` method. Fill options can also be applied to paths. ```js rc.path('M80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 Z', { fill: 'green' }); rc.path('M230 80 A 45 45, 0, 1, 0, 275 125 L 275 80 Z', { fill: 'purple' }); rc.path('M80 230 A 45 45, 0, 0, 1, 125 275 L 125 230 Z', { fill: 'red' }); rc.path('M230 230 A 45 45, 0, 1, 1, 275 275 L 275 230 Z', { fill: 'blue' }); ``` -------------------------------- ### Customizing Sketching Style with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Shows how to adjust the sketching appearance using options like `roughness` to control line variation, `bowing` for curvature, `stroke` for color, and `strokeWidth` for line thickness. ```js rc.rectangle(15, 15, 80, 80, { roughness: 0.5, fill: 'red' }); rc.rectangle(120, 15, 80, 80, { roughness: 2.8, fill: 'blue' }); rc.rectangle(220, 15, 80, 80, { bowing: 6, stroke: 'green', strokeWidth: 3 }); ``` -------------------------------- ### Drawing Rectangle on Canvas with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Initializes Rough.js for a Canvas element and draws a rectangle with default sketchy style. Requires a Canvas element with the ID 'canvas'. ```js const rc = rough.canvas(document.getElementById('canvas')); rc.rectangle(10, 10, 200, 200); // x, y, width, height ``` -------------------------------- ### Drawing Rectangle on SVG with Rough.js Source: https://github.com/rough-stuff/rough/blob/master/README.md Initializes Rough.js for an SVG element and draws a rectangle, appending the generated SVG node to the element. Requires an SVG element. ```js const rc = rough.svg(svg); let node = rc.rectangle(10, 10, 200, 200); // x, y, width, height svg.appendChild(node); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.