1
0
Fork 0

sparkles: Cleaned up examples a bit

This commit is contained in:
Joost De Cock 2019-01-30 14:21:59 +01:00
parent c228184d20
commit 7877a1fa4a
30 changed files with 563 additions and 409 deletions

View file

@ -0,0 +1,3 @@
module.exports = {
extends: "standard"
};

File diff suppressed because it is too large Load diff

View file

@ -63,9 +63,14 @@
"babel-eslint": "^8.2.6",
"babel-loader": "8.0.0-beta.6",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"eslint": "5.3.0",
"eslint": "5.12.1",
"eslint-config-prettier": "2.10.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-node": "8.0.1",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-standard": "4.0.0",
"husky": "^0.14.3",
"lint-staged": "7.2.2",
"prettier": "1.14.0",

View file

@ -28,8 +28,9 @@ export default part => {
.curve(points._BCp2, points._CCp1, points._C)
.curve(points._DCp1, points._DCp1, points._D);
for (let p of paths.demo1.intersects(paths.demo2))
for (let p of paths.demo1.intersects(paths.demo2)) {
snippets[part.getId()] = new Snippet("x", p);
}
return part;
};

View file

@ -23,8 +23,9 @@ export default part => {
.curve(points.BCp2, points.CCp1, points.C)
.curve(points.DCp1, points.DCp1, points.D);
for (let p of paths.demo.intersectsX(60))
for (let p of paths.demo.intersectsX(60)) {
snippets[part.getId()] = new Snippet("x", p);
}
return part;
};

View file

@ -22,8 +22,9 @@ export default part => {
.line(points.B)
.curve(points.BCp2, points.CCp1, points.C)
.curve(points.DCp1, points.DCp1, points.D);
for (let p of paths.demo.intersectsY(58))
for (let p of paths.demo.intersectsY(58)) {
snippets[part.getId()] = new Snippet("x", p);
}
return part;
};

View file

