aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src/faceArt.js
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-05 13:23:28 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-05 13:23:28 +0900
commit645b204e26962c9adfc11047052020a777b1ca1d (patch)
treed59cfef382262853e0f0773816e13248fc8d936b /public/bluebey-studio/src/faceArt.js
parenteecb25b1ac52ec87e382ff8249fa3dfb9e295c13 (diff)
bluebey-studio: 髪型の「まえがみ」を「ぎざぎざ」にしてギザギザの生え際に
Diffstat (limited to 'public/bluebey-studio/src/faceArt.js')
-rw-r--r--public/bluebey-studio/src/faceArt.js24
1 files changed, 10 insertions, 14 deletions
diff --git a/public/bluebey-studio/src/faceArt.js b/public/bluebey-studio/src/faceArt.js
index 71e7487..5e99be5 100644
--- a/public/bluebey-studio/src/faceArt.js
+++ b/public/bluebey-studio/src/faceArt.js
@@ -867,14 +867,12 @@ function drawHeadCover(ctx, spec, limits) {
const halfSpan = width / 2;
const boundary = (x) => {
const t = clamp((x - cx) / halfSpan, -1, 1);
- // まえがみ: 富士額 / M字 (a widow's peak). The covering dips to a point at
- // the centre and at the two temples, receding in between - the two valleys
- // and three points of an "M". The points scale with `size`, so a smaller
- // まえがみ is a smaller M rather than a thin band with a tall spike.
+ // ぎざぎざ: a jagged, saw-toothed hairline. A triangle wave across the front
+ // gives the teeth, and `size` scales how far they reach down.
if (shape === 'fringe') {
- const dip = (x, centre, reach) => Math.max(0, 1 - Math.abs(x - centre) / reach);
- const shape01 = Math.max(dip(t, 0, 0.36), 0.6 * Math.max(dip(t, -0.82, 0.26), dip(t, 0.82, 0.26)));
- return base + 190 * size * shape01;
+ const teeth = 8;
+ const saw = Math.abs((((t * teeth) % 2) + 2) % 2 - 1); // 0..1 triangle
+ return base + 200 * size * saw;
}
// はちわれ: the same V upside down - a widow's peak.
if (shape === 'fringe-up') return base - 320 * Math.max(0, 1 - Math.abs(t) * 1.5);
@@ -947,13 +945,11 @@ export function drawHeadCoverWrap(ctx, spec, layout) {
// centre (the peak) and at the temples, with the corners between receded -
// the three peaks and two valleys of an "M". `t` is -1..1 across the front.
if (shape === 'fringe') {
- const dip = (x, centre, reach) => Math.max(0, 1 - Math.abs(x - centre) / reach);
- // The centre dips the lowest, the two temples dip less, and the hairline
- // recedes between them - the two valleys and three points of an "M".
- const shape01 = Math.max(dip(t, 0, 0.36), 0.6 * Math.max(dip(t, -0.82, 0.26), dip(t, 0.82, 0.26)));
- // The points grow with `size`, so a small まえがみ is a small M rather than
- // a thin band with a tall spike (a spindle).
- return base + 0.16 * size * shape01;
+ // ぎざぎざ: a jagged, saw-toothed hairline. A triangle wave across the front
+ // gives the teeth, and `size` scales how far they reach down.
+ const teeth = 8;
+ const saw = Math.abs((((t * teeth) % 2) + 2) % 2 - 1); // 0..1 triangle
+ return base + 0.20 * size * saw;
}
// はちわれ: the same V upside down - a widow's peak.
if (shape === 'fringe-up') return base - 0.18 * Math.max(0, 1 - Math.abs(t) * 1.5);