2019-01-27 12:54:18 +01:00
|
|
|
export default part => {
|
|
|
|
let {
|
|
|
|
Point,
|
|
|
|
points,
|
|
|
|
Path,
|
|
|
|
paths,
|
|
|
|
Snippet,
|
|
|
|
snippets,
|
|
|
|
utils
|
|
|
|
} = part.shorthand();
|
|
|
|
|
|
|
|
points.start = new Point(10, 10);
|
|
|
|
points.cp1 = new Point(90, 10);
|
|
|
|
points.cp2 = new Point(10, 60);
|
|
|
|
points.end = new Point(90, 60);
|
|
|
|
|
|
|
|
let scatter = [];
|
|
|
|
for (let i = 1; i < 19; i++) {
|
|
|
|
for (let j = 1; j < 14; j++) {
|
2019-05-25 11:11:46 +02:00
|
|
|
scatter.push(new Point(i * 10, j * 10));
|
2019-01-27 12:54:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
let snippet;
|
|
|
|
for (let point of scatter) {
|
|
|
|
if (
|
|
|
|
utils.pointOnCurve(
|
|
|
|
points.start,
|
|
|
|
points.cp1,
|
|
|
|
points.cp2,
|
|
|
|
points.end,
|
|
|
|
point
|
|
|
|
)
|
2019-01-30 14:21:59 +01:00
|
|
|
) {
|
2019-01-27 12:54:18 +01:00
|
|
|
snippet = "notch";
|
2019-05-25 11:11:46 +02:00
|
|
|
} else snippet = "bnotch";
|
2019-01-27 12:54:18 +01:00
|
|
|
snippets[part.getId()] = new Snippet(snippet, point);
|
|
|
|
}
|
|
|
|
paths.curve = new Path()
|
|
|
|
.move(points.start)
|
|
|
|
.curve(points.cp1, points.cp2, points.end)
|
|
|
|
.attr("class", "fabric stroke-lg");
|
|
|
|
|
|
|
|
return part;
|
|
|
|
};
|