1
0
Fork 0
freesewing/packages/examples/src/point_sitson.js

18 lines
475 B
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { box } from './shared'
2019-01-27 12:54:18 +01:00
2021-01-31 09:22:15 +01:00
export default (part) => {
2019-08-03 15:03:33 +02:00
let { Point, points, Snippet, snippets } = part.shorthand()
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
let s
2019-01-27 12:54:18 +01:00
for (let i = 0; i < 10; i++) {
2019-08-03 15:03:33 +02:00
points[`a${i}`] = new Point(i * 10, 40)
points[`b${i}`] = new Point(i * 10, i * 8)
if (points[`a${i}`].sitsOn(points[`b${i}`])) s = 'notch'
else s = 'bnotch'
snippets[`b${i}`] = new Snippet(s, points[`b${i}`])
snippets[`a${i}`] = new Snippet(s, points[`a${i}`])
2019-01-27 12:54:18 +01:00
}
2019-08-03 15:03:33 +02:00
return box(part)
}