constructions: Added Point.sitsRoughlyOn example
This commit is contained in:
parent
bfe8dd55a2
commit
63fc1e2f66
7 changed files with 24 additions and 15 deletions
20
packages/examples/src/point_sitsroughlyon.js
Normal file
20
packages/examples/src/point_sitsroughlyon.js
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue