@thi.ng/geom-axidraw 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-12-10T14:04:38Z
3
+ - **Last updated**: 2022-12-16T12:52:25Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![geom-axidraw](https://media.thi.ng/umbrella/banners-20220914/thing-geom-axidraw.svg?97576ad9)
3
+ # ![@thi.ng/geom-axidraw](https://media.thi.ng/umbrella/banners-20220914/thing-geom-axidraw.svg?97576ad9)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/geom-axidraw.svg)](https://www.npmjs.com/package/@thi.ng/geom-axidraw)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/geom-axidraw.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -16,7 +16,7 @@ This project is part of the
16
16
  - [Draw order](#draw-order)
17
17
  - [Basic usage & examples](#basic-usage--examples)
18
18
  - [Interpolated polygons](#interpolated-polygons)
19
- - [Clipping](#clipping)
19
+ - [Clipping](#clipping)
20
20
  - [Status](#status)
21
21
  - [Related packages](#related-packages)
22
22
  - [Installation](#installation)
@@ -27,7 +27,7 @@ This project is part of the
27
27
 
28
28
  ## About
29
29
 
30
- Conversion and preparation of thi.ng/geom shapes & shape groups to AxiDraw pen plotter draw commands. This is a support package for [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom).
30
+ Conversion and preparation of thi.ng/geom shapes & shape groups to AxiDraw pen plotter draw commands
31
31
 
32
32
  This package only deals with the conversion aspects. The
33
33
  [@thi.ng/axidraw](https://github.com/thi-ng/umbrella/blob/develop/packages/axidraw)
@@ -132,30 +132,30 @@ import { asAxiDraw } from "@thi.ng/geom-axidraw";
132
132
  import { map, range } from "@thi.ng/transducers";
133
133
 
134
134
  (async () => {
135
- // create group of bezier-interpolated star polygons,
136
- // with each path using a slightly different configuration
137
- const geo = group({ translate: [100, 100] }, [
138
- ...map(
139
- (t) =>
140
- pathFromCubics(
141
- asCubic(star(90, 6, [t, 1]), {
142
- breakPoints: true,
143
- scale: 0.66,
144
- })
145
- ),
146
- range(0.3, 1.01, 0.05)
147
- ),
148
- ]);
149
-
150
- // connect to plotter
151
- const axi = new AxiDraw();
152
- await axi.connect();
153
- // convert geometry to drawing commands & send to plotter
154
- await axi.draw(asAxiDraw(geo, { samples: 40 }));
135
+ // create group of bezier-interpolated star polygons,
136
+ // with each path using a slightly different configuration
137
+ const geo = group({ translate: [100, 100] }, [
138
+ ...map(
139
+ (t) =>
140
+ pathFromCubics(
141
+ asCubic(star(90, 6, [t, 1]), {
142
+ breakPoints: true,
143
+ scale: 0.66,
144
+ })
145
+ ),
146
+ range(0.3, 1.01, 0.05)
147
+ ),
148
+ ]);
149
+
150
+ // connect to plotter
151
+ const axi = new AxiDraw();
152
+ await axi.connect();
153
+ // convert geometry to drawing commands & send to plotter
154
+ await axi.draw(asAxiDraw(geo, { samples: 40 }));
155
155
  })();
156
156
  ```
157
157
 
158
- ### Clipping
158
+ #### Clipping
159
159
 
160
160
  (Result: https://mastodon.thi.ng/@toxi/109483553358349473)
161
161
 
@@ -166,19 +166,19 @@ import { asAxiDraw } from "@thi.ng/geom-axidraw";
166
166
  import { map, range } from "@thi.ng/transducers";
167
167
 
168
168
  (async () => {
169
- const origin = [100, 100];
170
- const radius = 50;
171
- const boundary = starWithCentroid(origin, radius, 5, [1, 0.45], { __axi: { speed: 0.25 } });
172
- // group of concentric circles using boundary as clip polygon
173
- const geo = group({}, [
174
- boundary,
175
- group({ __samples: 40, __axi: { clip: vertices(boundary) } }, [
176
- ...map((r) => circle(origin, r), range(2, radius, 2)),
177
- ]),
178
- ]);
179
- const axi = new AxiDraw();
180
- await axi.connect();
181
- await axi.draw(asAxiDraw(geo));
169
+ const origin = [100, 100];
170
+ const radius = 50;
171
+ const boundary = starWithCentroid(origin, radius, 5, [1, 0.45], { __axi: { speed: 0.25 } });
172
+ // group of concentric circles using boundary as clip polygon
173
+ const geo = group({}, [
174
+ boundary,
175
+ group({ __samples: 40, __axi: { clip: vertices(boundary) } }, [
176
+ ...map((r) => circle(origin, r), range(2, radius, 2)),
177
+ ]),
178
+ ]);
179
+ const axi = new AxiDraw();
180
+ await axi.connect();
181
+ await axi.draw(asAxiDraw(geo));
182
182
  })();
183
183
  ```
184
184
 
@@ -208,11 +208,8 @@ ES module import:
208
208
 
209
209
  For Node.js REPL:
210
210
 
211
- ```text
212
- # with flag only for < v16
213
- node --experimental-repl-await
214
-
215
- > const geomAxidraw = await import("@thi.ng/geom-axidraw");
211
+ ```js
212
+ const geomAxidraw = await import("@thi.ng/geom-axidraw");
216
213
  ```
217
214
 
218
215
  Package sizes (brotli'd, pre-treeshake): ESM: 856 bytes
@@ -239,7 +236,7 @@ TODO
239
236
 
240
237
  ## Authors
241
238
 
242
- Karsten Schmidt
239
+ - [Karsten Schmidt](https://thi.ng)
243
240
 
244
241
  If this project contributes to an academic publication, please cite it as:
245
242
 
@@ -254,4 +251,4 @@ If this project contributes to an academic publication, please cite it as:
254
251
 
255
252
  ## License
256
253
 
257
- &copy; 2022 Karsten Schmidt // Apache Software License 2.0
254
+ &copy; 2022 Karsten Schmidt // Apache License 2.0
package/api.d.ts CHANGED
@@ -70,6 +70,6 @@ export interface AsAxiDrawOpts {
70
70
  */
71
71
  clip: ReadonlyVec[];
72
72
  }
73
- export declare type PointOrdering = Fn<ReadonlyVec[], Iterable<ReadonlyVec>>;
74
- export declare type ShapeOrdering = Fn<IShape[], Iterable<IShape>>;
73
+ export type PointOrdering = Fn<ReadonlyVec[], Iterable<ReadonlyVec>>;
74
+ export type ShapeOrdering = Fn<IShape[], Iterable<IShape>>;
75
75
  //# sourceMappingURL=api.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/geom-axidraw",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Conversion and preparation of thi.ng/geom shapes & shape groups to AxiDraw pen plotter draw commands",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
12
12
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/geom-axidraw#readme",
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/geom-axidraw#readme",
14
14
  "funding": [
15
15
  {
16
16
  "type": "github",
@@ -21,7 +21,7 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
@@ -34,25 +34,25 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1",
38
- "@thi.ng/arrays": "^2.4.4",
39
- "@thi.ng/axidraw": "^0.2.0",
40
- "@thi.ng/compare": "^2.1.18",
41
- "@thi.ng/defmulti": "^2.1.23",
42
- "@thi.ng/geom": "^4.0.0",
43
- "@thi.ng/geom-accel": "^3.2.28",
44
- "@thi.ng/geom-api": "^3.3.20",
45
- "@thi.ng/geom-clip-line": "^2.2.0",
46
- "@thi.ng/geom-isec": "^2.1.37",
47
- "@thi.ng/vectors": "^7.5.26"
37
+ "@thi.ng/api": "^8.6.1",
38
+ "@thi.ng/arrays": "^2.4.6",
39
+ "@thi.ng/axidraw": "^0.2.2",
40
+ "@thi.ng/compare": "^2.1.20",
41
+ "@thi.ng/defmulti": "^2.1.25",
42
+ "@thi.ng/geom": "^4.0.2",
43
+ "@thi.ng/geom-accel": "^3.2.30",
44
+ "@thi.ng/geom-api": "^3.3.22",
45
+ "@thi.ng/geom-clip-line": "^2.2.2",
46
+ "@thi.ng/geom-isec": "^2.1.39",
47
+ "@thi.ng/vectors": "^7.5.28"
48
48
  },
49
49
  "devDependencies": {
50
- "@microsoft/api-extractor": "^7.33.5",
51
- "@thi.ng/testament": "^0.3.6",
50
+ "@microsoft/api-extractor": "^7.33.7",
51
+ "@thi.ng/testament": "^0.3.7",
52
52
  "rimraf": "^3.0.2",
53
53
  "tools": "^0.0.1",
54
- "typedoc": "^0.23.20",
55
- "typescript": "^4.8.4"
54
+ "typedoc": "^0.23.22",
55
+ "typescript": "^4.9.4"
56
56
  },
57
57
  "keywords": [
58
58
  "2d",
@@ -117,5 +117,5 @@
117
117
  "status": "alpha",
118
118
  "year": 2022
119
119
  },
120
- "gitHead": "5178ea1d7f4b2de86cf5101bdd73f6567518c0bd\n"
120
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
121
121
  }