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

16 lines
459 B
JavaScript
Raw Normal View History

2021-01-31 09:22:15 +01:00
export default (part) => {
2019-08-03 15:03:33 +02:00
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
points.A = new Point(10, 10)
points.B = new Point(50, 40)
points.C = new Point(15, 30)
points.D = new Point(60, 15)
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
paths.AB = new Path().move(points.A).line(points.B)
paths.CD = new Path().move(points.C).line(points.D)
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
snippets.X = new Snippet('notch', utils.linesIntersect(points.A, points.B, points.C, points.D))
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
return part
}