@biolibs/bionet-space 0.2.0 → 0.3.0
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/README.md +17 -0
- package/dist/build.d.ts +83 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +148 -0
- package/dist/build.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/build.ts +167 -0
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -63,3 +63,20 @@ layout.places.map((one) => [one.id, one.parent]); // [ [ "~room", null ], [ "f
|
|
|
63
63
|
`layoutFrom` takes a lab as `@biolibs/bionet` records it — millimetres, retired places, items that
|
|
64
64
|
may be nowhere — and gives a layout of what can be found. It asks for the lab by shape, so this
|
|
65
65
|
package still depends on nothing. Places standing in no room are put in one made up for the purpose.
|
|
66
|
+
|
|
67
|
+
## Arranging by hand
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { arrange, exampleLab, overlapping, standingAt, standingOf, sticking } from "@biolibs/bionet-space";
|
|
71
|
+
|
|
72
|
+
const arranged = arrange(exampleLab());
|
|
73
|
+
standingOf(arranged, "minus80")?.size; // [ 0.9, 2, 0.85 ]
|
|
74
|
+
standingAt(arranged, "minus80", [3.1, 2.2]); // the standing it would have with its base centred there
|
|
75
|
+
overlapping(arranged); // [] — pairs of places standing in each other
|
|
76
|
+
sticking(arranged); // [] — places stood partly outside what they are in
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`standingOf` is the inverse of `arrange`: where a place stands as the lab would say it, measured from
|
|
80
|
+
the place it is in, including for a place nobody has stood anywhere. `standingAt` is what a drag
|
|
81
|
+
becomes: settled every 5 cm and kept inside the parent. `quarterTurned` turns one. None of them
|
|
82
|
+
moves anything; they work out what would be said.
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic of arranging a lab by hand.
|
|
3
|
+
*
|
|
4
|
+
* `arrange` goes from what a lab says to where things are. Arranging goes the other way: somebody
|
|
5
|
+
* drags a freezer across a floor, and that has to become something the lab can say — a position
|
|
6
|
+
* measured from the place the freezer is in, in that place's own facing. This is that inverse, with
|
|
7
|
+
* the checks a person arranging wants: has it left the room, is it standing in something else.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here moves anything. It works out what would be said, and a caller says it.
|
|
10
|
+
*/
|
|
11
|
+
import type { Arranged, Standing } from "./model.js";
|
|
12
|
+
/** How finely a dragged place settles, in metres. */
|
|
13
|
+
export declare const SNAP = 0.05;
|
|
14
|
+
/**
|
|
15
|
+
* A length settled onto a grid.
|
|
16
|
+
*
|
|
17
|
+
* @param value - The length, in metres.
|
|
18
|
+
* @param step - The grid, in metres.
|
|
19
|
+
* @returns The nearest multiple of the step, to the millimetre.
|
|
20
|
+
*/
|
|
21
|
+
export declare function snapped(value: number, step?: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Where a place stands, as the lab would say it: measured from the place it is in.
|
|
24
|
+
*
|
|
25
|
+
* It is the inverse of `arrange`, so it gives an answer for a place nobody has stood anywhere too:
|
|
26
|
+
* the standing that would leave it exactly where it is now.
|
|
27
|
+
*
|
|
28
|
+
* @param arranged - The lab, arranged.
|
|
29
|
+
* @param id - The place.
|
|
30
|
+
* @returns Its standing, or `null` if the lab has no such place.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { arrange, exampleLab, standingOf } from "@biolibs/bionet-space";
|
|
35
|
+
*
|
|
36
|
+
* const arranged = arrange(exampleLab());
|
|
37
|
+
* standingOf(arranged, "minus80")?.size; // [ 0.9, 2, 0.85 ]
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function standingOf(arranged: readonly Arranged[], id: string): Standing | null;
|
|
41
|
+
/**
|
|
42
|
+
* The standing a place would have if the centre of its base were moved to a point on the floor.
|
|
43
|
+
*
|
|
44
|
+
* The point is settled onto a grid and kept inside the place it is in, so a freezer cannot be
|
|
45
|
+
* dragged through a wall. Its height off the floor, its size and its turn stay as they are.
|
|
46
|
+
*
|
|
47
|
+
* @param arranged - The lab, arranged.
|
|
48
|
+
* @param id - The place being moved.
|
|
49
|
+
* @param to - Where the centre of its base should go, across and towards the front, in the lab's coordinates.
|
|
50
|
+
* @param options - `snap` is the grid to settle on, in metres; 0 for none.
|
|
51
|
+
* @returns The standing, or `null` if the lab has no such place.
|
|
52
|
+
*/
|
|
53
|
+
export declare function standingAt(arranged: readonly Arranged[], id: string, to: readonly [number, number], options?: {
|
|
54
|
+
snap?: number;
|
|
55
|
+
}): Standing | null;
|
|
56
|
+
/**
|
|
57
|
+
* A standing turned a quarter turn further.
|
|
58
|
+
*
|
|
59
|
+
* @param standing - The standing.
|
|
60
|
+
* @returns The same place, facing the next way round.
|
|
61
|
+
*/
|
|
62
|
+
export declare function quarterTurned(standing: Standing): Standing;
|
|
63
|
+
/**
|
|
64
|
+
* Places that are standing in each other.
|
|
65
|
+
*
|
|
66
|
+
* Only places in the same place are compared: a box is supposed to be inside its freezer. Two that
|
|
67
|
+
* touch are fine; two that share space are not, and both are named.
|
|
68
|
+
*
|
|
69
|
+
* @param arranged - The lab, arranged.
|
|
70
|
+
* @returns Each pair that shares space, once.
|
|
71
|
+
*/
|
|
72
|
+
export declare function overlapping(arranged: readonly Arranged[]): [string, string][];
|
|
73
|
+
/**
|
|
74
|
+
* Places somebody has stood partly outside the place they are in.
|
|
75
|
+
*
|
|
76
|
+
* Only places stood by hand are named. One that was never stood anywhere is where `arrange` put it,
|
|
77
|
+
* and if that is outside, the fault is not the lab's.
|
|
78
|
+
*
|
|
79
|
+
* @param arranged - The lab, arranged.
|
|
80
|
+
* @returns The ID of each such place.
|
|
81
|
+
*/
|
|
82
|
+
export declare function sticking(arranged: readonly Arranged[]): string[];
|
|
83
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAQ,MAAM,YAAY,CAAC;AAE3D,qDAAqD;AACrD,eAAO,MAAM,IAAI,OAAO,CAAC;AAOzB;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAa,GAAG,MAAM,CAElE;AAoBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAerF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,QAAQ,GAAG,IAAI,CAmBrJ;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAE1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAY7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,MAAM,EAAE,CAOhE"}
|
package/dist/build.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** How finely a dragged place settles, in metres. */
|
|
2
|
+
export const SNAP = 0.05;
|
|
3
|
+
/** How far two places may sink into each other before it counts, in metres. */
|
|
4
|
+
const SLACK = 0.001;
|
|
5
|
+
const round = (value) => Math.round(value * 1000) / 1000;
|
|
6
|
+
/**
|
|
7
|
+
* A length settled onto a grid.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The length, in metres.
|
|
10
|
+
* @param step - The grid, in metres.
|
|
11
|
+
* @returns The nearest multiple of the step, to the millimetre.
|
|
12
|
+
*/
|
|
13
|
+
export function snapped(value, step = SNAP) {
|
|
14
|
+
return step <= 0 ? round(value) : round(Math.round(value / step) * step);
|
|
15
|
+
}
|
|
16
|
+
/** Undo a turn: an offset in the lab's directions, as measured inside a place turned that far. */
|
|
17
|
+
function unturned([x, y, z], turn) {
|
|
18
|
+
switch (turn) {
|
|
19
|
+
case 90: return [z, y, -x];
|
|
20
|
+
case 180: return [-x, y, -z];
|
|
21
|
+
case 270: return [-z, y, x];
|
|
22
|
+
default: return [x, y, z];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const base = (one) => [one.center[0], one.center[1] - one.size[1] / 2, one.center[2]];
|
|
26
|
+
/** The place something is in, arranged, or `null` for one that is in nothing. */
|
|
27
|
+
const parentOf = (arranged, one) => {
|
|
28
|
+
const id = one.path.at(-2);
|
|
29
|
+
return id === undefined ? null : arranged.find((each) => each.place.id === id) ?? null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Where a place stands, as the lab would say it: measured from the place it is in.
|
|
33
|
+
*
|
|
34
|
+
* It is the inverse of `arrange`, so it gives an answer for a place nobody has stood anywhere too:
|
|
35
|
+
* the standing that would leave it exactly where it is now.
|
|
36
|
+
*
|
|
37
|
+
* @param arranged - The lab, arranged.
|
|
38
|
+
* @param id - The place.
|
|
39
|
+
* @returns Its standing, or `null` if the lab has no such place.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { arrange, exampleLab, standingOf } from "@biolibs/bionet-space";
|
|
44
|
+
*
|
|
45
|
+
* const arranged = arrange(exampleLab());
|
|
46
|
+
* standingOf(arranged, "minus80")?.size; // [ 0.9, 2, 0.85 ]
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export function standingOf(arranged, id) {
|
|
50
|
+
const one = arranged.find((each) => each.place.id === id);
|
|
51
|
+
if (one === undefined)
|
|
52
|
+
return null;
|
|
53
|
+
const parent = parentOf(arranged, one);
|
|
54
|
+
const from = parent === null ? [0, 0, 0] : base(parent);
|
|
55
|
+
const at = base(one);
|
|
56
|
+
const inside = parent?.turn ?? 0;
|
|
57
|
+
const position = unturned([at[0] - from[0], at[1] - from[1], at[2] - from[2]], inside);
|
|
58
|
+
const [w, h, d] = one.size;
|
|
59
|
+
return {
|
|
60
|
+
position: [round(position[0]), round(position[1]), round(position[2])],
|
|
61
|
+
// The space it takes up was worked out after turning, so a quarter turn is undone here.
|
|
62
|
+
size: one.turn === 90 || one.turn === 270 ? [round(d), round(h), round(w)] : [round(w), round(h), round(d)],
|
|
63
|
+
turn: ((one.turn - inside + 360) % 360),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The standing a place would have if the centre of its base were moved to a point on the floor.
|
|
68
|
+
*
|
|
69
|
+
* The point is settled onto a grid and kept inside the place it is in, so a freezer cannot be
|
|
70
|
+
* dragged through a wall. Its height off the floor, its size and its turn stay as they are.
|
|
71
|
+
*
|
|
72
|
+
* @param arranged - The lab, arranged.
|
|
73
|
+
* @param id - The place being moved.
|
|
74
|
+
* @param to - Where the centre of its base should go, across and towards the front, in the lab's coordinates.
|
|
75
|
+
* @param options - `snap` is the grid to settle on, in metres; 0 for none.
|
|
76
|
+
* @returns The standing, or `null` if the lab has no such place.
|
|
77
|
+
*/
|
|
78
|
+
export function standingAt(arranged, id, to, options = {}) {
|
|
79
|
+
const one = arranged.find((each) => each.place.id === id);
|
|
80
|
+
const now = standingOf(arranged, id);
|
|
81
|
+
if (one === undefined || now === null)
|
|
82
|
+
return null;
|
|
83
|
+
const parent = parentOf(arranged, one);
|
|
84
|
+
const from = parent === null ? [0, 0, 0] : base(parent);
|
|
85
|
+
const [x, , z] = unturned([to[0] - from[0], 0, to[1] - from[2]], parent?.turn ?? 0);
|
|
86
|
+
let across = snapped(x, options.snap ?? SNAP);
|
|
87
|
+
let forward = snapped(z, options.snap ?? SNAP);
|
|
88
|
+
if (parent !== null) {
|
|
89
|
+
// How much room there is either side, in the parent's own facing.
|
|
90
|
+
const [pw, pd] = parent.turn === 90 || parent.turn === 270 ? [parent.size[2], parent.size[0]] : [parent.size[0], parent.size[2]];
|
|
91
|
+
const quarter = now.turn === 90 || now.turn === 270;
|
|
92
|
+
const [w, d] = quarter ? [now.size[2], now.size[0]] : [now.size[0], now.size[2]];
|
|
93
|
+
const within = (value, room, taken) => (taken >= room ? 0 : Math.min(Math.max(value, -(room - taken) / 2), (room - taken) / 2));
|
|
94
|
+
across = round(within(across, pw, w));
|
|
95
|
+
forward = round(within(forward, pd, d));
|
|
96
|
+
}
|
|
97
|
+
return { ...now, position: [across, now.position[1], forward] };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* A standing turned a quarter turn further.
|
|
101
|
+
*
|
|
102
|
+
* @param standing - The standing.
|
|
103
|
+
* @returns The same place, facing the next way round.
|
|
104
|
+
*/
|
|
105
|
+
export function quarterTurned(standing) {
|
|
106
|
+
return { ...standing, turn: (((standing.turn ?? 0) + 90) % 360) };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Places that are standing in each other.
|
|
110
|
+
*
|
|
111
|
+
* Only places in the same place are compared: a box is supposed to be inside its freezer. Two that
|
|
112
|
+
* touch are fine; two that share space are not, and both are named.
|
|
113
|
+
*
|
|
114
|
+
* @param arranged - The lab, arranged.
|
|
115
|
+
* @returns Each pair that shares space, once.
|
|
116
|
+
*/
|
|
117
|
+
export function overlapping(arranged) {
|
|
118
|
+
const pairs = [];
|
|
119
|
+
const apart = (a, b, axis) => Math.abs(a.center[axis] - b.center[axis]) >= (a.size[axis] + b.size[axis]) / 2 - SLACK;
|
|
120
|
+
for (let first = 0; first < arranged.length; first++) {
|
|
121
|
+
for (let second = first + 1; second < arranged.length; second++) {
|
|
122
|
+
const [a, b] = [arranged[first], arranged[second]];
|
|
123
|
+
if (a.place.parent !== b.place.parent)
|
|
124
|
+
continue;
|
|
125
|
+
if (!apart(a, b, 0) && !apart(a, b, 1) && !apart(a, b, 2))
|
|
126
|
+
pairs.push([a.place.id, b.place.id]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return pairs;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Places somebody has stood partly outside the place they are in.
|
|
133
|
+
*
|
|
134
|
+
* Only places stood by hand are named. One that was never stood anywhere is where `arrange` put it,
|
|
135
|
+
* and if that is outside, the fault is not the lab's.
|
|
136
|
+
*
|
|
137
|
+
* @param arranged - The lab, arranged.
|
|
138
|
+
* @returns The ID of each such place.
|
|
139
|
+
*/
|
|
140
|
+
export function sticking(arranged) {
|
|
141
|
+
return arranged.filter((one) => {
|
|
142
|
+
const parent = parentOf(arranged, one);
|
|
143
|
+
if (parent === null || one.placed !== "by hand")
|
|
144
|
+
return false;
|
|
145
|
+
return [0, 1, 2].some((axis) => Math.abs(one.center[axis] - parent.center[axis]) > (parent.size[axis] - one.size[axis]) / 2 + SLACK);
|
|
146
|
+
}).map((one) => one.place.id);
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAYA,qDAAqD;AACrD,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC;AAEzB,+EAA+E;AAC/E,MAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,UAA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AAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACzG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - `model.ts` — places, what is stored in them, and a place with somewhere to stand
|
|
14
14
|
* - `arrange.ts` — giving every place somewhere to stand, and the positions inside a box
|
|
15
15
|
* - `find.ts` — levels, bounds, camera poses, searching
|
|
16
|
+
* - `build.ts` — arranging by hand: what a drag would have the lab say, and what has gone wrong
|
|
16
17
|
* - `from.ts` — a layout made from a lab's own record of itself
|
|
17
18
|
* - `example.ts` — a lab to look at
|
|
18
19
|
*/
|
|
@@ -21,4 +22,5 @@ export * from "./arrange.js";
|
|
|
21
22
|
export * from "./find.js";
|
|
22
23
|
export * from "./example.js";
|
|
23
24
|
export * from "./from.js";
|
|
25
|
+
export * from "./build.js";
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - `model.ts` — places, what is stored in them, and a place with somewhere to stand
|
|
14
14
|
* - `arrange.ts` — giving every place somewhere to stand, and the positions inside a box
|
|
15
15
|
* - `find.ts` — levels, bounds, camera poses, searching
|
|
16
|
+
* - `build.ts` — arranging by hand: what a drag would have the lab say, and what has gone wrong
|
|
16
17
|
* - `from.ts` — a layout made from a lab's own record of itself
|
|
17
18
|
* - `example.ts` — a lab to look at
|
|
18
19
|
*/
|
|
@@ -21,4 +22,5 @@ export * from "./arrange.js";
|
|
|
21
22
|
export * from "./find.js";
|
|
22
23
|
export * from "./example.js";
|
|
23
24
|
export * from "./from.js";
|
|
25
|
+
export * from "./build.js";
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
package/src/build.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic of arranging a lab by hand.
|
|
3
|
+
*
|
|
4
|
+
* `arrange` goes from what a lab says to where things are. Arranging goes the other way: somebody
|
|
5
|
+
* drags a freezer across a floor, and that has to become something the lab can say — a position
|
|
6
|
+
* measured from the place the freezer is in, in that place's own facing. This is that inverse, with
|
|
7
|
+
* the checks a person arranging wants: has it left the room, is it standing in something else.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here moves anything. It works out what would be said, and a caller says it.
|
|
10
|
+
*/
|
|
11
|
+
import type { Arranged, Standing, Turn } from "./model.js";
|
|
12
|
+
|
|
13
|
+
/** How finely a dragged place settles, in metres. */
|
|
14
|
+
export const SNAP = 0.05;
|
|
15
|
+
|
|
16
|
+
/** How far two places may sink into each other before it counts, in metres. */
|
|
17
|
+
const SLACK = 0.001;
|
|
18
|
+
|
|
19
|
+
const round = (value: number): number => Math.round(value * 1000) / 1000;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A length settled onto a grid.
|
|
23
|
+
*
|
|
24
|
+
* @param value - The length, in metres.
|
|
25
|
+
* @param step - The grid, in metres.
|
|
26
|
+
* @returns The nearest multiple of the step, to the millimetre.
|
|
27
|
+
*/
|
|
28
|
+
export function snapped(value: number, step: number = SNAP): number {
|
|
29
|
+
return step <= 0 ? round(value) : round(Math.round(value / step) * step);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Undo a turn: an offset in the lab's directions, as measured inside a place turned that far. */
|
|
33
|
+
function unturned([x, y, z]: [number, number, number], turn: Turn): [number, number, number] {
|
|
34
|
+
switch (turn) {
|
|
35
|
+
case 90: return [z, y, -x];
|
|
36
|
+
case 180: return [-x, y, -z];
|
|
37
|
+
case 270: return [-z, y, x];
|
|
38
|
+
default: return [x, y, z];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const base = (one: Arranged): [number, number, number] => [one.center[0], one.center[1] - one.size[1] / 2, one.center[2]];
|
|
43
|
+
|
|
44
|
+
/** The place something is in, arranged, or `null` for one that is in nothing. */
|
|
45
|
+
const parentOf = (arranged: readonly Arranged[], one: Arranged): Arranged | null => {
|
|
46
|
+
const id = one.path.at(-2);
|
|
47
|
+
return id === undefined ? null : arranged.find((each) => each.place.id === id) ?? null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Where a place stands, as the lab would say it: measured from the place it is in.
|
|
52
|
+
*
|
|
53
|
+
* It is the inverse of `arrange`, so it gives an answer for a place nobody has stood anywhere too:
|
|
54
|
+
* the standing that would leave it exactly where it is now.
|
|
55
|
+
*
|
|
56
|
+
* @param arranged - The lab, arranged.
|
|
57
|
+
* @param id - The place.
|
|
58
|
+
* @returns Its standing, or `null` if the lab has no such place.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* import { arrange, exampleLab, standingOf } from "@biolibs/bionet-space";
|
|
63
|
+
*
|
|
64
|
+
* const arranged = arrange(exampleLab());
|
|
65
|
+
* standingOf(arranged, "minus80")?.size; // [ 0.9, 2, 0.85 ]
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export function standingOf(arranged: readonly Arranged[], id: string): Standing | null {
|
|
69
|
+
const one = arranged.find((each) => each.place.id === id);
|
|
70
|
+
if (one === undefined) return null;
|
|
71
|
+
const parent = parentOf(arranged, one);
|
|
72
|
+
const from: [number, number, number] = parent === null ? [0, 0, 0] : base(parent);
|
|
73
|
+
const at = base(one);
|
|
74
|
+
const inside = parent?.turn ?? 0;
|
|
75
|
+
const position = unturned([at[0] - from[0], at[1] - from[1], at[2] - from[2]], inside);
|
|
76
|
+
const [w, h, d] = one.size;
|
|
77
|
+
return {
|
|
78
|
+
position: [round(position[0]), round(position[1]), round(position[2])],
|
|
79
|
+
// The space it takes up was worked out after turning, so a quarter turn is undone here.
|
|
80
|
+
size: one.turn === 90 || one.turn === 270 ? [round(d), round(h), round(w)] : [round(w), round(h), round(d)],
|
|
81
|
+
turn: ((one.turn - inside + 360) % 360) as Turn,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The standing a place would have if the centre of its base were moved to a point on the floor.
|
|
87
|
+
*
|
|
88
|
+
* The point is settled onto a grid and kept inside the place it is in, so a freezer cannot be
|
|
89
|
+
* dragged through a wall. Its height off the floor, its size and its turn stay as they are.
|
|
90
|
+
*
|
|
91
|
+
* @param arranged - The lab, arranged.
|
|
92
|
+
* @param id - The place being moved.
|
|
93
|
+
* @param to - Where the centre of its base should go, across and towards the front, in the lab's coordinates.
|
|
94
|
+
* @param options - `snap` is the grid to settle on, in metres; 0 for none.
|
|
95
|
+
* @returns The standing, or `null` if the lab has no such place.
|
|
96
|
+
*/
|
|
97
|
+
export function standingAt(arranged: readonly Arranged[], id: string, to: readonly [number, number], options: { snap?: number } = {}): Standing | null {
|
|
98
|
+
const one = arranged.find((each) => each.place.id === id);
|
|
99
|
+
const now = standingOf(arranged, id);
|
|
100
|
+
if (one === undefined || now === null) return null;
|
|
101
|
+
const parent = parentOf(arranged, one);
|
|
102
|
+
const from: [number, number, number] = parent === null ? [0, 0, 0] : base(parent);
|
|
103
|
+
const [x, , z] = unturned([to[0] - from[0], 0, to[1] - from[2]], parent?.turn ?? 0);
|
|
104
|
+
let across = snapped(x, options.snap ?? SNAP);
|
|
105
|
+
let forward = snapped(z, options.snap ?? SNAP);
|
|
106
|
+
if (parent !== null) {
|
|
107
|
+
// How much room there is either side, in the parent's own facing.
|
|
108
|
+
const [pw, pd] = parent.turn === 90 || parent.turn === 270 ? [parent.size[2], parent.size[0]] : [parent.size[0], parent.size[2]];
|
|
109
|
+
const quarter = now.turn === 90 || now.turn === 270;
|
|
110
|
+
const [w, d] = quarter ? [now.size[2], now.size[0]] : [now.size[0], now.size[2]];
|
|
111
|
+
const within = (value: number, room: number, taken: number): number => (taken >= room ? 0 : Math.min(Math.max(value, -(room - taken) / 2), (room - taken) / 2));
|
|
112
|
+
across = round(within(across, pw, w));
|
|
113
|
+
forward = round(within(forward, pd, d));
|
|
114
|
+
}
|
|
115
|
+
return { ...now, position: [across, now.position[1], forward] };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A standing turned a quarter turn further.
|
|
120
|
+
*
|
|
121
|
+
* @param standing - The standing.
|
|
122
|
+
* @returns The same place, facing the next way round.
|
|
123
|
+
*/
|
|
124
|
+
export function quarterTurned(standing: Standing): Standing {
|
|
125
|
+
return { ...standing, turn: ((((standing.turn ?? 0) + 90) % 360) as Turn) };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Places that are standing in each other.
|
|
130
|
+
*
|
|
131
|
+
* Only places in the same place are compared: a box is supposed to be inside its freezer. Two that
|
|
132
|
+
* touch are fine; two that share space are not, and both are named.
|
|
133
|
+
*
|
|
134
|
+
* @param arranged - The lab, arranged.
|
|
135
|
+
* @returns Each pair that shares space, once.
|
|
136
|
+
*/
|
|
137
|
+
export function overlapping(arranged: readonly Arranged[]): [string, string][] {
|
|
138
|
+
const pairs: [string, string][] = [];
|
|
139
|
+
const apart = (a: Arranged, b: Arranged, axis: 0 | 1 | 2): boolean =>
|
|
140
|
+
Math.abs(a.center[axis] - b.center[axis]) >= (a.size[axis] + b.size[axis]) / 2 - SLACK;
|
|
141
|
+
for (let first = 0; first < arranged.length; first++) {
|
|
142
|
+
for (let second = first + 1; second < arranged.length; second++) {
|
|
143
|
+
const [a, b] = [arranged[first]!, arranged[second]!];
|
|
144
|
+
if (a.place.parent !== b.place.parent) continue;
|
|
145
|
+
if (!apart(a, b, 0) && !apart(a, b, 1) && !apart(a, b, 2)) pairs.push([a.place.id, b.place.id]);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return pairs;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Places somebody has stood partly outside the place they are in.
|
|
153
|
+
*
|
|
154
|
+
* Only places stood by hand are named. One that was never stood anywhere is where `arrange` put it,
|
|
155
|
+
* and if that is outside, the fault is not the lab's.
|
|
156
|
+
*
|
|
157
|
+
* @param arranged - The lab, arranged.
|
|
158
|
+
* @returns The ID of each such place.
|
|
159
|
+
*/
|
|
160
|
+
export function sticking(arranged: readonly Arranged[]): string[] {
|
|
161
|
+
return arranged.filter((one) => {
|
|
162
|
+
const parent = parentOf(arranged, one);
|
|
163
|
+
if (parent === null || one.placed !== "by hand") return false;
|
|
164
|
+
return ([0, 1, 2] as const).some((axis) =>
|
|
165
|
+
Math.abs(one.center[axis] - parent.center[axis]) > (parent.size[axis] - one.size[axis]) / 2 + SLACK);
|
|
166
|
+
}).map((one) => one.place.id);
|
|
167
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - `model.ts` — places, what is stored in them, and a place with somewhere to stand
|
|
14
14
|
* - `arrange.ts` — giving every place somewhere to stand, and the positions inside a box
|
|
15
15
|
* - `find.ts` — levels, bounds, camera poses, searching
|
|
16
|
+
* - `build.ts` — arranging by hand: what a drag would have the lab say, and what has gone wrong
|
|
16
17
|
* - `from.ts` — a layout made from a lab's own record of itself
|
|
17
18
|
* - `example.ts` — a lab to look at
|
|
18
19
|
*/
|
|
@@ -21,3 +22,4 @@ export * from "./arrange.js";
|
|
|
21
22
|
export * from "./find.js";
|
|
22
23
|
export * from "./example.js";
|
|
23
24
|
export * from "./from.js";
|
|
25
|
+
export * from "./build.js";
|