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

21 lines
586 B
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { box } from './shared'
2019-05-20 16:25:55 +02:00
2021-01-31 09:22:15 +01:00
export default (part) => {
2019-08-03 15:03:33 +02:00
let { Point, points, paths, Path } = part.shorthand()
2019-05-20 16:25:55 +02:00
2019-08-03 15:03:33 +02:00
points.origin = new Point(10, 10)
points.x = new Point(100, 10)
points.y = new Point(10, 50)
points.textX = points.x.shift(135, 2).attr('data-text', 'X')
points.textY = points.y.shift(180, 5).attr('data-text', 'Y')
2019-05-20 16:25:55 +02:00
paths.coords = new Path()
.move(points.y)
.line(points.origin)
.line(points.x)
2019-08-03 15:03:33 +02:00
.attr('class', 'mark')
.attr('marker-start', 'url(#dimensionFrom)')
.attr('marker-end', 'url(#dimensionTo)')
2019-05-20 16:25:55 +02:00
2019-08-03 15:03:33 +02:00
return box(part, 100, 50)
}