@ -1,6 +1,6 @@
export default part => {
// prettier-ignore
let {Point, points, Path, paths, Snippet, snippets} = part.shorthand();
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand()
points.A = new Point(45, 60);
points.B = new Point(10, 30);

View file

@ -1,13 +1,5 @@
export default part => {
let {
Point,
points,
Path,
paths,
Snippet,
snippets,
macro
} = part.shorthand();
let { Point, points, Path, paths, Snippet, snippets } = part.shorthand();
points.A = new Point(45, 60);
points.B = new Point(10, 30);

View file

@ -1,13 +1,5 @@
export default part => {
let {
Point,
points,
Path,
paths,
Snippet,
snippets,
macro
} = part.shorthand();
let { Point, points, Path, paths, macro } = part.shorthand();
points.A = new Point(45, 60);
points.B = new Point(10, 30);

View file

@ -1,13 +1,5 @@
export default part => {
let {
Point,
points,
Path,
paths,
Snippet,
snippets,
macro
} = part.shorthand();
let { Point, points, Path, paths } = part.shorthand();
points.center = new Point(0, 0);
points.base = new Point(0, 10);

View file

@ -1,5 +1,5 @@
export default part => {
let { Point, points, Path, paths, macro } = part.shorthand();
let { Point, points, macro } = part.shorthand();
points.anchor = new Point(0, 0);

View file

@ -1,7 +1,7 @@
import { box } from "./shared";
export default part => {
let { Point, points, Snippet, snippets } = part.shorthand();
let { Point, points } = part.shorthand();
points.anchor = new Point(50, 25)
.attr("data-text", "msg")

View file

@ -1,13 +1,5 @@
export default part => {
let {
Point,
points,
Path,
paths,
Snippet,
snippets,
macro
} = part.shorthand();
let { Point, points, Path, paths } = part.shorthand();
points.top = new Point(50, 10);
points.out1 = new Point(70, 30);

View file

@ -1,13 +1,5 @@
export default part => {
let {
Point,
points,
Path,
paths,
Snippet,
snippets,
macro
} = part.shorthand();
let { Point, points, Path, paths } = part.shorthand();
points.start = new Point(0, 50);
points.churchTowerWallLeft = new Point(10, 50);

View file

@ -4,7 +4,6 @@ export default part => {
points.sun = new Point(40, 40);
snippets.sun = new Snippet("notch", points.sun);
points.moon = new Point(70, 40);
let angle = 0;
let step = 360 / 36;
for (let i = 1; i < 37; i++) {
let angle = step * i;

View file

@ -1,8 +1,7 @@
import { box } from "./shared";
export default part => {
// prettier-ignore
let {Point, points, Snippet, snippets, macro} = part.shorthand();
let { Point, points, Snippet, snippets } = part.shorthand();
let s;
for (let i = 0; i < 10; i++) {

View file

@ -1,8 +1,7 @@
import { box } from "./shared";
export default part => {
// prettier-ignore
let {Point, points, Snippet, snippets, macro} = part.shorthand();
let { Point, points, Snippet, snippets } = part.shorthand();
box(part);

View file

@ -1,6 +1,6 @@
export default part => {
// prettier-ignore
let {Point, points, Path, paths, Snippet, snippets, macro} = part.shorthand();
let { Point, points, Path, paths } = part.shorthand()
points.A = new Point(45, 60);
points.B = new Point(10, 30);

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,14 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,
paths,
Snippet,
snippets,
utils
} = part.shorthand();
let { Point, points, Snippet, snippets, utils } = part.shorthand();
points.A = new Point(10, 10)
.attr("data-circle", 15)

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,
@ -35,8 +34,9 @@ export default part => {
points.Ccp,
points.Dcp,
points.D
))
)) {
snippets[part.getId()] = new Snippet("x", p);
}
return part;
};

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,
@ -21,15 +20,16 @@ export default part => {
.curve(points.Acp, points.Bcp, points.B);
paths.line = new Path().move(points.E).line(points.D);
for (let p of freesewing.utils.lineIntersectsCurve(
for (let p of utils.lineIntersectsCurve(
points.D,
points.E,
points.A,
points.Acp,
points.Bcp,
points.B
))
)) {
snippets[part.getId()] = new Snippet("x", p);
}
return part;
};

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,
@ -28,9 +27,9 @@ export default part => {
if (utils.pointOnBeam(points.from1, points.to1, point)) snippet = "notch";
else snippet = "x";
snippets[part.getId()] = new Snippet(snippet, point);
if (utils.pointOnBeam(points.from2, points.to2, point, 0.01))
if (utils.pointOnBeam(points.from2, points.to2, point, 0.01)) {
snippet = "notch";
else snippet = "x";
} else snippet = "x";
snippets[part.getId()] = new Snippet(snippet, point);
}
paths.line1 = new Path()

View file

@ -1,6 +1,5 @@
export default part => {
let {
debug,
Point,
points,
Path,
@ -31,9 +30,9 @@ export default part => {
points.end,
point
)
)
) {
snippet = "notch";
else snippet = "x";
} else snippet = "x";
snippets[part.getId()] = new Snippet(snippet, point);
}
paths.curve = new Path()

View file

@ -1,6 +1,6 @@
export default part => {
// prettier-ignore
let {debug, Point, points, Path, paths, Snippet, snippets, utils} = part.shorthand();
let { Point, points, Path, paths, Snippet, snippets, utils } = part.shorthand()
points.from1 = new Point(10, 10);
points.to1 = new Point(90, 60);
@ -20,9 +20,9 @@ export default part => {
if (utils.pointOnLine(points.from1, points.to1, point)) snippet = "notch";
else snippet = "x";
snippets[part.getId()] = new Snippet(snippet, point);
if (utils.pointOnLine(points.from2, points.to2, point, 0.01))
if (utils.pointOnLine(points.from2, points.to2, point, 0.01)) {
snippet = "notch";
else snippet = "x";
} else snippet = "x";
snippets[part.getId()] = new Snippet(snippet, point);
}
paths.line1 = new Path()