1
0
Fork 0

constructions: Added Point.sitsRoughlyOn example

This commit is contained in:
Joost De Cock 2019-01-27 19:34:50 +01:00
parent bfe8dd55a2
commit 63fc1e2f66
7 changed files with 24 additions and 15 deletions

View file

@ -0,0 +1,20 @@
import { box } from "./shared";
export default part => {
// prettier-ignore
let {Point, points, Snippet, snippets, macro} = part.shorthand();
box(part);
let s;
for (let i = 0; i < 10; i++) {
points[`a${i}`] = new Point(i * 10, 40);
points[`b${i}`] = new Point(i * 10, i * 8);
if (points[`a${i}`].sitsRoughlyOn(points[`b${i}`])) s = "notch";
else s = "x";
snippets[`b${i}`] = new Snippet(s, points[`b${i}`]);
snippets[`a${i}`] = new Snippet(s, points[`a${i}`]);
}
return part;
};