@johnmorrisdotca/dougu-sports 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/CHANGELOG.md +38 -1
- package/NOTICE.md +9 -58
- package/README.md +168 -32
- package/dist/emblems/award/badge.d.ts +2 -2
- package/dist/emblems/award/badge.js +14 -5
- package/dist/emblems/award/crown.d.ts +1 -1
- package/dist/emblems/award/crown.js +14 -4
- package/dist/emblems/award/medal.d.ts +2 -2
- package/dist/emblems/award/medal.js +14 -5
- package/dist/emblems/award/shield.d.ts +1 -1
- package/dist/emblems/award/shield.js +10 -4
- package/dist/emblems/award/star.d.ts +1 -1
- package/dist/emblems/award/star.js +10 -4
- package/dist/emblems/ball/ball.afl.js +1 -1
- package/dist/emblems/ball/ball.basketball6.js +1 -1
- package/dist/emblems/ball/ball.core.d.ts +9 -3
- package/dist/emblems/ball/ball.core.js +13 -0
- package/dist/emblems/ball/ball.cricket.js +1 -1
- package/dist/emblems/ball/ball.engine.js +3 -3
- package/dist/emblems/ball/ball.football.js +3 -3
- package/dist/emblems/ball/ball.gaelic.js +1 -1
- package/dist/emblems/ball/ball.object.js +2 -2
- package/dist/emblems/ball/ball.shuttlecock.js +2 -2
- package/dist/emblems/ball/ball.squash.js +5 -5
- package/dist/emblems/emblem.api.d.ts +39 -1
- package/dist/emblems/emblem.api.js +20 -2
- package/dist/emblems/emblem.compose.d.ts +31 -0
- package/dist/emblems/emblem.compose.js +91 -0
- package/dist/emblems/emblem.core.d.ts +48 -2
- package/dist/emblems/emblem.core.js +30 -0
- package/dist/emblems/emblem.descriptions.d.ts +7 -0
- package/dist/emblems/emblem.descriptions.js +60 -0
- package/dist/emblems/emblem.display.d.ts +75 -0
- package/dist/emblems/emblem.display.js +214 -0
- package/dist/emblems/emblem.engrave.d.ts +50 -0
- package/dist/emblems/emblem.engrave.js +145 -0
- package/dist/emblems/emblem.equipment.d.ts +24 -0
- package/dist/emblems/emblem.equipment.js +57 -0
- package/dist/emblems/emblem.flip.d.ts +10 -0
- package/dist/emblems/emblem.flip.js +45 -0
- package/dist/emblems/emblem.ids.d.ts +19 -11
- package/dist/emblems/emblem.ids.js +21 -6
- package/dist/emblems/emblem.lathe.d.ts +3 -0
- package/dist/emblems/emblem.lathe.js +26 -4
- package/dist/emblems/emblem.medal.js +4 -4
- package/dist/emblems/emblem.pennant.d.ts +3 -0
- package/dist/emblems/emblem.pennant.js +79 -0
- package/dist/emblems/emblem.registry.js +20 -0
- package/dist/emblems/emblem.shapes.d.ts +19 -2
- package/dist/emblems/emblem.shapes.js +53 -12
- package/dist/emblems/emblem.sprite.d.ts +38 -0
- package/dist/emblems/emblem.sprite.js +65 -0
- package/dist/emblems/emblem.uri.d.ts +22 -0
- package/dist/emblems/emblem.uri.js +29 -0
- package/dist/emblems/gear/gear.badmintonracket.d.ts +1 -1
- package/dist/emblems/gear/gear.badmintonracket.js +18 -14
- package/dist/emblems/gear/gear.baseballglove.d.ts +1 -1
- package/dist/emblems/gear/gear.baseballglove.js +20 -14
- package/dist/emblems/gear/gear.budo.d.ts +17 -0
- package/dist/emblems/gear/gear.budo.js +60 -0
- package/dist/emblems/gear/gear.core.d.ts +12 -31
- package/dist/emblems/gear/gear.core.js +61 -54
- package/dist/emblems/gear/gear.cricketbat.d.ts +1 -1
- package/dist/emblems/gear/gear.cricketbat.js +16 -14
- package/dist/emblems/gear/gear.fieldhockeystick.d.ts +1 -1
- package/dist/emblems/gear/gear.fieldhockeystick.js +15 -14
- package/dist/emblems/gear/gear.footballhelmet.d.ts +1 -1
- package/dist/emblems/gear/gear.footballhelmet.js +15 -14
- package/dist/emblems/gear/gear.goaliemask.d.ts +1 -1
- package/dist/emblems/gear/gear.goaliemask.js +22 -16
- package/dist/emblems/gear/gear.goalnet.d.ts +1 -1
- package/dist/emblems/gear/gear.goalnet.js +24 -14
- package/dist/emblems/gear/gear.hockeystick.d.ts +1 -1
- package/dist/emblems/gear/gear.hockeystick.js +14 -14
- package/dist/emblems/gear/gear.index.js +5 -1
- package/dist/emblems/gear/gear.kendo.d.ts +2 -0
- package/dist/emblems/gear/gear.kendo.js +41 -0
- package/dist/emblems/gear/gear.kyudo.d.ts +2 -0
- package/dist/emblems/gear/gear.kyudo.js +31 -0
- package/dist/emblems/gear/gear.lacrossestick.d.ts +1 -1
- package/dist/emblems/gear/gear.lacrossestick.js +25 -14
- package/dist/emblems/gear/gear.skates.js +1 -1
- package/dist/emblems/gear/gear.sticks.js +2 -2
- package/dist/emblems/gear/gear.sumo.d.ts +2 -0
- package/dist/emblems/gear/gear.sumo.js +43 -0
- package/dist/emblems/gear/gear.tabletennispaddle.d.ts +1 -1
- package/dist/emblems/gear/gear.tabletennispaddle.js +15 -14
- package/dist/emblems/gear/gear.tennisracket.d.ts +1 -1
- package/dist/emblems/gear/gear.tennisracket.js +16 -14
- package/dist/emblems/pennant/championship.d.ts +2 -0
- package/dist/emblems/pennant/championship.js +4 -0
- package/dist/emblems/sport/afl.js +1 -1
- package/dist/emblems/sport/artisticswimming.js +1 -1
- package/dist/emblems/sport/cfl.d.ts +1 -1
- package/dist/emblems/sport/cfl.js +4 -4
- package/dist/emblems/sport/cricket.d.ts +1 -1
- package/dist/emblems/sport/cricket.js +13 -4
- package/dist/emblems/sport/fieldhockey.js +1 -1
- package/dist/emblems/sport/gaelic.js +1 -1
- package/dist/emblems/sport/handball.d.ts +1 -1
- package/dist/emblems/sport/handball.js +14 -4
- package/dist/emblems/sport/ifaf.d.ts +1 -1
- package/dist/emblems/sport/ifaf.js +4 -4
- package/dist/emblems/sport/judo.d.ts +2 -0
- package/dist/emblems/sport/judo.js +13 -0
- package/dist/emblems/sport/karate.d.ts +2 -0
- package/dist/emblems/sport/karate.js +13 -0
- package/dist/emblems/sport/kendo.d.ts +2 -0
- package/dist/emblems/sport/kendo.js +14 -0
- package/dist/emblems/sport/kyudo.d.ts +2 -0
- package/dist/emblems/sport/kyudo.js +15 -0
- package/dist/emblems/sport/mlb.d.ts +1 -1
- package/dist/emblems/sport/mlb.js +27 -4
- package/dist/emblems/sport/nba.d.ts +1 -1
- package/dist/emblems/sport/nba.js +11 -4
- package/dist/emblems/sport/netball.js +1 -1
- package/dist/emblems/sport/nfl.d.ts +2 -1
- package/dist/emblems/sport/nfl.js +14 -4
- package/dist/emblems/sport/nhl.d.ts +1 -1
- package/dist/emblems/sport/nhl.js +12 -4
- package/dist/emblems/sport/pickleball.js +1 -1
- package/dist/emblems/sport/racquetball.js +1 -1
- package/dist/emblems/sport/roundnet.js +1 -1
- package/dist/emblems/sport/rugby.d.ts +1 -1
- package/dist/emblems/sport/rugby.js +11 -4
- package/dist/emblems/sport/sepaktakraw.js +1 -1
- package/dist/emblems/sport/soccer.d.ts +1 -1
- package/dist/emblems/sport/soccer.js +30 -4
- package/dist/emblems/sport/squash.js +1 -1
- package/dist/emblems/sport/sumo.d.ts +2 -0
- package/dist/emblems/sport/sumo.js +15 -0
- package/dist/emblems/sport/tabletennis.js +1 -1
- package/dist/emblems/sport/tennis.d.ts +1 -1
- package/dist/emblems/sport/tennis.js +14 -4
- package/dist/emblems/sport/teqball.js +1 -1
- package/dist/emblems/sport/volleyball.d.ts +1 -1
- package/dist/emblems/sport/volleyball.js +24 -4
- package/dist/emblems/trophy/banner.d.ts +2 -0
- package/dist/emblems/trophy/banner.js +20 -0
- package/dist/emblems/trophy/baseball.js +1 -0
- package/dist/emblems/trophy/basketball.js +1 -0
- package/dist/emblems/trophy/belt.js +2 -1
- package/dist/emblems/trophy/bowl.js +1 -0
- package/dist/emblems/trophy/canadian-bowl.js +1 -0
- package/dist/emblems/trophy/championship-banner.d.ts +2 -0
- package/dist/emblems/trophy/championship-banner.js +67 -0
- package/dist/emblems/trophy/cricket-urn.js +1 -0
- package/dist/emblems/trophy/cup.d.ts +1 -1
- package/dist/emblems/trophy/cup.js +15 -4
- package/dist/emblems/trophy/football.js +2 -1
- package/dist/emblems/trophy/globe.js +1 -0
- package/dist/emblems/trophy/hockey-cup.js +2 -1
- package/dist/emblems/trophy/lidded-cup.js +1 -0
- package/dist/emblems/trophy/plaque.js +2 -1
- package/dist/emblems/trophy/ring.d.ts +2 -0
- package/dist/emblems/trophy/ring.js +30 -0
- package/dist/emblems/trophy/rugby-cup.js +1 -0
- package/dist/emblems/trophy/salver.js +1 -0
- package/dist/emblems/trophy/soccer-ball.js +2 -1
- package/dist/emblems/trophy/soccer-globe.js +1 -0
- package/dist/emblems/trophy/sumo-cup.d.ts +2 -0
- package/dist/emblems/trophy/sumo-cup.js +28 -0
- package/dist/emblems/trophy/tennis-cup.js +2 -1
- package/dist/emblems/trophy/tennis-plate.js +1 -0
- package/dist/emblems-entry.d.ts +15 -6
- package/dist/emblems-entry.js +7 -2
- package/dist/index.d.ts +17 -0
- package/dist/index.js +15 -0
- package/dist/turn-control.d.ts +101 -0
- package/dist/turn-control.js +363 -0
- package/dist/turn-entry.d.ts +2 -0
- package/dist/turn-entry.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -1
- package/LICENSES/Apache-2.0.txt +0 -202
- package/LICENSES/CC-BY-3.0.txt +0 -319
- package/LICENSES/upstream/game-icons.license.txt +0 -45
- package/LICENSES/upstream/noto-emoji-2D-svg.LICENSE +0 -13
- package/LICENSES/upstream/pictogrammers-mdi.LICENSE +0 -20
- package/dist/emblems/emblem.material.d.ts +0 -9
- package/dist/emblems/emblem.material.data.d.ts +0 -34
- package/dist/emblems/emblem.material.data.js +0 -85
- package/dist/emblems/emblem.material.js +0 -23
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const GOLD = "medal:gold";
|
|
2
|
+
const TABLE = {
|
|
3
|
+
nfl: ["ball:football", ["gear:football-helmet", "gear:goalposts"], "trophy:football"],
|
|
4
|
+
cfl: ["ball:football-cfl", ["gear:football-helmet", "gear:goalposts"], "trophy:canadian-bowl"],
|
|
5
|
+
ifaf: ["ball:football-ifaf", ["gear:football-helmet", "gear:goalposts"], "trophy:cup"],
|
|
6
|
+
nhl: ["ball:puck", ["gear:hockey-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net"], "trophy:hockey-cup"],
|
|
7
|
+
nba: ["ball:basketball", ["gear:basketball-hoop"], "trophy:basketball"],
|
|
8
|
+
mlb: ["ball:baseball", ["gear:baseball-bat", "gear:baseball-glove"], "trophy:baseball"],
|
|
9
|
+
soccer: ["ball:soccer", ["gear:goal-net"], "trophy:soccer-globe", GOLD],
|
|
10
|
+
curling: ["ball:curling-stone", ["gear:curling-broom"], "trophy:bowl", GOLD],
|
|
11
|
+
tennis: ["ball:tennis", ["gear:tennis-racket"], "trophy:tennis-cup", GOLD],
|
|
12
|
+
volleyball: ["ball:volleyball", ["gear:volleyball-net"], "trophy:cup", GOLD],
|
|
13
|
+
badminton: ["ball:shuttlecock-feather", ["gear:badminton-racket"], "trophy:cup", GOLD],
|
|
14
|
+
pickleball: ["ball:pickleball-outdoor", ["gear:pickleball-paddle"], "trophy:cup"],
|
|
15
|
+
tabletennis: ["ball:table-tennis", ["gear:table-tennis-paddle"], "trophy:cup", GOLD],
|
|
16
|
+
padel: ["ball:padel", ["gear:padel-racket"], "trophy:cup"],
|
|
17
|
+
squash: ["ball:squash", ["gear:squash-racket"], "trophy:cup", GOLD],
|
|
18
|
+
racquetball: ["ball:racquetball", ["gear:racquetball-racket"], "trophy:cup"],
|
|
19
|
+
sepaktakraw: ["ball:sepak-takraw", [], "trophy:cup"],
|
|
20
|
+
teqball: ["ball:teqball", [], "trophy:cup"],
|
|
21
|
+
roundnet: ["ball:roundnet", ["gear:roundnet-set"], "trophy:cup"],
|
|
22
|
+
netball: ["ball:netball", [], "trophy:cup"],
|
|
23
|
+
swimming: [undefined, ["gear:swim-goggles"], "trophy:cup", GOLD],
|
|
24
|
+
waterpolo: ["ball:water-polo", ["gear:swim-goggles"], "trophy:cup", GOLD],
|
|
25
|
+
diving: [undefined, ["gear:diving-board"], "trophy:cup", GOLD],
|
|
26
|
+
artisticswimming: [undefined, ["gear:swim-goggles"], "trophy:cup", GOLD],
|
|
27
|
+
lacrosse: ["ball:lacrosse", ["gear:lacrosse-stick"], "trophy:cup", GOLD],
|
|
28
|
+
rugby: ["ball:rugby", ["gear:goalposts"], "trophy:rugby-cup", GOLD],
|
|
29
|
+
afl: ["ball:afl", ["gear:goalposts"], "trophy:cup"],
|
|
30
|
+
gaelic: ["ball:sliotar", ["gear:hurley", "gear:goalposts"], "trophy:cup"],
|
|
31
|
+
cricket: ["ball:cricket-red", ["gear:cricket-bat", "gear:wicket"], "trophy:cricket-urn", GOLD],
|
|
32
|
+
fieldhockey: ["ball:field-hockey", ["gear:field-hockey-stick", "gear:goal-net"], "trophy:cup", GOLD],
|
|
33
|
+
handball: ["ball:handball", ["gear:goal-net"], "trophy:cup", GOLD],
|
|
34
|
+
athletics: ["ball:shot", ["gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles"], "trophy:laurel", GOLD],
|
|
35
|
+
skating: [undefined, ["gear:figure-skate", "gear:speed-skate"], "trophy:cup", GOLD],
|
|
36
|
+
sumo: [undefined, ["gear:gunbai", "gear:mawashi"], "trophy:sumo-cup"],
|
|
37
|
+
kendo: [undefined, ["gear:shinai", "gear:kendo-men"], "trophy:cup"],
|
|
38
|
+
judo: [undefined, ["gear:judogi", "gear:obi"], "trophy:cup", GOLD],
|
|
39
|
+
kyudo: [undefined, ["gear:yumi", "gear:ya"], "trophy:cup"],
|
|
40
|
+
karate: [undefined, ["gear:karate-gi"], "trophy:cup", GOLD],
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* What a sport is played and won with, as ids of the registry: `sportEquipment("nhl")` is the puck, a stick, a skate, a goalie's mask and a net, and the hockey cup. The arrays are new each call. An unknown sport is an error.
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { sportEquipment } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
47
|
+
* const nhl = sportEquipment("nhl");
|
|
48
|
+
* console.log(nhl.ball, nhl.trophy);
|
|
49
|
+
* // ball:puck trophy:hockey-cup
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function sportEquipment(sport) {
|
|
53
|
+
if (!Object.hasOwn(TABLE, sport))
|
|
54
|
+
throw new Error(`Unknown sport "${String(sport).slice(0, 40)}": the equipment is for the names in SPORT_NAMES.`);
|
|
55
|
+
const [ball, gear, trophy, medal] = TABLE[sport];
|
|
56
|
+
return { sport, ...(ball === undefined ? {} : { ball }), gear: [...gear], trophy, ...(medal === undefined ? {} : { medal }) };
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What a turn needs. `line` is the line style (the rim is drawn in the page's ink), `back` is the document of the back view, and `thick` is the thickness as a fraction of the width. */
|
|
2
|
+
export interface FlipOptions {
|
|
3
|
+
yaw: number;
|
|
4
|
+
pitch: number;
|
|
5
|
+
line?: boolean;
|
|
6
|
+
back?: string;
|
|
7
|
+
thick?: number;
|
|
8
|
+
}
|
|
9
|
+
/** A document turned by `yaw` and `pitch` degrees from its still drawing. With no turn it is the document itself. */
|
|
10
|
+
export declare function flipSvg(svg: string, o: FlipOptions): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The coin-flip turn for any flat drawing: it takes a finished document and returns it turned. The face is squeezed by the cosine of the yaw and shows its back past a quarter turn, and the rim
|
|
2
|
+
// (the thickness of the sheet) shows as a dark edge on the side that is turning away, widest when the drawing is edge on. A piece with no drawing of its own for the back (a bat, a racket, a pictogram)
|
|
3
|
+
// shows its front mirrored and a little darker, as the other side of a cut-out; a pennant passes the drawing of its back. A pure function of strings and numbers; it imports nothing.
|
|
4
|
+
const RAD = Math.PI / 180;
|
|
5
|
+
const n2 = (value) => String(Math.round(value * 100) / 100 + 0);
|
|
6
|
+
/** The parts of a document of SVG: its opening tag, its titles, and the rest. */
|
|
7
|
+
function split(svg) {
|
|
8
|
+
const open = /^<svg[^>]*>/.exec(svg)?.[0] ?? "";
|
|
9
|
+
const after = svg.slice(open.length, svg.length - "</svg>".length);
|
|
10
|
+
const head = /^<title>[\s\S]*?<\/title>(?:<desc>[\s\S]*?<\/desc>)?/.exec(after)?.[0] ?? "";
|
|
11
|
+
const box = (/viewBox="([^"]*)"/.exec(open)?.[1] ?? "0 0 64 64").split(/\s+/).map(Number);
|
|
12
|
+
return { open, head, rest: after.slice(head.length), box: [box[0] ?? 0, box[1] ?? 0, box[2] || 64, box[3] || 64] };
|
|
13
|
+
}
|
|
14
|
+
/** A document turned by `yaw` and `pitch` degrees from its still drawing. With no turn it is the document itself. */
|
|
15
|
+
export function flipSvg(svg, o) {
|
|
16
|
+
if (o.yaw === 0 && o.pitch === 0)
|
|
17
|
+
return svg;
|
|
18
|
+
const across = Math.cos(o.yaw * RAD);
|
|
19
|
+
const tilt = Math.cos(o.pitch * RAD);
|
|
20
|
+
const front = split(svg);
|
|
21
|
+
const showBack = across < 0;
|
|
22
|
+
const own = showBack && o.back !== undefined ? split(o.back) : undefined;
|
|
23
|
+
const face = own ?? front;
|
|
24
|
+
const [x0, y0, w, h] = front.box;
|
|
25
|
+
const sx = Math.max(Math.abs(across), 0.02);
|
|
26
|
+
const sy = Math.max(Math.abs(tilt), 0.02);
|
|
27
|
+
const thick = w * (o.thick ?? 0.035);
|
|
28
|
+
const dx = thick * Math.sin(o.yaw * RAD);
|
|
29
|
+
const dy = -thick * Math.sin(o.pitch * RAD) * 0.6;
|
|
30
|
+
const mirror = showBack && own === undefined;
|
|
31
|
+
const cx = x0 + w / 2;
|
|
32
|
+
const cy = y0 + h / 2;
|
|
33
|
+
// The turned face, then the filter that adds the rim behind it (and dims a mirrored back).
|
|
34
|
+
// The id names everything the definition depends on (its region comes from the box), so two drawings in one page that share an id share one filter.
|
|
35
|
+
const id = `dgf${o.line === true ? "l" : "c"}${mirror ? "b" : "f"}${Math.round(dx * 100)}_${Math.round(dy * 100)}_${[x0, y0, w, h].map((v) => Math.round(v)).join("_")}`;
|
|
36
|
+
const flood = o.line === true ? '<feFlood flood-color="currentColor" flood-opacity=".5"/>' : '<feFlood flood-color="#000" flood-opacity=".42"/>';
|
|
37
|
+
const steps = [1, 2, 3].map((k) => (Math.abs(dx) + Math.abs(dy) < 0.05 ? "" : `<feOffset in="s" dx="${n2((dx * k) / 3)}" dy="${n2((dy * k) / 3)}" result="o${k}"/>`)).join("");
|
|
38
|
+
const nodes = Math.abs(dx) + Math.abs(dy) < 0.05 ? "" : '<feMergeNode in="o3"/><feMergeNode in="o2"/><feMergeNode in="o1"/>';
|
|
39
|
+
const dim = mirror && o.line !== true ? '<feColorMatrix in="SourceGraphic" values=".8 0 0 0 0 0 .8 0 0 0 0 0 .8 0 0 0 0 0 1 0" result="d"/>' : "";
|
|
40
|
+
const filter = `<filter id="${id}" x="${n2(x0 - w * 0.15)}" y="${n2(y0 - h * 0.15)}" width="${n2(w * 1.3)}" height="${n2(h * 1.3)}" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">` +
|
|
41
|
+
`${flood}<feComposite in2="SourceAlpha" operator="in" result="s"/>${steps}${dim}<feMerge>${nodes}<feMergeNode in="${dim === "" ? "SourceGraphic" : "d"}"/></feMerge></filter>`;
|
|
42
|
+
const flip = mirror ? -1 : 1;
|
|
43
|
+
const group = `<g filter="url(#${id})"><g transform="translate(${n2(cx)} ${n2(cy)}) scale(${n2(sx * flip)} ${n2(sy)}) translate(${n2(-cx)} ${n2(-cy)})">${face.rest}</g></g>`;
|
|
44
|
+
return `${front.open}${front.head}<defs>${filter}</defs>${group}</svg>`;
|
|
45
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** The thirty-
|
|
2
|
-
export declare const SPORT_NAMES: readonly ["nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball", "swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating"];
|
|
1
|
+
/** The thirty-eight sports the emblems are made for (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
|
|
2
|
+
export declare const SPORT_NAMES: readonly ["nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball", "swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating", "sumo", "kendo", "judo", "kyudo", "karate"];
|
|
3
3
|
export type SportName = (typeof SPORT_NAMES)[number];
|
|
4
|
-
/** The awards
|
|
4
|
+
/** The awards: a medal on a ribbon, a badge, a crown, a star and a shield. */
|
|
5
5
|
export declare const AWARD_IDS: readonly ["award:medal", "award:badge", "award:crown", "award:star", "award:shield"];
|
|
6
6
|
export type AwardId = (typeof AWARD_IDS)[number];
|
|
7
7
|
/** The trophies: a cup for each league's champion in a descriptive, generic form, the plain cups and dishes, and the flat plaque, belt, wreath and rosette. */
|
|
8
|
-
export declare const TROPHY_IDS: readonly ["trophy:cup", "trophy:lidded-cup", "trophy:bowl", "trophy:salver", "trophy:globe", "trophy:hockey-cup", "trophy:basketball", "trophy:baseball", "trophy:football", "trophy:canadian-bowl", "trophy:soccer-ball", "trophy:soccer-globe", "trophy:tennis-plate", "trophy:tennis-cup", "trophy:cricket-urn", "trophy:rugby-cup", "trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette"];
|
|
8
|
+
export declare const TROPHY_IDS: readonly ["trophy:cup", "trophy:lidded-cup", "trophy:bowl", "trophy:salver", "trophy:globe", "trophy:hockey-cup", "trophy:basketball", "trophy:baseball", "trophy:football", "trophy:canadian-bowl", "trophy:soccer-ball", "trophy:soccer-globe", "trophy:tennis-plate", "trophy:tennis-cup", "trophy:cricket-urn", "trophy:rugby-cup", "trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette", "trophy:ring", "trophy:banner", "trophy:sumo-cup", "trophy:championship-banner"];
|
|
9
9
|
export type TrophyId = (typeof TROPHY_IDS)[number];
|
|
10
10
|
/** The medals on a ribbon, and the badges for the first three places. */
|
|
11
11
|
export declare const MEDAL_KINDS: readonly ["gold", "silver", "bronze"];
|
|
@@ -20,23 +20,30 @@ export type CrestId = (typeof CREST_IDS)[number];
|
|
|
20
20
|
/** The balls: one for each ball and implement the sports use, in 3D, with the official size it comes from. The balls of one family (the three crickets, the five squash balls) share a module. */
|
|
21
21
|
export declare const BALL_IDS: readonly ["ball:soccer", "ball:soccer-colour", "ball:teqball", "ball:basketball", "ball:basketball-6", "ball:basketball-3x3", "ball:baseball", "ball:softball", "ball:tennis", "ball:padel", "ball:sliotar", "ball:volleyball", "ball:volleyball-8", "ball:beach-volleyball", "ball:cricket-red", "ball:cricket-white", "ball:cricket-pink", "ball:football", "ball:football-cfl", "ball:football-ifaf", "ball:rugby", "ball:afl", "ball:gaelic-football", "ball:netball", "ball:pickleball-outdoor", "ball:pickleball-indoor", "ball:squash", "ball:squash-yellow", "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf", "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"];
|
|
22
22
|
export type BallId = (typeof BALL_IDS)[number];
|
|
23
|
-
/** The pieces of gear: a piece of equipment for each sport, flat, drawn
|
|
24
|
-
export declare const GEAR_IDS: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles"];
|
|
23
|
+
/** The pieces of gear: a piece of equipment for each sport, flat, drawn for this package, turning like a coin. */
|
|
24
|
+
export declare const GEAR_IDS: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles", "gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:obi", "gear:yumi", "gear:ya", "gear:karate-gi"];
|
|
25
25
|
export type GearId = (typeof GEAR_IDS)[number];
|
|
26
|
-
/** The sports
|
|
26
|
+
/** The Japanese sports and budo: sumo, kendo, judo, kyudo and karate, with the trophies and the gear that belong to them. Every one is also in its own group; this list is for showing them together. */
|
|
27
|
+
export declare const JAPANESE_IDS: readonly ["sport:sumo", "trophy:sumo-cup", "gear:gunbai", "gear:mawashi", "trophy:championship-banner", "sport:kendo", "gear:shinai", "gear:kendo-men", "sport:judo", "gear:judogi", "gear:obi", "sport:kyudo", "gear:yumi", "gear:ya", "sport:karate", "gear:karate-gi"];
|
|
28
|
+
export type JapaneseId = (typeof JAPANESE_IDS)[number];
|
|
29
|
+
/** The pennants: a felt championship pennant with a stitched edge. */
|
|
30
|
+
export declare const PENNANT_IDS: readonly ["pennant:championship"];
|
|
31
|
+
export type PennantId = (typeof PENNANT_IDS)[number];
|
|
32
|
+
/** The sports' own emblems: one pictogram for each of the thirty-eight. */
|
|
27
33
|
export type SportEmblemId = `sport:${SportName}`;
|
|
28
34
|
export declare const SPORT_IDS: readonly SportEmblemId[];
|
|
29
35
|
/** Every emblem id. */
|
|
30
|
-
export type EmblemId = AwardId | TrophyId | MedalId | CrestId | BallId | GearId | SportEmblemId;
|
|
36
|
+
export type EmblemId = AwardId | TrophyId | MedalId | CrestId | BallId | GearId | SportEmblemId | PennantId;
|
|
31
37
|
/** The groups of ids, in the order a gallery shows them. */
|
|
32
38
|
export declare const EMBLEM_GROUPS: {
|
|
33
39
|
readonly award: readonly ["award:medal", "award:badge", "award:crown", "award:star", "award:shield"];
|
|
34
|
-
readonly trophy: readonly ["trophy:cup", "trophy:lidded-cup", "trophy:bowl", "trophy:salver", "trophy:globe", "trophy:hockey-cup", "trophy:basketball", "trophy:baseball", "trophy:football", "trophy:canadian-bowl", "trophy:soccer-ball", "trophy:soccer-globe", "trophy:tennis-plate", "trophy:tennis-cup", "trophy:cricket-urn", "trophy:rugby-cup", "trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette"];
|
|
40
|
+
readonly trophy: readonly ["trophy:cup", "trophy:lidded-cup", "trophy:bowl", "trophy:salver", "trophy:globe", "trophy:hockey-cup", "trophy:basketball", "trophy:baseball", "trophy:football", "trophy:canadian-bowl", "trophy:soccer-ball", "trophy:soccer-globe", "trophy:tennis-plate", "trophy:tennis-cup", "trophy:cricket-urn", "trophy:rugby-cup", "trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette", "trophy:ring", "trophy:banner", "trophy:sumo-cup", "trophy:championship-banner"];
|
|
35
41
|
readonly medal: readonly ["medal:gold", "medal:silver", "medal:bronze", "medal:place-1", "medal:place-2", "medal:place-3"];
|
|
36
42
|
readonly crest: readonly ["crest:shield", "crest:roundel", "crest:diamond", "crest:pennant"];
|
|
37
43
|
readonly ball: readonly ["ball:soccer", "ball:soccer-colour", "ball:teqball", "ball:basketball", "ball:basketball-6", "ball:basketball-3x3", "ball:baseball", "ball:softball", "ball:tennis", "ball:padel", "ball:sliotar", "ball:volleyball", "ball:volleyball-8", "ball:beach-volleyball", "ball:cricket-red", "ball:cricket-white", "ball:cricket-pink", "ball:football", "ball:football-cfl", "ball:football-ifaf", "ball:rugby", "ball:afl", "ball:gaelic-football", "ball:netball", "ball:pickleball-outdoor", "ball:pickleball-indoor", "ball:squash", "ball:squash-yellow", "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf", "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"];
|
|
38
|
-
readonly gear: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles"];
|
|
39
|
-
readonly sport: readonly ("sport:nfl" | "sport:cfl" | "sport:ifaf" | "sport:nhl" | "sport:nba" | "sport:mlb" | "sport:soccer" | "sport:curling" | "sport:tennis" | "sport:volleyball" | "sport:badminton" | "sport:pickleball" | "sport:tabletennis" | "sport:padel" | "sport:squash" | "sport:racquetball" | "sport:sepaktakraw" | "sport:teqball" | "sport:roundnet" | "sport:netball" | "sport:swimming" | "sport:waterpolo" | "sport:diving" | "sport:artisticswimming" | "sport:lacrosse" | "sport:rugby" | "sport:afl" | "sport:gaelic" | "sport:cricket" | "sport:fieldhockey" | "sport:handball" | "sport:athletics" | "sport:skating")[];
|
|
44
|
+
readonly gear: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles", "gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:obi", "gear:yumi", "gear:ya", "gear:karate-gi"];
|
|
45
|
+
readonly sport: readonly ("sport:sumo" | "sport:kendo" | "sport:judo" | "sport:kyudo" | "sport:karate" | "sport:nfl" | "sport:cfl" | "sport:ifaf" | "sport:nhl" | "sport:nba" | "sport:mlb" | "sport:soccer" | "sport:curling" | "sport:tennis" | "sport:volleyball" | "sport:badminton" | "sport:pickleball" | "sport:tabletennis" | "sport:padel" | "sport:squash" | "sport:racquetball" | "sport:sepaktakraw" | "sport:teqball" | "sport:roundnet" | "sport:netball" | "sport:swimming" | "sport:waterpolo" | "sport:diving" | "sport:artisticswimming" | "sport:lacrosse" | "sport:rugby" | "sport:afl" | "sport:gaelic" | "sport:cricket" | "sport:fieldhockey" | "sport:handball" | "sport:athletics" | "sport:skating")[];
|
|
46
|
+
readonly pennant: readonly ["pennant:championship"];
|
|
40
47
|
};
|
|
41
48
|
export type EmblemGroup = keyof typeof EMBLEM_GROUPS;
|
|
42
49
|
/** Every id, in group order. */
|
|
@@ -50,6 +57,7 @@ export declare const EMBLEM_FOLDERS: {
|
|
|
50
57
|
readonly ball: "ball";
|
|
51
58
|
readonly gear: "gear";
|
|
52
59
|
readonly sport: "sport";
|
|
60
|
+
readonly pennant: "pennant";
|
|
53
61
|
};
|
|
54
62
|
/** The short names of the trophies and awards that stand for a full id: `"cup"` is `"trophy:cup"` and `"crown"` is `"award:crown"`. */
|
|
55
63
|
export declare const EMBLEM_ALIASES: Readonly<Record<string, EmblemId>>;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
// The ids of the emblems, in their groups, and the types they make. Nothing is imported: this file is only names, so it costs nothing to read. An id is `<group>:<name>`.
|
|
2
2
|
// Each list below holds the emblems that exist. The art for the rest arrives group by group (docs/layout.md), and each arrival adds its names here and its entry to emblem.registry.ts.
|
|
3
|
-
/** The thirty-
|
|
3
|
+
/** The thirty-eight sports the emblems are made for (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
|
|
4
4
|
export const SPORT_NAMES = [
|
|
5
5
|
"nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball",
|
|
6
6
|
"swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating",
|
|
7
|
+
"sumo", "kendo", "judo", "kyudo", "karate",
|
|
7
8
|
];
|
|
8
|
-
/** The awards
|
|
9
|
+
/** The awards: a medal on a ribbon, a badge, a crown, a star and a shield. */
|
|
9
10
|
export const AWARD_IDS = ["award:medal", "award:badge", "award:crown", "award:star", "award:shield"];
|
|
10
11
|
/** The trophies: a cup for each league's champion in a descriptive, generic form, the plain cups and dishes, and the flat plaque, belt, wreath and rosette. */
|
|
11
12
|
export const TROPHY_IDS = [
|
|
12
13
|
"trophy:cup", "trophy:lidded-cup", "trophy:bowl", "trophy:salver", "trophy:globe",
|
|
13
14
|
"trophy:hockey-cup", "trophy:basketball", "trophy:baseball", "trophy:football", "trophy:canadian-bowl", "trophy:soccer-ball", "trophy:soccer-globe",
|
|
14
15
|
"trophy:tennis-plate", "trophy:tennis-cup", "trophy:cricket-urn", "trophy:rugby-cup",
|
|
15
|
-
"trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette",
|
|
16
|
+
"trophy:plaque", "trophy:belt", "trophy:laurel", "trophy:rosette", "trophy:ring", "trophy:banner",
|
|
17
|
+
"trophy:sumo-cup", "trophy:championship-banner",
|
|
16
18
|
];
|
|
17
19
|
/** The medals on a ribbon, and the badges for the first three places. */
|
|
18
20
|
export const MEDAL_KINDS = ["gold", "silver", "bronze"];
|
|
@@ -28,13 +30,25 @@ export const BALL_IDS = [
|
|
|
28
30
|
"ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf",
|
|
29
31
|
"ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"
|
|
30
32
|
];
|
|
31
|
-
/** The pieces of gear: a piece of equipment for each sport, flat, drawn
|
|
33
|
+
/** The pieces of gear: a piece of equipment for each sport, flat, drawn for this package, turning like a coin. */
|
|
32
34
|
export const GEAR_IDS = [
|
|
33
35
|
"gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket",
|
|
34
36
|
"gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle",
|
|
35
37
|
"gear:roundnet-set", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley",
|
|
36
|
-
"gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles"
|
|
38
|
+
"gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles",
|
|
39
|
+
"gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:obi", "gear:yumi", "gear:ya", "gear:karate-gi"
|
|
37
40
|
];
|
|
41
|
+
/** The Japanese sports and budo: sumo, kendo, judo, kyudo and karate, with the trophies and the gear that belong to them. Every one is also in its own group; this list is for showing them together. */
|
|
42
|
+
export const JAPANESE_IDS = [
|
|
43
|
+
"sport:sumo", "trophy:sumo-cup", "gear:gunbai", "gear:mawashi",
|
|
44
|
+
"trophy:championship-banner",
|
|
45
|
+
"sport:kendo", "gear:shinai", "gear:kendo-men",
|
|
46
|
+
"sport:judo", "gear:judogi", "gear:obi",
|
|
47
|
+
"sport:kyudo", "gear:yumi", "gear:ya",
|
|
48
|
+
"sport:karate", "gear:karate-gi",
|
|
49
|
+
];
|
|
50
|
+
/** The pennants: a felt championship pennant with a stitched edge. */
|
|
51
|
+
export const PENNANT_IDS = ["pennant:championship"];
|
|
38
52
|
export const SPORT_IDS = SPORT_NAMES.map((name) => `sport:${name}`);
|
|
39
53
|
/** The groups of ids, in the order a gallery shows them. */
|
|
40
54
|
export const EMBLEM_GROUPS = {
|
|
@@ -45,10 +59,11 @@ export const EMBLEM_GROUPS = {
|
|
|
45
59
|
ball: BALL_IDS,
|
|
46
60
|
gear: GEAR_IDS,
|
|
47
61
|
sport: SPORT_IDS,
|
|
62
|
+
pennant: PENNANT_IDS,
|
|
48
63
|
};
|
|
49
64
|
/** Every id, in group order. */
|
|
50
65
|
export const EMBLEM_IDS = Object.values(EMBLEM_GROUPS).flat();
|
|
51
66
|
/** The folder under `src/emblems/` that holds a group's art, one module per item named by the id's last part: `trophy:hockey-cup` is `trophy/hockey-cup.ts`, `ball:soccer` is `ball/soccer.ts`. Each group has a folder of its own, so no two ids share a file name. */
|
|
52
|
-
export const EMBLEM_FOLDERS = { award: "award", trophy: "trophy", medal: "medal", crest: "crest", ball: "ball", gear: "gear", sport: "sport" };
|
|
67
|
+
export const EMBLEM_FOLDERS = { award: "award", trophy: "trophy", medal: "medal", crest: "crest", ball: "ball", gear: "gear", sport: "sport", pennant: "pennant" };
|
|
53
68
|
/** The short names of the trophies and awards that stand for a full id: `"cup"` is `"trophy:cup"` and `"crown"` is `"award:crown"`. */
|
|
54
69
|
export const EMBLEM_ALIASES = Object.fromEntries([...TROPHY_IDS, ...AWARD_IDS].map((id) => [id.slice(id.indexOf(":") + 1), id]));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Emblem, type EmblemSource, type Metal } from "./emblem.core.ts";
|
|
2
|
+
import { type Band } from "./emblem.engrave.ts";
|
|
2
3
|
/** A point of the profile: the height `y` (0 at the top of the 64 unit box), the radius `r` from the axis (x = 32), 1 for a sharp corner (a smooth run of points ends at one), and the tone of the piece that starts here. */
|
|
3
4
|
export type Pt = readonly [y: number, r: number, corner?: 0 | 1, tone?: string];
|
|
4
5
|
/** Something drawn on the surface, by height and angle (90 degrees is the right side, 0 faces the eye): a `ring` round the body at a height; `mer`idians from one height to another; `helix` strands that wind `turns` times; a diamond `net`; `dots` (beads) round at a height with a size; on an open top, a `disc` of a tone out to a radius and `pills`, short rounded marks, round a radius. */
|
|
@@ -52,6 +53,8 @@ export interface LatheModel {
|
|
|
52
53
|
handles?: readonly Handle[];
|
|
53
54
|
balls?: readonly Ball[];
|
|
54
55
|
poles?: Poles;
|
|
56
|
+
/** The plinth: the band of the body (heights, the tone it is cut into, and for a body with flat sides which side) that holds an engraving, which turns with the body. */
|
|
57
|
+
plate?: Band;
|
|
55
58
|
}
|
|
56
59
|
/** The radius of the body at a height. */
|
|
57
60
|
export declare function radiusAt(profile: readonly Pt[], y: number): number;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// grooves round the body, a pattern on a dish) are placed by the angle they are turned to. One model draws the still emblem (yaw 0) and the emblem turned (`frame`), so the 2D and the turning view
|
|
3
3
|
// come from the same data. The silhouette is the profile at every yaw; the light, the handles, the grooves and the seams move to where `sin(yaw)` puts them, and are drawn back to front. Plain SVG.
|
|
4
4
|
// Imports only the core.
|
|
5
|
-
import { cylinderGradient, defsOf, hexOf, mainOf, mix, orbGradient, readColour, resolve, wrap, } from "./emblem.core.js";
|
|
5
|
+
import { cylinderGradient, defsOf, hexOf, labelled, mainOf, mix, orbGradient, readColour, resolve, wrap, } from "./emblem.core.js";
|
|
6
|
+
import { cylinderText, engravingInk, engravingOf, flatText, sideText } from "./emblem.engrave.js";
|
|
6
7
|
const CX = 32;
|
|
7
8
|
const RAD = Math.PI / 180;
|
|
8
9
|
const f = (n) => String(Math.round(n * 10) / 10 + 0);
|
|
@@ -64,7 +65,7 @@ function piecesOf(p) {
|
|
|
64
65
|
const arc = (y, r, s, toLeft) => `Q${pt(CX, y + 2 * r * s)} ${pt(CX + (toLeft ? -r : r), y)}`;
|
|
65
66
|
const ellipse = (cx, cy, rx, ry, fill, extra = "") => `<ellipse cx="${f(cx)}" cy="${f(cy)}" rx="${f(rx)}" ry="${f(Math.max(ry, 0.25))}" fill="${fill}"${extra}/>`;
|
|
66
67
|
/** The geometry and paint of one drawing of the model at a yaw and a pitch. */
|
|
67
|
-
function draw(model, r, yaw, pitch) {
|
|
68
|
+
function draw(model, r, o, yaw, pitch) {
|
|
68
69
|
const line = r.style === "line";
|
|
69
70
|
const flat = r.style === "color";
|
|
70
71
|
const elevation = Math.max(0, Math.min(75, (model.tilt ?? 12) + pitch));
|
|
@@ -384,6 +385,26 @@ function draw(model, r, yaw, pitch) {
|
|
|
384
385
|
}
|
|
385
386
|
mid.push(...parts);
|
|
386
387
|
}
|
|
388
|
+
// The engraving on the plinth: letters set round the body (or along one flat side), foreshortened and hidden as they turn away.
|
|
389
|
+
const plate = model.plate;
|
|
390
|
+
const words = plate === undefined ? "" : flatText(engravingOf(o));
|
|
391
|
+
if (plate !== undefined && words !== "") {
|
|
392
|
+
const y = (plate.y0 + plate.y1) / 2;
|
|
393
|
+
const solid = model.solids.find((q) => q.p[0][0] <= y && y <= q.p[q.p.length - 1][0]) ?? model.solids[0];
|
|
394
|
+
const radius = radiusAt(solid.p, y);
|
|
395
|
+
const ink = engravingInk(r.style, tone(plate.tone ?? solid.tone).rgb);
|
|
396
|
+
if (solid.sides === undefined)
|
|
397
|
+
mid.push(cylinderText(words, radius, plate.y1 - plate.y0, ink, yaw, plate.at ?? 0, (deg) => at(radius, y, deg)));
|
|
398
|
+
else {
|
|
399
|
+
const n = solid.sides;
|
|
400
|
+
const k = plate.face ?? 0;
|
|
401
|
+
const a0 = (360 * k) / n + yaw;
|
|
402
|
+
const a1 = (360 * (k + 1)) / n + yaw;
|
|
403
|
+
const [ax, ay] = at(radius, y, a0);
|
|
404
|
+
const [bx, by] = at(radius, y, a1);
|
|
405
|
+
mid.push(sideText(words, 2 * radius * Math.sin(Math.PI / n), plate.y1 - plate.y0, ink, [ax, ay], [bx, by], Math.cos(((a0 + a1) / 2) * RAD)));
|
|
406
|
+
}
|
|
407
|
+
}
|
|
387
408
|
return { body: back.join("") + mid.join("") + front.join(""), defs: line || flat ? "" : defsOf(grads), edge: main.edge };
|
|
388
409
|
}
|
|
389
410
|
/** The twelve pentagons of a ball, as the centres of a sphere's faces: the poles and two rings of five. */
|
|
@@ -397,8 +418,9 @@ export function defineLathe(id, en, ja, source, model) {
|
|
|
397
418
|
const r = resolve(o);
|
|
398
419
|
const yaw = typeof o?.yaw === "number" && Number.isFinite(o.yaw) ? o.yaw % 360 : 0;
|
|
399
420
|
const pitch = typeof o?.pitch === "number" && Number.isFinite(o.pitch) ? Math.max(-40, Math.min(60, o.pitch)) : 0;
|
|
400
|
-
const d = draw(model, r, yaw, pitch);
|
|
421
|
+
const d = draw(model, r, o, yaw, pitch);
|
|
401
422
|
return wrap({ title: en, size: r.size, style: r.style, theme: r.theme, defs: d.defs, body: d.body, edge: d.edge, width: r.style === "line" ? 2.3 : 0.6 });
|
|
402
423
|
};
|
|
403
|
-
|
|
424
|
+
const still = labelled(en, ja, (o) => frame(o));
|
|
425
|
+
return { id, en, ja, source, kind: "lathe", model, svg: still, frame: labelled(en, ja, frame) };
|
|
404
426
|
}
|
|
@@ -23,16 +23,16 @@ export function defineMedal(id, en, ja, metal) {
|
|
|
23
23
|
const front = [
|
|
24
24
|
...ribbon(),
|
|
25
25
|
...disc,
|
|
26
|
-
["
|
|
26
|
+
["M", starPath(32, 43, 9, 3.9)],
|
|
27
27
|
["l", "M19.2 40a13.4 13.4 0 0 1 9.4-10.4 14 14 0 0 0-6.6 12.6z"],
|
|
28
28
|
];
|
|
29
|
-
const back = [...disc, ["
|
|
30
|
-
return defineFlat(id, en, ja, "ours", { metal, front, back, rim: 3 });
|
|
29
|
+
const back = [...disc, ["E", circlePath(32, 43, 8.4), "1.4"]];
|
|
30
|
+
return defineFlat(id, en, ja, "ours", { metal, front, back, rim: 3, engrave: { front: { x: 32, y: 43, w: 19, h: 15 }, back: { x: 32, y: 43, w: 20, h: 13 } } });
|
|
31
31
|
}
|
|
32
32
|
/** The numerals 1, 2 and 3 as strokes. */
|
|
33
33
|
const NUMERALS = { 1: "M26 28l7-5v20", 2: "M25 28c1-9 15-9 15 0 0 6-14 9-15 15h16", 3: "M25 26c4-6 14-4 13 2-1 5-6 6-9 6 3 0 9 1 9 7 0 8-14 9-16 2" };
|
|
34
34
|
/** A plain badge for a place: a bevelled disc with its numeral. */
|
|
35
35
|
export function definePlace(id, en, ja, place, metal) {
|
|
36
36
|
const base = [["o", circlePath(32, 32, 27.5)], ["e", circlePath(32, 32, 24.2), "2.2"]];
|
|
37
|
-
return defineFlat(id, en, ja, "ours", { metal, front: [...base, ["
|
|
37
|
+
return defineFlat(id, en, ja, "ours", { metal, front: [...base, ["D", NUMERALS[place]], ["l", "M10.4 28a22 22 0 0 1 16.6-17 24 24 0 0 0-11 22z"]], back: [...base, ["E", circlePath(32, 32, 14), "1.6"]], rim: 3, engrave: { front: { x: 32, y: 32, w: 30, h: 28 }, back: { x: 32, y: 32, w: 30, h: 20 }, rank: String(place) } });
|
|
38
38
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// A championship pennant: a long triangle of felt on a dowel, with an edge sewn in a second colour and the words and the year in felt letters. Drawn felt-flat in `metal` and `color` (the fibres are a
|
|
2
|
+
// faint speckle, the `metal` style adds a soft light), and as one outline in `line`. Turned, it flips like a coin and shows its back, which is plain felt and the stitching, with the dowel on the other
|
|
3
|
+
// side. Imports the core, the text widths of the engraving helpers and the coin-flip turn.
|
|
4
|
+
import { degrees, escape, hexOf, mix, n2, readColour, resolve, wrap } from "./emblem.core.js";
|
|
5
|
+
import { engravingOf, widthOf } from "./emblem.engrave.js";
|
|
6
|
+
import { flipSvg } from "./emblem.flip.js";
|
|
7
|
+
const FELT = "#8f1d2c";
|
|
8
|
+
const CREAM = "#f4f0e4";
|
|
9
|
+
const FONT = "system-ui,-apple-system,'Segoe UI','Hiragino Sans','Noto Sans JP','Yu Gothic',sans-serif";
|
|
10
|
+
/** The felt: a wide left edge on the dowel, a point at the right, edges that sag a little. */
|
|
11
|
+
const SHAPE = "M8 15Q34 22 60 32Q34 42 8 49Z";
|
|
12
|
+
const STITCH = "M10.2 18Q34 24.6 55.6 32Q34 39.4 10.2 46Z";
|
|
13
|
+
const ROD = "M4.6 11.5h3.4v41h-3.4z";
|
|
14
|
+
/** The half height of the felt at x. */
|
|
15
|
+
const half = (x) => 17 - ((x - 8) * 17) / 52;
|
|
16
|
+
/** The lines of lettering, each as large as fits inside the triangle from the left edge: the main words, then the year. */
|
|
17
|
+
function lettering(rows) {
|
|
18
|
+
if (rows.length === 0)
|
|
19
|
+
return [];
|
|
20
|
+
const x0 = 12.5;
|
|
21
|
+
for (let f = 11; f >= 0.8; f -= 0.2) {
|
|
22
|
+
const sizes = rows.map((_, i) => (i === 0 ? f : f * 0.55));
|
|
23
|
+
const total = sizes.reduce((sum, s) => sum + s * 1.12, 0);
|
|
24
|
+
let top = 32 - total / 2;
|
|
25
|
+
const placed = rows.map((t, i) => {
|
|
26
|
+
const size = sizes[i];
|
|
27
|
+
const y = top + size * 0.86;
|
|
28
|
+
top += size * 1.12;
|
|
29
|
+
return { text: t, x: x0, y, size, width: widthOf(t) * size };
|
|
30
|
+
});
|
|
31
|
+
const fits = placed.every((p) => {
|
|
32
|
+
const end = p.x + p.width;
|
|
33
|
+
const reach = half(end) - 3;
|
|
34
|
+
return end <= 56 && p.y - p.size * 0.8 >= 32 - reach && p.y + p.size * 0.04 <= 32 + reach;
|
|
35
|
+
});
|
|
36
|
+
if (fits)
|
|
37
|
+
return placed;
|
|
38
|
+
}
|
|
39
|
+
return rows.map((t, i) => ({ text: t, x: x0, y: 32 + i * 5, size: 2.2, width: widthOf(t) * 2.2 }));
|
|
40
|
+
}
|
|
41
|
+
/** One side of the pennant as a document. */
|
|
42
|
+
function draw(title, o, back) {
|
|
43
|
+
const r = resolve(o);
|
|
44
|
+
const line = r.style === "line";
|
|
45
|
+
const felt = r.tint ?? readColour(FELT);
|
|
46
|
+
const trim = r.accent ?? CREAM;
|
|
47
|
+
const ink = hexOf(readColour(o?.numberColor) ?? readColour(trim));
|
|
48
|
+
// The lettering is the engraving of the options: the free text (one line a row) or the rank and label, then the year, in capitals.
|
|
49
|
+
const e = engravingOf(o);
|
|
50
|
+
const rows = [...(e.free !== undefined ? e.free.split("\n") : [[e.rank, e.label].filter((part) => part !== undefined).join(" ")]), e.year ?? ""].map((t) => t.toUpperCase()).filter((t) => t !== "");
|
|
51
|
+
const flatFelt = hexOf(felt);
|
|
52
|
+
const pid = `dgpf${flatFelt.slice(1)}`;
|
|
53
|
+
let body = `<g${back ? ' transform="translate(64 0) scale(-1 1)"' : ""}>`;
|
|
54
|
+
body += `<path d="${ROD}" fill="${line ? "none" : "#a8743c"}"/>`;
|
|
55
|
+
body += `<path d="${SHAPE}" fill="${line ? "none" : r.style === "metal" ? `url(#${pid})` : flatFelt}"/>`;
|
|
56
|
+
if (!line && r.style === "metal")
|
|
57
|
+
body += `<path d="${SHAPE}" fill="url(#dgsp)" stroke="none"/>`;
|
|
58
|
+
body += `<path d="${STITCH}" fill="none" stroke="${line ? "currentColor" : trim}" stroke-width="${line ? 1.2 : 0.7}" stroke-dasharray="1.9 1.5" stroke-linecap="butt"/>`;
|
|
59
|
+
const text = back ? [] : lettering(rows);
|
|
60
|
+
if (text.length > 0) {
|
|
61
|
+
body += `<g font-family="${FONT}" font-weight="800" fill="${line ? "currentColor" : ink}" stroke="none">${text
|
|
62
|
+
.map((t) => `<text x="${n2(t.x)}" y="${n2(t.y)}" font-size="${n2(t.size)}" textLength="${n2(t.width)}" lengthAdjust="spacingAndGlyphs">${escape(t.text)}</text>`)
|
|
63
|
+
.join("")}</g>`;
|
|
64
|
+
}
|
|
65
|
+
body += "</g>";
|
|
66
|
+
const defs = r.style !== "metal"
|
|
67
|
+
? ""
|
|
68
|
+
: `<defs><pattern id="${pid}" width="2.4" height="2.4" patternUnits="userSpaceOnUse"><rect width="2.4" height="2.4" fill="${flatFelt}" stroke="none"/><circle cx=".6" cy=".7" r=".32" fill="#fff" fill-opacity=".14" stroke="none"/><circle cx="1.8" cy="1.6" r=".3" fill="#000" fill-opacity=".14" stroke="none"/></pattern><linearGradient id="dgsp" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fff" stop-opacity=".22"/><stop offset=".5" stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".28"/></linearGradient></defs>`;
|
|
69
|
+
return wrap({ title, size: r.size, style: r.style, theme: r.theme, defs, body, edge: mix(felt, -0.5), width: 0.8 });
|
|
70
|
+
}
|
|
71
|
+
/** A pennant: its front with the lettering, turned like a coin to its plain back. */
|
|
72
|
+
export function definePennant(id, en, ja) {
|
|
73
|
+
const svg = (o) => draw(en, o, o?.view === "back");
|
|
74
|
+
const frame = (o) => {
|
|
75
|
+
const back = o?.view === "back";
|
|
76
|
+
return flipSvg(draw(en, o, back), { yaw: degrees(o?.yaw), pitch: degrees(o?.pitch), line: o?.style === "line", back: draw(en, o, !back), thick: 0.016 });
|
|
77
|
+
};
|
|
78
|
+
return { id, en, ja, source: "ours", kind: "flat", model: null, svg, frame };
|
|
79
|
+
}
|
|
@@ -23,6 +23,10 @@ import { TROPHY_PLAQUE } from "./trophy/plaque.js";
|
|
|
23
23
|
import { TROPHY_BELT } from "./trophy/belt.js";
|
|
24
24
|
import { TROPHY_LAUREL } from "./trophy/laurel.js";
|
|
25
25
|
import { TROPHY_ROSETTE } from "./trophy/rosette.js";
|
|
26
|
+
import { TROPHY_SUMO_CUP } from "./trophy/sumo-cup.js";
|
|
27
|
+
import { TROPHY_CHAMPIONSHIP_BANNER } from "./trophy/championship-banner.js";
|
|
28
|
+
import { TROPHY_RING } from "./trophy/ring.js";
|
|
29
|
+
import { TROPHY_BANNER } from "./trophy/banner.js";
|
|
26
30
|
import { MEDAL_GOLD } from "./medal/gold.js";
|
|
27
31
|
import { MEDAL_SILVER } from "./medal/silver.js";
|
|
28
32
|
import { MEDAL_BRONZE } from "./medal/bronze.js";
|
|
@@ -33,6 +37,7 @@ import { CREST_SHIELD } from "./crest/shield.js";
|
|
|
33
37
|
import { CREST_ROUNDEL } from "./crest/roundel.js";
|
|
34
38
|
import { CREST_DIAMOND } from "./crest/diamond.js";
|
|
35
39
|
import { CREST_PENNANT } from "./crest/pennant.js";
|
|
40
|
+
import { PENNANT_CHAMPIONSHIP } from "./pennant/championship.js";
|
|
36
41
|
import { BALLS } from "./ball/ball.index.js";
|
|
37
42
|
import { GEARS } from "./gear/gear.index.js";
|
|
38
43
|
import { SPORT_NFL } from "./sport/nfl.js";
|
|
@@ -68,6 +73,11 @@ import { SPORT_FIELDHOCKEY } from "./sport/fieldhockey.js";
|
|
|
68
73
|
import { SPORT_HANDBALL } from "./sport/handball.js";
|
|
69
74
|
import { SPORT_ATHLETICS } from "./sport/athletics.js";
|
|
70
75
|
import { SPORT_SKATING } from "./sport/skating.js";
|
|
76
|
+
import { SPORT_SUMO } from "./sport/sumo.js";
|
|
77
|
+
import { SPORT_KENDO } from "./sport/kendo.js";
|
|
78
|
+
import { SPORT_JUDO } from "./sport/judo.js";
|
|
79
|
+
import { SPORT_KYUDO } from "./sport/kyudo.js";
|
|
80
|
+
import { SPORT_KARATE } from "./sport/karate.js";
|
|
71
81
|
/** The balls and the gear are drawn by families, each family in a module of its own, and listed in order by their own indexes. */
|
|
72
82
|
const PIECES = Object.fromEntries([...BALLS, ...GEARS].map((piece) => [piece.id, piece]));
|
|
73
83
|
/** The emblems drawn one to a module: every id but the balls and the gear. A missing or extra entry is a type error. */
|
|
@@ -97,6 +107,10 @@ const OWN = {
|
|
|
97
107
|
"trophy:belt": TROPHY_BELT,
|
|
98
108
|
"trophy:laurel": TROPHY_LAUREL,
|
|
99
109
|
"trophy:rosette": TROPHY_ROSETTE,
|
|
110
|
+
"trophy:sumo-cup": TROPHY_SUMO_CUP,
|
|
111
|
+
"trophy:championship-banner": TROPHY_CHAMPIONSHIP_BANNER,
|
|
112
|
+
"trophy:ring": TROPHY_RING,
|
|
113
|
+
"trophy:banner": TROPHY_BANNER,
|
|
100
114
|
"medal:gold": MEDAL_GOLD,
|
|
101
115
|
"medal:silver": MEDAL_SILVER,
|
|
102
116
|
"medal:bronze": MEDAL_BRONZE,
|
|
@@ -107,6 +121,7 @@ const OWN = {
|
|
|
107
121
|
"crest:roundel": CREST_ROUNDEL,
|
|
108
122
|
"crest:diamond": CREST_DIAMOND,
|
|
109
123
|
"crest:pennant": CREST_PENNANT,
|
|
124
|
+
"pennant:championship": PENNANT_CHAMPIONSHIP,
|
|
110
125
|
"sport:nfl": SPORT_NFL,
|
|
111
126
|
"sport:cfl": SPORT_CFL,
|
|
112
127
|
"sport:ifaf": SPORT_IFAF,
|
|
@@ -140,6 +155,11 @@ const OWN = {
|
|
|
140
155
|
"sport:handball": SPORT_HANDBALL,
|
|
141
156
|
"sport:athletics": SPORT_ATHLETICS,
|
|
142
157
|
"sport:skating": SPORT_SKATING,
|
|
158
|
+
"sport:sumo": SPORT_SUMO,
|
|
159
|
+
"sport:kendo": SPORT_KENDO,
|
|
160
|
+
"sport:judo": SPORT_JUDO,
|
|
161
|
+
"sport:kyudo": SPORT_KYUDO,
|
|
162
|
+
"sport:karate": SPORT_KARATE,
|
|
143
163
|
};
|
|
144
164
|
/** Every emblem, by id. */
|
|
145
165
|
export const EMBLEM_TABLE = { ...OWN, ...PIECES };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type Emblem, type EmblemSource, type Metal } from "./emblem.core.ts";
|
|
2
|
+
import { type Plate } from "./emblem.engrave.ts";
|
|
2
3
|
/**
|
|
3
4
|
* What a shape is for. `m` the main metal, shaded across a sheet; `o` the main metal on a round, lit from a corner; `e` a bevelled ring (a line the width of the third item, bright on one side and dark on
|
|
4
5
|
* the other); `s` its shade; `l` a glint (a fill with no outline, left out of the line style); `r` the second colour (a ribbon, a band: the `accent` option); `f` a fixed colour (the third item); `p` white
|
|
5
6
|
* ink at a tenth; `k` ink; `n` an outline with no fill; `t` a thin line (a detail); `b` a bold line in ink (a limb, a shaft); `d` a bold line in a fixed dark colour (a numeral on a medal).
|
|
6
7
|
*/
|
|
7
|
-
export type Role = "m" | "o" | "e" | "s" | "l" | "r" | "f" | "p" | "k" | "n" | "t" | "b" | "d";
|
|
8
|
+
export type Role = DropRole | "m" | "o" | "e" | "s" | "l" | "r" | "f" | "p" | "k" | "n" | "t" | "b" | "d";
|
|
9
|
+
/** A role in capitals is the same shape, left out of a face that is engraved (the star of a medal, the numeral of a place badge, the lines of a plaque). */
|
|
10
|
+
type DropRole = "M" | "D" | "T" | "E";
|
|
8
11
|
/** A path, its role, and for `f` its colour and for `e` its width. */
|
|
9
12
|
export type Shape = readonly [Role, string, string?];
|
|
10
13
|
/** A flat object or an icon. */
|
|
@@ -25,12 +28,19 @@ export interface FlatModel {
|
|
|
25
28
|
ink?: boolean;
|
|
26
29
|
/** Shapes drawn when there are no initials, for a crest (and only then). */
|
|
27
30
|
blank?: readonly Shape[];
|
|
31
|
+
/** Where an engraving goes: the plate of the front (and of the year when a plate of its own holds it) and of the back, and the rank the front takes when it is engraved and none is given (a place badge's own place). */
|
|
32
|
+
engrave?: {
|
|
33
|
+
front: Plate;
|
|
34
|
+
year?: Plate;
|
|
35
|
+
back?: Plate;
|
|
36
|
+
rank?: string;
|
|
37
|
+
};
|
|
28
38
|
/** Where a crest's letters go: the centre's x and y, and the size for one letter. */
|
|
29
39
|
letters?: readonly [x: number, y: number, size: number];
|
|
30
40
|
}
|
|
31
41
|
/** A flat object (a medal, a crest, a plaque): drawn as it is by `svg`; turned about its vertical axis it flips like a coin and shows its back, with its rim for a moment edge on. */
|
|
32
42
|
export declare function defineFlat(id: string, en: string, ja: string, source: EmblemSource, model: FlatModel): Emblem<FlatModel>;
|
|
33
|
-
/** An icon: one drawing from shapes,
|
|
43
|
+
/** An icon: one drawing from shapes. Turned, it is a thin cut-out: it squeezes like a coin, shows its front mirrored and a little darker past a quarter turn, and has a dark rim. */
|
|
34
44
|
export declare function defineIcon(id: string, en: string, ja: string, source: EmblemSource, model: FlatModel): Emblem<FlatModel>;
|
|
35
45
|
/** A circle as a path, so every shape is one kind of thing. */
|
|
36
46
|
export declare const circlePath: (cx: number, cy: number, r: number) => string;
|
|
@@ -38,3 +48,10 @@ export declare const circlePath: (cx: number, cy: number, r: number) => string;
|
|
|
38
48
|
export declare const ellipsePath: (cx: number, cy: number, rx: number, ry: number) => string;
|
|
39
49
|
/** A star as a path, one point up. */
|
|
40
50
|
export declare function starPath(cx: number, cy: number, outer: number, inner: number, points?: number): string;
|
|
51
|
+
/** A regular polygon of `n` sides with a corner at `deg` degrees (0 is straight up), as a path. */
|
|
52
|
+
export declare function polygon(cx: number, cy: number, r: number, n: number, deg?: number): string;
|
|
53
|
+
/** An ellipse turned `deg` degrees about its centre, as a path. */
|
|
54
|
+
export declare function tiltedEllipse(cx: number, cy: number, rx: number, ry: number, deg: number): string;
|
|
55
|
+
/** A bar with square ends from one point to another, `w` wide, as a path. */
|
|
56
|
+
export declare function bar(x1: number, y1: number, x2: number, y2: number, w: number): string;
|
|
57
|
+
export {};
|