roamwright 0.1.0 → 0.2.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/CONTRIBUTING.md +39 -8
- package/README.md +53 -24
- package/examples/viaduct-camera.js +40 -0
- package/examples/viaduct-landscape.js +81 -0
- package/examples/viaduct.css +75 -0
- package/examples/viaduct.html +47 -0
- package/examples/viaduct.js +332 -0
- package/geometry/builder.js +11 -14
- package/geometry/creased-sheet.js +127 -0
- package/geometry/ear.js +97 -0
- package/geometry/erosion.js +106 -0
- package/geometry/face-grid.js +143 -0
- package/geometry/garment-tags.js +11 -0
- package/geometry/hair-gathers.js +174 -0
- package/geometry/hair-locks.js +156 -0
- package/geometry/hair-patch.js +42 -0
- package/geometry/hair-shell.js +186 -0
- package/geometry/hair-tags.js +6 -0
- package/geometry/head-profile.js +138 -0
- package/geometry/head-shape.js +499 -0
- package/geometry/heightfield.js +68 -0
- package/geometry/outline-grid.js +46 -0
- package/geometry/path-field.js +65 -0
- package/geometry/sagging-tube.js +58 -0
- package/geometry/sampled-surface.js +101 -0
- package/geometry/scatter-grid.js +32 -0
- package/geometry/sculpt.js +263 -0
- package/geometry/shore-grid.js +67 -0
- package/geometry/strata-field.js +339 -0
- package/geometry/strata-tiles.js +215 -0
- package/geometry/stream.js +94 -0
- package/geometry/terrain-chunks.js +300 -0
- package/geometry/terrain-extension.js +44 -0
- package/math/cell-edge.js +44 -0
- package/math/cloth-textures.js +83 -0
- package/math/cloud-textures.js +112 -0
- package/math/color.js +29 -0
- package/math/curve.js +3 -4
- package/math/mountain-ranges.js +463 -0
- package/math/particle-noise.js +48 -0
- package/math/periodic.js +20 -0
- package/math/rock-texture.js +56 -0
- package/math/surface-textures.js +241 -0
- package/motion/arm-reach.js +74 -0
- package/motion/biped-stride.js +276 -0
- package/motion/crowd-alarms.js +127 -0
- package/motion/crowd-routine.js +183 -0
- package/motion/daily-clock.js +59 -0
- package/motion/instance-sight.js +84 -0
- package/motion/quadruped.js +332 -0
- package/motion/weather.js +59 -0
- package/motion/wind.js +27 -0
- package/package.json +6 -4
- package/rendering/caster-motion.js +79 -0
- package/rendering/cell-lod.js +175 -0
- package/rendering/cloud-dome.js +371 -0
- package/rendering/cloud-field.js +83 -0
- package/rendering/compilation-schedule.js +34 -0
- package/rendering/contact-shadows.js +79 -0
- package/rendering/crowd-skinning.js +133 -0
- package/rendering/crust.js +28 -0
- package/rendering/daylight.js +50 -0
- package/rendering/far-shadow.js +186 -0
- package/rendering/flocks.js +323 -0
- package/rendering/garment-material.js +110 -0
- package/rendering/glow-lines.js +74 -0
- package/rendering/glow-shell.js +90 -0
- package/rendering/hair-strands.js +67 -0
- package/rendering/height-haze.js +129 -0
- package/rendering/height-probe.js +91 -0
- package/rendering/interior-mapping.js +19 -0
- package/rendering/light-budget.js +222 -0
- package/rendering/light-points.js +51 -0
- package/rendering/light-shafts.js +131 -0
- package/rendering/local-lights.js +28 -0
- package/rendering/low-light.js +13 -0
- package/rendering/material-lod.js +110 -0
- package/rendering/particle-emitters.js +223 -0
- package/rendering/particles.js +297 -0
- package/rendering/planar-reflection.js +175 -0
- package/rendering/post-shaders.js +21 -1
- package/rendering/post.js +8 -5
- package/rendering/rain-rings.js +22 -0
- package/rendering/road-surface.js +63 -0
- package/rendering/sea-shaders.js +230 -0
- package/rendering/shader-warmup.js +197 -0
- package/rendering/shadow-alignment.js +28 -0
- package/rendering/shadow-depth.js +129 -0
- package/rendering/sky-occlusion.js +187 -0
- package/rendering/sky.js +169 -0
- package/rendering/stage-lights.js +209 -0
- package/rendering/static-point-shadow.js +119 -0
- package/rendering/still-casters.js +6 -11
- package/rendering/strata-material.js +93 -0
- package/rendering/stream-flow.js +36 -0
- package/rendering/surface-light.js +22 -0
- package/rendering/surface-projection.js +69 -0
- package/rendering/talus.js +26 -0
- package/rendering/terrain-rock.js +48 -0
- package/rendering/texture-fills.js +68 -0
- package/rendering/viewport.js +9 -0
- package/rendering/wakes.js +99 -0
- package/rendering/water-material.js +288 -0
- package/rendering/world-matrices.js +4 -6
- package/runtime/device-quality.js +27 -0
- package/runtime/diagnostic-log.js +80 -0
- package/runtime/events.js +14 -0
- package/runtime/first-use.js +3 -1
- package/runtime/frame-yield.js +14 -0
- package/runtime/grid-cache.js +88 -0
- package/runtime/grid-rows.js +9 -0
- package/runtime/module-preload.js +15 -0
- package/runtime/quality-fit.js +5 -9
- package/runtime/search.js +69 -0
- package/runtime/spatial-audio.js +57 -0
- package/scripts/serve.py +26 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { sstep, TAU } from '../math/scalar.js';
|
|
3
|
+
import { STRANDS } from './hair-tags.js';
|
|
4
|
+
import { POINT } from './hair-patch.js';
|
|
5
|
+
|
|
6
|
+
const MIDDLE = new THREE.Vector3(0, 0.02, -0.012), // about the middle of the skull's dome: hair stands out from here
|
|
7
|
+
TUCK = 0.8, // how much of its fullness the mass gives up under a fall of long hair
|
|
8
|
+
EDGE = 0.04, // how much of its fullness the mass keeps at the hairline itself,
|
|
9
|
+
RISE = 0.16, // and how far inside the hairline it reaches all of it (as the hairline is measured: 1 is half the head's height)
|
|
10
|
+
DETAIL = 11, // the shell's fineness: its sides are about 10 mm long, too short to show on the head's outline at 0.9 m
|
|
11
|
+
TURNS = 23, // periods of strands round the head, about the axis the cut's hair lies away from
|
|
12
|
+
SEAM_STEPS = 9, // halvings that find where the hairline crosses a side of the shell
|
|
13
|
+
TOO_WIDE = 0.3; // a triangle wider than this across the strands (of the tag's measure) lies on the pole they part from
|
|
14
|
+
|
|
15
|
+
const _o = new THREE.Vector3(),
|
|
16
|
+
_n = new THREE.Vector3(),
|
|
17
|
+
_d = new THREE.Vector3(),
|
|
18
|
+
_e1 = new THREE.Vector3(),
|
|
19
|
+
_e2 = new THREE.Vector3();
|
|
20
|
+
|
|
21
|
+
// The mass of a cut. scale: how far out from the skull its fullest stands (across, up, fore and aft, as shares of the skull);
|
|
22
|
+
// inHair(x, y, z): how far inside the hairline a direction lies; drop: how far it hangs below the ears; lumps: how deep its
|
|
23
|
+
// lumps are (a share of the skull) and lumpy: how many there are round the head; tucked(d): where it lies under a fall of long
|
|
24
|
+
// hair and is drawn in to the skull, 0 to 1.
|
|
25
|
+
// Returns at(d, lift, out, outward): the point of the mass at a direction from the head's middle, raised off it by lift
|
|
26
|
+
// (metres), and the way out there; and full(d): how much of its fullness the mass has at a direction, 0 to 1.
|
|
27
|
+
function massOf({ skull, scale, inHair, drop = 0, lumps = 0, lumpy = 5, tucked = null }) {
|
|
28
|
+
const full = d => (EDGE + (1 - EDGE) * sstep(-0.01, RISE, inHair(d.x, d.y, d.z))) * (tucked ? 1 - TUCK * tucked(d) : 1),
|
|
29
|
+
swell = d =>
|
|
30
|
+
lumps *
|
|
31
|
+
(Math.sin(d.x * lumpy * 2.3 + d.y * lumpy * 1.3) * Math.sin(d.z * lumpy * 2.1 - d.y * lumpy * 1.7) +
|
|
32
|
+
0.6 * Math.sin(d.y * lumpy * 2.9 + d.x * lumpy * 1.1 - d.z * lumpy * 1.9)),
|
|
33
|
+
at = (d, lift, out, outward = _n) => {
|
|
34
|
+
const k = full(d),
|
|
35
|
+
more = lumps ? swell(d) * k : 0;
|
|
36
|
+
skull.skull(d, out);
|
|
37
|
+
out.set(
|
|
38
|
+
out.x * (1 + (scale[0] - 1) * k + more),
|
|
39
|
+
out.y * (1 + (scale[1] - 1) * k + more) * (d.y < 0 ? 1 + drop : 1),
|
|
40
|
+
out.z * (1 + (scale[2] - 1) * k + more),
|
|
41
|
+
);
|
|
42
|
+
outward.copy(out).sub(MIDDLE).normalize();
|
|
43
|
+
return lift ? out.addScaledVector(outward, lift) : out;
|
|
44
|
+
};
|
|
45
|
+
return { at, full, inHair, skull };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// How far across the strands a direction lies, where the hair of a cut lies away from a pole (the crown's whorl, a parting's
|
|
49
|
+
// end, the knot hair is drawn back to): the angle round that pole, in the tag's measure, a whole number of periods to the turn.
|
|
50
|
+
function roundPole(pole) {
|
|
51
|
+
const axis = new THREE.Vector3(...pole).normalize(),
|
|
52
|
+
e1 = new THREE.Vector3(1, 0, 0).addScaledVector(axis, -axis.x).normalize(),
|
|
53
|
+
e2 = new THREE.Vector3().crossVectors(axis, e1),
|
|
54
|
+
turn = TURNS * STRANDS.period;
|
|
55
|
+
const across = d => (Math.atan2(d.dot(e2), d.dot(e1)) / TAU) * turn;
|
|
56
|
+
across.turn = turn;
|
|
57
|
+
across.axis = axis;
|
|
58
|
+
return across;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// The shell of a mass, cut off at the hairline: its points (their place, normal, how far inside the hairline and how far
|
|
62
|
+
// across the strands each lies) and its triangles. Kept by the cut's name.
|
|
63
|
+
function createHairShells(sculptMesh) {
|
|
64
|
+
const shells = new Map();
|
|
65
|
+
return function shellOf(key, mass, across) {
|
|
66
|
+
let shell = shells.get(key);
|
|
67
|
+
if (shell) return shell;
|
|
68
|
+
const soup = sculptMesh('mass:' + key, DETAIL, (d, o) => mass.at(d, 0, o)),
|
|
69
|
+
{ P, N, D } = soup,
|
|
70
|
+
points = [], // x, y, z, the normal, the direction
|
|
71
|
+
inside = [],
|
|
72
|
+
known = new Map(),
|
|
73
|
+
numbered = new Int32Array(soup.n),
|
|
74
|
+
add = (x, y, z, nx, ny, nz, dx, dy, dz, h) => {
|
|
75
|
+
points.push(x, y, z, nx, ny, nz, dx, dy, dz);
|
|
76
|
+
inside.push(h);
|
|
77
|
+
return inside.length - 1;
|
|
78
|
+
};
|
|
79
|
+
// Shared sphere directions have identical positions along the hairline.
|
|
80
|
+
for (let i = 0; i < soup.n; i++) {
|
|
81
|
+
const q = i * 3,
|
|
82
|
+
at = Math.round(D[q] * 2e4) + ',' + Math.round(D[q + 1] * 2e4) + ',' + Math.round(D[q + 2] * 2e4);
|
|
83
|
+
let v = known.get(at);
|
|
84
|
+
if (v === undefined) {
|
|
85
|
+
v = add(P[q], P[q + 1], P[q + 2], N[q], N[q + 1], N[q + 2], D[q], D[q + 1], D[q + 2], mass.inHair(D[q], D[q + 1], D[q + 2]));
|
|
86
|
+
known.set(at, v);
|
|
87
|
+
}
|
|
88
|
+
numbered[i] = v;
|
|
89
|
+
}
|
|
90
|
+
// where the hairline crosses the side from i (inside) to j: found on the mass itself, and kept for the triangle beyond
|
|
91
|
+
const crossings = new Map(),
|
|
92
|
+
cross = (i, j) => {
|
|
93
|
+
const side = i * inside.length + j;
|
|
94
|
+
let v = crossings.get(side);
|
|
95
|
+
if (v !== undefined) return v;
|
|
96
|
+
let low = 0,
|
|
97
|
+
high = 1;
|
|
98
|
+
const a = i * 9,
|
|
99
|
+
b = j * 9;
|
|
100
|
+
for (let s = 0; s < SEAM_STEPS; s++) {
|
|
101
|
+
const t = (low + high) / 2;
|
|
102
|
+
_d.set(points[a + 6], points[a + 7], points[a + 8])
|
|
103
|
+
.lerp(_e1.set(points[b + 6], points[b + 7], points[b + 8]), t)
|
|
104
|
+
.normalize();
|
|
105
|
+
if (mass.inHair(_d.x, _d.y, _d.z) > 0) low = t;
|
|
106
|
+
else high = t;
|
|
107
|
+
}
|
|
108
|
+
_d.set(points[a + 6], points[a + 7], points[a + 8])
|
|
109
|
+
.lerp(_e1.set(points[b + 6], points[b + 7], points[b + 8]), low)
|
|
110
|
+
.normalize();
|
|
111
|
+
mass.at(_d, 0, _o);
|
|
112
|
+
_e2
|
|
113
|
+
.set(points[a + 3], points[a + 4], points[a + 5])
|
|
114
|
+
.lerp(_e1.set(points[b + 3], points[b + 4], points[b + 5]), low)
|
|
115
|
+
.normalize();
|
|
116
|
+
v = add(_o.x, _o.y, _o.z, _e2.x, _e2.y, _e2.z, _d.x, _d.y, _d.z, 0);
|
|
117
|
+
crossings.set(side, v);
|
|
118
|
+
return v;
|
|
119
|
+
};
|
|
120
|
+
const triangles = [],
|
|
121
|
+
poly = [];
|
|
122
|
+
for (let t = 0; t < soup.n; t += 3) {
|
|
123
|
+
poly.length = 0;
|
|
124
|
+
for (let e = 0; e < 3; e++) {
|
|
125
|
+
const i = numbered[t + e],
|
|
126
|
+
j = numbered[t + ((e + 1) % 3)];
|
|
127
|
+
if (inside[i] > 0) poly.push(i);
|
|
128
|
+
if (inside[i] > 0 !== inside[j] > 0) poly.push(inside[i] > 0 ? cross(i, j) : cross(j, i));
|
|
129
|
+
}
|
|
130
|
+
for (let f = 1; f + 1 < poly.length; f++) triangles.push(poly[0], poly[f], poly[f + 1]);
|
|
131
|
+
}
|
|
132
|
+
// how far across the strands each corner lies: of one mind within a triangle, whichever way round the pole its points lie
|
|
133
|
+
const strands = new Float32Array(triangles.length);
|
|
134
|
+
for (let t = 0; t < triangles.length; t += 3) {
|
|
135
|
+
let most = 0;
|
|
136
|
+
for (let e = 0; e < 3; e++) {
|
|
137
|
+
const p = triangles[t + e] * 9;
|
|
138
|
+
let q = across(_d.set(points[p + 6], points[p + 7], points[p + 8]));
|
|
139
|
+
if (e) {
|
|
140
|
+
q += across.turn * Math.round((strands[t] - q) / across.turn);
|
|
141
|
+
most = Math.max(most, Math.abs(q - strands[t]));
|
|
142
|
+
}
|
|
143
|
+
strands[t + e] = q;
|
|
144
|
+
}
|
|
145
|
+
if (most > TOO_WIDE) strands[t + 1] = strands[t + 2] = strands[t];
|
|
146
|
+
}
|
|
147
|
+
shell = { points: new Float32Array(points), inside: new Float32Array(inside), triangles, strands };
|
|
148
|
+
shells.set(key, shell);
|
|
149
|
+
return shell;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Puts a mass's shell on a head. colour(inside, dx, dy, dz, out): the hair's colour at a point so far inside the hairline.
|
|
154
|
+
function placeHairShell(shell, place, colour) {
|
|
155
|
+
const { points, inside, triangles, strands } = shell,
|
|
156
|
+
placed = new Float32Array(triangles.length * POINT),
|
|
157
|
+
corners = new Array(triangles.length),
|
|
158
|
+
v = [0, 0, 0, 0, 0, 0],
|
|
159
|
+
tint = [0, 0, 0];
|
|
160
|
+
// a corner for each triangle's each point: a point shared by triangles that agree on its strands is one point again in the patch
|
|
161
|
+
const same = new Map();
|
|
162
|
+
let count = 0;
|
|
163
|
+
for (let t = 0; t < triangles.length; t++) {
|
|
164
|
+
const p = triangles[t],
|
|
165
|
+
key = p * 8192 + Math.round(strands[t] * 1024) + 4096;
|
|
166
|
+
let at = same.get(key);
|
|
167
|
+
if (at === undefined) {
|
|
168
|
+
at = count++;
|
|
169
|
+
same.set(key, at);
|
|
170
|
+
const q = p * 9,
|
|
171
|
+
k = at * POINT;
|
|
172
|
+
for (let i = 0; i < 6; i++) v[i] = points[q + i];
|
|
173
|
+
place(v);
|
|
174
|
+
colour(inside[p], points[q + 6], points[q + 7], points[q + 8], tint);
|
|
175
|
+
for (let i = 0; i < 6; i++) placed[k + i] = v[i];
|
|
176
|
+
placed[k + 6] = tint[0];
|
|
177
|
+
placed[k + 7] = tint[1];
|
|
178
|
+
placed[k + 8] = tint[2];
|
|
179
|
+
placed[k + 9] = strands[t];
|
|
180
|
+
}
|
|
181
|
+
corners[t] = at;
|
|
182
|
+
}
|
|
183
|
+
return { points: placed.subarray(0, count * POINT), triangles: corners };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { createHairShells, massOf, placeHairShell, roundPole };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const HAIR_FAR = 0.42,
|
|
2
|
+
HAIR_NEAR = 3,
|
|
3
|
+
STRANDS = { span: 0.115, period: 0.25, clumps: 64 }, // clumps: how many locks' widths of strands there are to one of the fraction
|
|
4
|
+
TAG_SLACK = 0.01, // how near a point's tag is to the far hair's to be hair
|
|
5
|
+
isHair = tag => tag >= HAIR_NEAR || Math.abs(tag - HAIR_FAR) < TAG_SLACK;
|
|
6
|
+
export { HAIR_FAR, HAIR_NEAR, STRANDS, isHair };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// The profiles of a bare head (head-shape.js), by height in millimetres from the head's middle, which is the level of the
|
|
3
|
+
// eyes: its slices' width, reach to the front and the back, middle and squareness, and the nose along the face's middle.
|
|
4
|
+
// Each is a smooth curve through measured points, sampled into a table it is read back from.
|
|
5
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
6
|
+
// A smooth curve through [at, value] points that never overshoots them.
|
|
7
|
+
function curve(points) {
|
|
8
|
+
const n = points.length,
|
|
9
|
+
xs = points.map(p => p[0]),
|
|
10
|
+
ys = points.map(p => p[1]),
|
|
11
|
+
slope = [],
|
|
12
|
+
tangent = [];
|
|
13
|
+
for (let i = 0; i < n - 1; i++) slope.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i]));
|
|
14
|
+
for (let i = 0; i < n; i++) {
|
|
15
|
+
const a = slope[i - 1],
|
|
16
|
+
b = slope[i];
|
|
17
|
+
tangent.push(i === 0 ? b : i === n - 1 ? a : a * b <= 0 ? 0 : (2 * a * b) / (a + b));
|
|
18
|
+
}
|
|
19
|
+
const exact = x => {
|
|
20
|
+
if (x <= xs[0]) return ys[0];
|
|
21
|
+
if (x >= xs[n - 1]) return ys[n - 1];
|
|
22
|
+
let i = 0;
|
|
23
|
+
while (x > xs[i + 1]) i++;
|
|
24
|
+
const h = xs[i + 1] - xs[i],
|
|
25
|
+
t = (x - xs[i]) / h,
|
|
26
|
+
t2 = t * t,
|
|
27
|
+
t3 = t2 * t;
|
|
28
|
+
return (
|
|
29
|
+
ys[i] * (2 * t3 - 3 * t2 + 1) + tangent[i] * h * (t3 - 2 * t2 + t) + ys[i + 1] * (3 * t2 - 2 * t3) + tangent[i + 1] * h * (t3 - t2)
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
return sampled(exact, xs[0], xs[n - 1]);
|
|
33
|
+
}
|
|
34
|
+
// A function of a length in millimetres, sampled four times a millimetre and read back along the straight line between two
|
|
35
|
+
// samples: a head asks for its outline many thousand times.
|
|
36
|
+
function sampled(fn, from, to) {
|
|
37
|
+
const PER = 4,
|
|
38
|
+
count = Math.ceil((to - from) * PER),
|
|
39
|
+
table = new Float32Array(count + 2);
|
|
40
|
+
for (let k = 0; k < count + 2; k++) table[k] = fn(Math.min(to, from + k / PER));
|
|
41
|
+
return x => {
|
|
42
|
+
if (x <= from) return table[0];
|
|
43
|
+
if (x >= to) return table[count];
|
|
44
|
+
const f = (x - from) * PER,
|
|
45
|
+
k = f | 0;
|
|
46
|
+
return table[k] + (table[k + 1] - table[k]) * (f - k);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// The slices, by height: half the width, how far the front and the back reach from the middle, where the middle is, and how
|
|
51
|
+
// square the outline is (2 is an ellipse).
|
|
52
|
+
const WIDTH = curve([
|
|
53
|
+
[-118, 52],
|
|
54
|
+
[-100, 53],
|
|
55
|
+
[-85, 56],
|
|
56
|
+
[-67, 63],
|
|
57
|
+
[-45, 68],
|
|
58
|
+
[-22, 72.5],
|
|
59
|
+
[0, 74.5],
|
|
60
|
+
[22, 76],
|
|
61
|
+
[45, 76.5],
|
|
62
|
+
]),
|
|
63
|
+
FRONT = curve([
|
|
64
|
+
[-118, 50],
|
|
65
|
+
[-112, 56],
|
|
66
|
+
[-100, 70],
|
|
67
|
+
[-85, 87],
|
|
68
|
+
[-67, 89],
|
|
69
|
+
[-45, 91.5],
|
|
70
|
+
[-22, 92],
|
|
71
|
+
[0, 93.5],
|
|
72
|
+
[22, 104],
|
|
73
|
+
[45, 102],
|
|
74
|
+
]),
|
|
75
|
+
BACK = curve([
|
|
76
|
+
[-118, 38],
|
|
77
|
+
[-100, 34],
|
|
78
|
+
[-85, 39],
|
|
79
|
+
[-67, 58],
|
|
80
|
+
[-45, 76],
|
|
81
|
+
[-22, 88],
|
|
82
|
+
[0, 92],
|
|
83
|
+
[22, 91.5],
|
|
84
|
+
[45, 90],
|
|
85
|
+
]),
|
|
86
|
+
MIDDLE = curve([
|
|
87
|
+
[-118, 62],
|
|
88
|
+
[-112, 55],
|
|
89
|
+
[-105, 44],
|
|
90
|
+
[-95, 22],
|
|
91
|
+
[-85, 4],
|
|
92
|
+
[-67, 6],
|
|
93
|
+
[-45, 4],
|
|
94
|
+
[-22, 0],
|
|
95
|
+
[0, -4],
|
|
96
|
+
[22, -8],
|
|
97
|
+
[45, -10],
|
|
98
|
+
]),
|
|
99
|
+
SQUARE = curve([
|
|
100
|
+
[-105, 2.1],
|
|
101
|
+
[-85, 2.3],
|
|
102
|
+
[-67, 2.25],
|
|
103
|
+
[-45, 2.15],
|
|
104
|
+
[-22, 2.15],
|
|
105
|
+
[0, 2.15],
|
|
106
|
+
[22, 2.2],
|
|
107
|
+
[45, 2.15],
|
|
108
|
+
]);
|
|
109
|
+
// The nose along the middle of the face: how far its ridge stands out of the face at each height, and half its width there.
|
|
110
|
+
const NOSE_OUT = curve([
|
|
111
|
+
[-52, 0],
|
|
112
|
+
[-50, 1.5],
|
|
113
|
+
[-47.5, 5.5],
|
|
114
|
+
[-45, 12.5],
|
|
115
|
+
[-42, 19.5],
|
|
116
|
+
[-38.5, 24.6],
|
|
117
|
+
[-35, 25.6],
|
|
118
|
+
[-31, 23.6],
|
|
119
|
+
[-24, 19.4],
|
|
120
|
+
[-12, 13],
|
|
121
|
+
[0, 6.6],
|
|
122
|
+
[6, 2.4],
|
|
123
|
+
[12, 0.6],
|
|
124
|
+
[17, 0],
|
|
125
|
+
]),
|
|
126
|
+
NOSE_WIDE = curve([
|
|
127
|
+
[-52, 6],
|
|
128
|
+
[-48, 7],
|
|
129
|
+
[-45, 9],
|
|
130
|
+
[-40, 12],
|
|
131
|
+
[-35, 12.5],
|
|
132
|
+
[-24, 12],
|
|
133
|
+
[-12, 10.5],
|
|
134
|
+
[0, 9.5],
|
|
135
|
+
[17, 10],
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
export { BACK, FRONT, MIDDLE, NOSE_OUT, NOSE_WIDE, SQUARE, WIDTH, sampled };
|