mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-15 01:18:26 -05:00
36 lines
802 B
HTML
36 lines
802 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
|
|
<title>RoughJS Polygon</title>
|
|
</head>
|
|
|
|
<body>
|
|
<svg width="800" height="800"></svg>
|
|
|
|
<script type="module">
|
|
import rough from '../../../bin/rough.js';
|
|
const svg = document.querySelector('svg');
|
|
const rc = rough.svg(svg, {
|
|
options: {
|
|
strokeLineDash: [15, 5],
|
|
strokeLineDashOffset: 10
|
|
}
|
|
});
|
|
|
|
svg.appendChild(rc.polygon([
|
|
[10, 10],
|
|
[200, 10],
|
|
[100, 100],
|
|
[100, 50],
|
|
[300, 100],
|
|
[60, 200]
|
|
], { stroke: 'black', strokeWidth: 2, fill: 'red', hachureAngle: 90, fillLineDash: [15, 5], fillLineDashOffset: 10 }));
|
|
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |