@margoengine/rigging 0.0.0-stage → 1.0.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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +1443 -2
- package/dist/anatomy-data-ansur2.d.ts +63 -0
- package/dist/anatomy-data-cdc.d.ts +16 -0
- package/dist/anatomy-data-deleva.d.ts +86 -0
- package/dist/anatomy-human.d.ts +67 -0
- package/dist/anatomy-human.js +2229 -0
- package/dist/anatomy.d.ts +638 -0
- package/dist/anatomy.js +1112 -0
- package/dist/autorig.d.ts +50 -0
- package/dist/autorig.js +663 -0
- package/dist/bar-grip.d.ts +7 -0
- package/dist/body-volumes-DTym0RVY.js +56 -0
- package/dist/body-volumes.d.ts +19 -0
- package/dist/checks.d.ts +50 -0
- package/dist/contact.d.ts +186 -0
- package/dist/contact.js +746 -0
- package/dist/correctives.d.ts +92 -0
- package/dist/correctives.js +162 -0
- package/dist/coupling.d.ts +57 -0
- package/dist/coupling.js +330 -0
- package/dist/errors-D8rc8kzg.js +7 -0
- package/dist/face.d.ts +93 -0
- package/dist/face.js +144 -0
- package/dist/hands.d.ts +209 -0
- package/dist/hands.js +510 -0
- package/dist/heat.d.ts +38 -0
- package/dist/hinged-contact.d.ts +7 -0
- package/dist/hulls.d.ts +54 -0
- package/dist/hulls.js +134 -0
- package/dist/ik.d.ts +162 -0
- package/dist/ik.js +561 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +390 -0
- package/dist/joint-limits.d.ts +44 -0
- package/dist/joint-limits.js +74 -0
- package/dist/limb-collision.d.ts +99 -0
- package/dist/loading-CZaYr1N7.js +67 -0
- package/dist/mesh-CyvLHNp0.js +142 -0
- package/dist/mesh.d.ts +47 -0
- package/dist/mtoon-data.d.ts +118 -0
- package/dist/mtoon-legacy.d.ts +17 -0
- package/dist/mtoon-shader.d.ts +4 -0
- package/dist/mtoon.d.ts +84 -0
- package/dist/mtoon.js +990 -0
- package/dist/paint.d.ts +82 -0
- package/dist/pose-tracking.d.ts +117 -0
- package/dist/pose-tracking.js +488 -0
- package/dist/retarget.d.ts +78 -0
- package/dist/retarget.js +375 -0
- package/dist/rig-BawZ5OLb.js +127 -0
- package/dist/rig.d.ts +65 -0
- package/dist/shared/gltf.d.ts +257 -0
- package/dist/shared/layers.d.ts +16 -0
- package/dist/springs.d.ts +180 -0
- package/dist/springs.js +458 -0
- package/dist/strand-springs.d.ts +46 -0
- package/dist/strand-springs.js +168 -0
- package/dist/swim.d.ts +55 -0
- package/dist/swim.js +167 -0
- package/dist/transfer.d.ts +41 -0
- package/dist/transfer.js +136 -0
- package/dist/validate.d.ts +188 -0
- package/dist/validate.js +440 -0
- package/dist/voxel-weights-48ok-Dax.js +255 -0
- package/dist/voxel-weights.d.ts +42 -0
- package/dist/voxel-weights.js +1 -0
- package/dist/voxels.d.ts +36 -0
- package/dist/vrm-constraints.d.ts +60 -0
- package/dist/vrm-constraints.js +261 -0
- package/dist/vrm-first-person.d.ts +115 -0
- package/dist/vrm-first-person.js +618 -0
- package/dist/vrm-presets-CU4V4yq6.js +47 -0
- package/dist/vrm-presets.d.ts +1 -0
- package/dist/vrm.d.ts +303 -0
- package/dist/vrm.js +574 -0
- package/dist/vrm0.d.ts +134 -0
- package/dist/vrm0.js +377 -0
- package/dist/vrma.d.ts +90 -0
- package/dist/vrma.js +315 -0
- package/dist/weight-map-D8cAONQQ.js +92 -0
- package/dist/weight-map.d.ts +58 -0
- package/package.json +189 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Women measured for every dimension here. */
|
|
2
|
+
export declare const ANSUR2_FEMALES = 1986;
|
|
3
|
+
/** Men measured for every dimension here. */
|
|
4
|
+
export declare const ANSUR2_MALES = 4082;
|
|
5
|
+
/** Female mean and SD, then male mean and SD, in centimetres (kilograms for weight). */
|
|
6
|
+
export type ANSUR2Row = readonly [femaleMean: number, femaleSD: number, maleMean: number, maleSD: number];
|
|
7
|
+
/** The dimensions, keyed by the report's own names in lower case. */
|
|
8
|
+
export declare const ANSUR2: {
|
|
9
|
+
readonly stature: readonly [162.85, 6.42, 175.62, 6.86];
|
|
10
|
+
readonly 'acromial height': readonly [133.51, 5.81, 144.07, 6.33];
|
|
11
|
+
readonly 'cervicale height': readonly [139.57, 5.95, 151.73, 6.33];
|
|
12
|
+
readonly 'chest height': readonly [117.16, 5.55, 129.11, 5.7];
|
|
13
|
+
readonly 'waist height (omphalion)': readonly [98.01, 5, 105.65, 5.22];
|
|
14
|
+
readonly 'iliocristale height': readonly [99.57, 4.97, 106.16, 5.2];
|
|
15
|
+
readonly 'trochanterion height': readonly [84.54, 4.47, 90.09, 4.92];
|
|
16
|
+
readonly 'crotch height': readonly [78.23, 4.46, 84.59, 4.65];
|
|
17
|
+
readonly 'lateral femoral epicondyle height': readonly [46.59, 2.71, 49.17, 2.66];
|
|
18
|
+
readonly 'knee height, midpatella': readonly [44.9, 2.6, 48.84, 2.81];
|
|
19
|
+
readonly 'tibial height': readonly [43.78, 2.5, 46.82, 2.66];
|
|
20
|
+
readonly 'lateral malleolus height': readonly [6.27, 0.51, 7.29, 0.57];
|
|
21
|
+
readonly 'shoulder-elbow length': readonly [33.43, 1.73, 36.37, 1.82];
|
|
22
|
+
readonly 'radiale-stylion length': readonly [24.13, 1.52, 26.79, 1.54];
|
|
23
|
+
readonly 'forearm-hand length': readonly [43.99, 2.34, 48.02, 2.33];
|
|
24
|
+
readonly 'hand length': readonly [18.11, 1.01, 19.33, 0.99];
|
|
25
|
+
readonly 'palm length': readonly [10.87, 0.59, 11.65, 0.62];
|
|
26
|
+
readonly 'wrist height': readonly [79.42, 3.82, 84.75, 4.17];
|
|
27
|
+
readonly 'acromion-radiale length': readonly [31.12, 1.72, 33.52, 1.75];
|
|
28
|
+
readonly span: readonly [166.03, 8.3, 181.42, 8.46];
|
|
29
|
+
readonly 'biacromial breadth': readonly [36.53, 1.83, 41.57, 1.92];
|
|
30
|
+
readonly 'bideltoid breadth': readonly [45.03, 2.87, 51.04, 3.25];
|
|
31
|
+
readonly 'hip breadth': readonly [35.38, 2.67, 34.57, 2.42];
|
|
32
|
+
readonly 'bimalleolar breadth': readonly [6.7, 0.35, 7.48, 0.41];
|
|
33
|
+
readonly 'foot length': readonly [24.63, 1.24, 27.12, 1.31];
|
|
34
|
+
readonly 'ball of foot length': readonly [18.21, 0.96, 20.09, 1.05];
|
|
35
|
+
readonly 'foot breadth, horizontal': readonly [9.27, 0.48, 10.19, 0.52];
|
|
36
|
+
readonly 'heel breadth': readonly [6.72, 0.52, 7.25, 0.55];
|
|
37
|
+
readonly 'head length': readonly [18.98, 0.74, 19.95, 0.7];
|
|
38
|
+
readonly 'head breadth': readonly [14.78, 0.52, 15.43, 0.55];
|
|
39
|
+
readonly 'tragion-top of head': readonly [12.65, 0.65, 13.11, 0.62];
|
|
40
|
+
readonly 'sitting height': readonly [85.66, 3.31, 91.83, 3.57];
|
|
41
|
+
readonly 'eye height, sitting': readonly [74.77, 3.04, 80.45, 3.32];
|
|
42
|
+
readonly 'buttock-knee length': readonly [59.06, 3.26, 61.8, 3.06];
|
|
43
|
+
readonly 'buttock-popliteal length': readonly [48.51, 2.87, 50.29, 2.74];
|
|
44
|
+
readonly 'functional leg length': readonly [104.43, 5.4, 113.02, 5.61];
|
|
45
|
+
readonly 'weight (kg)': readonly [67.76, 10.98, 85.52, 14.22];
|
|
46
|
+
readonly 'biceps circumference, flexed': readonly [30.56, 3.08, 35.81, 3.46];
|
|
47
|
+
readonly 'forearm circumference, flexed': readonly [26.41, 1.85, 31.01, 2.2];
|
|
48
|
+
readonly 'wrist circumference': readonly [15.48, 0.78, 17.59, 0.9];
|
|
49
|
+
readonly 'thigh circumference': readonly [61.61, 5.58, 62.51, 5.85];
|
|
50
|
+
readonly 'lower thigh circumference': readonly [40.07, 3.52, 40.93, 3.19];
|
|
51
|
+
readonly 'calf circumference': readonly [37.33, 2.85, 39.23, 2.97];
|
|
52
|
+
readonly 'ankle circumference': readonly [21.57, 1.49, 22.93, 1.46];
|
|
53
|
+
readonly 'chest depth': readonly [24.74, 2.73, 25.38, 2.62];
|
|
54
|
+
readonly 'waist depth': readonly [21.3, 3.14, 23.78, 3.47];
|
|
55
|
+
readonly 'chest breadth': readonly [26.93, 1.86, 28.94, 1.83];
|
|
56
|
+
readonly 'waist breadth': readonly [29.99, 3.3, 32.64, 3.47];
|
|
57
|
+
};
|
|
58
|
+
/** A dimension of {@link ANSUR2}. */
|
|
59
|
+
export type ANSUR2Dimension = keyof typeof ANSUR2;
|
|
60
|
+
/** Where this dataset lives in the repository, for the provenance of the rows read from it. */
|
|
61
|
+
export declare const ANSUR2_FILE = "packages/rigging/src/anatomy-data-ansur2.ts";
|
|
62
|
+
/** The mean of a dimension for one sex, centimetres (kilograms for weight). */
|
|
63
|
+
export declare function ansur2Mean(sex: 'female' | 'male', dimension: ANSUR2Dimension): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Age groups of the study, in years. */
|
|
2
|
+
export declare const CDC_AGES: readonly ['2-8', '9-19', '20-44', '45-69'];
|
|
3
|
+
/** The eleven motions the study measured, as the page names them. */
|
|
4
|
+
export declare const CDC_MOTIONS: readonly ['hip extension', 'hip flexion', 'knee flexion', 'knee extension', 'ankle dorsiflexion', 'ankle plantar flexion', 'shoulder flexion', 'elbow flexion', 'elbow extension', 'elbow pronation', 'elbow supination'];
|
|
5
|
+
/** One of {@link CDC_AGES}. */
|
|
6
|
+
export type CDCAge = (typeof CDC_AGES)[number];
|
|
7
|
+
/** One of {@link CDC_MOTIONS}. */
|
|
8
|
+
export type CDCMotion = (typeof CDC_MOTIONS)[number];
|
|
9
|
+
/** Mean, then the low and high ends of its 95% confidence interval, degrees. */
|
|
10
|
+
export type CDCCell = readonly [mean: number, low: number, high: number];
|
|
11
|
+
/** The table: sex, age group, then one cell per motion in {@link CDC_MOTIONS} order. */
|
|
12
|
+
export declare const CDC_RANGE_OF_MOTION: Readonly<Record<'female' | 'male', Readonly<Record<CDCAge, readonly CDCCell[]>>>>;
|
|
13
|
+
/** Where this dataset lives in the repository, for the provenance of the rows read from it. */
|
|
14
|
+
export declare const CDC_FILE = "packages/rigging/src/anatomy-data-cdc.ts";
|
|
15
|
+
/** The mean of one motion for a sex and age group, degrees. */
|
|
16
|
+
export declare function cdcMean(sex: 'female' | 'male', age: CDCAge, motion: CDCMotion): number;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Female value, then male value. */
|
|
2
|
+
export type DeLevaPair = readonly [female: number, male: number];
|
|
3
|
+
/** One body segment of the table. */
|
|
4
|
+
export interface DeLevaSegment {
|
|
5
|
+
/** Landmark the centre of mass is measured from. */
|
|
6
|
+
readonly from: string;
|
|
7
|
+
/** Landmark at the segment's other end. */
|
|
8
|
+
readonly to: string;
|
|
9
|
+
/** Mass, percent of body mass. */
|
|
10
|
+
readonly mass: DeLevaPair;
|
|
11
|
+
/** Centre of mass, percent of the way from `from` to `to`. */
|
|
12
|
+
readonly centre: DeLevaPair;
|
|
13
|
+
}
|
|
14
|
+
/** The segments. The whole trunk is also given as its upper, middle and lower parts, which add up to it. */
|
|
15
|
+
export declare const DE_LEVA_1996: {
|
|
16
|
+
readonly head: {
|
|
17
|
+
readonly from: 'vertex';
|
|
18
|
+
readonly to: 'mid gonion';
|
|
19
|
+
readonly mass: readonly [6.68, 6.94];
|
|
20
|
+
readonly centre: readonly [58.94, 59.76];
|
|
21
|
+
};
|
|
22
|
+
readonly trunk: {
|
|
23
|
+
readonly from: 'suprasternale';
|
|
24
|
+
readonly to: 'mid hip';
|
|
25
|
+
readonly mass: readonly [42.57, 43.46];
|
|
26
|
+
readonly centre: readonly [41.51, 44.86];
|
|
27
|
+
};
|
|
28
|
+
readonly upperTrunk: {
|
|
29
|
+
readonly from: 'suprasternale';
|
|
30
|
+
readonly to: 'xiphion';
|
|
31
|
+
readonly mass: readonly [15.45, 15.96];
|
|
32
|
+
readonly centre: readonly [20.77, 29.99];
|
|
33
|
+
};
|
|
34
|
+
readonly middleTrunk: {
|
|
35
|
+
readonly from: 'xiphion';
|
|
36
|
+
readonly to: 'omphalion';
|
|
37
|
+
readonly mass: readonly [14.65, 16.33];
|
|
38
|
+
readonly centre: readonly [45.12, 45.02];
|
|
39
|
+
};
|
|
40
|
+
readonly lowerTrunk: {
|
|
41
|
+
readonly from: 'omphalion';
|
|
42
|
+
readonly to: 'mid hip';
|
|
43
|
+
readonly mass: readonly [12.47, 11.17];
|
|
44
|
+
readonly centre: readonly [49.2, 61.15];
|
|
45
|
+
};
|
|
46
|
+
readonly upperArm: {
|
|
47
|
+
readonly from: 'shoulder joint centre';
|
|
48
|
+
readonly to: 'elbow joint centre';
|
|
49
|
+
readonly mass: readonly [2.55, 2.71];
|
|
50
|
+
readonly centre: readonly [57.54, 57.72];
|
|
51
|
+
};
|
|
52
|
+
readonly forearm: {
|
|
53
|
+
readonly from: 'elbow joint centre';
|
|
54
|
+
readonly to: 'wrist joint centre';
|
|
55
|
+
readonly mass: readonly [1.38, 1.62];
|
|
56
|
+
readonly centre: readonly [45.59, 45.74];
|
|
57
|
+
};
|
|
58
|
+
readonly hand: {
|
|
59
|
+
readonly from: 'wrist joint centre';
|
|
60
|
+
readonly to: 'third metacarpale';
|
|
61
|
+
readonly mass: readonly [0.56, 0.61];
|
|
62
|
+
readonly centre: readonly [74.74, 79];
|
|
63
|
+
};
|
|
64
|
+
readonly thigh: {
|
|
65
|
+
readonly from: 'hip joint centre';
|
|
66
|
+
readonly to: 'knee joint centre';
|
|
67
|
+
readonly mass: readonly [14.78, 14.16];
|
|
68
|
+
readonly centre: readonly [36.12, 40.95];
|
|
69
|
+
};
|
|
70
|
+
readonly shank: {
|
|
71
|
+
readonly from: 'knee joint centre';
|
|
72
|
+
readonly to: 'ankle';
|
|
73
|
+
readonly mass: readonly [4.81, 4.33];
|
|
74
|
+
readonly centre: readonly [44.16, 44.59];
|
|
75
|
+
};
|
|
76
|
+
readonly foot: {
|
|
77
|
+
readonly from: 'heel';
|
|
78
|
+
readonly to: 'toe tip';
|
|
79
|
+
readonly mass: readonly [1.29, 1.37];
|
|
80
|
+
readonly centre: readonly [40.14, 44.15];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/** A segment of {@link DE_LEVA_1996}. */
|
|
84
|
+
export type DeLevaSegmentName = keyof typeof DE_LEVA_1996;
|
|
85
|
+
/** Where this dataset lives in the repository, for the provenance of the rows read from it. */
|
|
86
|
+
export declare const DE_LEVA_FILE = "packages/rigging/src/anatomy-data-deleva.ts";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type AnatomicalRig, type FitOptions, type SpeciesTable } from './anatomy.js';
|
|
2
|
+
import type { RigJoint, RigPose } from './rig.js';
|
|
3
|
+
export { ANSUR2, ANSUR2_FEMALES, ANSUR2_MALES, type ANSUR2Dimension, type ANSUR2Row } from './anatomy-data-ansur2.js';
|
|
4
|
+
export { CDC_AGES, CDC_MOTIONS, CDC_RANGE_OF_MOTION, type CDCAge, type CDCCell, type CDCMotion, } from './anatomy-data-cdc.js';
|
|
5
|
+
export { DE_LEVA_1996, type DeLevaSegment, type DeLevaSegmentName } from './anatomy-data-deleva.js';
|
|
6
|
+
/** One motion segment of the spine: [joint, level, flexion plus extension, side bend to one side, rotation to one side], degrees. */
|
|
7
|
+
type SpineLevel = readonly [id: string, level: string, flexionExtension: number, sideBend: number, rotation: number];
|
|
8
|
+
/**
|
|
9
|
+
* The spine's motion segments, proximal first, with the rotation each takes: the weights that share a region's
|
|
10
|
+
* clinical range among its levels. Lumbar flexion plus extension of L1-L2 to L4-L5 is White and Panjabi 1990 as an
|
|
11
|
+
* open paper tabulates it, and lumbar side bend and rotation are Pearcy and Tibrewal 1984 (abstract); L5-S1 flexion
|
|
12
|
+
* plus extension, and every thoracic and cervical level, are White and Panjabi's representative values from recall.
|
|
13
|
+
* The thoracic levels are scaled to that book's thoracic totals as a readable page gives them (62, 36 and 32.5
|
|
14
|
+
* degrees): the per-level values were measured without the rib cage.
|
|
15
|
+
*/
|
|
16
|
+
export declare const HUMAN_SPINE_LEVELS: Readonly<Record<'lumbar' | 'thoracic' | 'cervical', readonly SpineLevel[]>>;
|
|
17
|
+
/** Who a table is for. */
|
|
18
|
+
export interface HumanGroup {
|
|
19
|
+
/** Uses that sex's rows of the range of motion study and of the anthropometric survey. Default: both. */
|
|
20
|
+
readonly sex?: 'female' | 'male';
|
|
21
|
+
/** Age in years: picks the study's age group (2 to 8, 9 to 19, 20 to 44, 45 to 69). Default 30. */
|
|
22
|
+
readonly age?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The human table for one group of people: the range of motion study's rows for that sex and age, and the survey's
|
|
26
|
+
* proportions for that sex. `human` is this with no group: adults of 20 to 44 years, the larger mean of the two sexes.
|
|
27
|
+
* @example
|
|
28
|
+
* import { humanTable } from '@margoengine/rigging/anatomy/human';
|
|
29
|
+
* import { fitAnatomy } from '@margoengine/rigging/anatomy';
|
|
30
|
+
*
|
|
31
|
+
* const child = fitAnatomy(rig, { species: humanTable({ age: 6 }) });
|
|
32
|
+
* @throws RangeError for an age that is not a positive number or a sex other than `female` or `male`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function humanTable(group?: HumanGroup): SpeciesTable;
|
|
35
|
+
/**
|
|
36
|
+
* The bone namings the human table knows: `hanim` (ISO/IEC 19774 joint names, with the HAnim 1.x names of renamed
|
|
37
|
+
* joints), `segments` (Mixamo-style names and the BVH form of the CMU captures), `joints` (the 100STYLE captures and
|
|
38
|
+
* other files that name a bone for its joint), the presets of `@margoengine/rigging/retarget`, `unreal` and `unreal5`
|
|
39
|
+
* (Unreal mannequin rigs with three or five spine bones, the bundled Quaternius library among the first) and `kaykit`
|
|
40
|
+
* (KayKit characters).
|
|
41
|
+
*/
|
|
42
|
+
export declare const HUMAN_NAMINGS: readonly string[];
|
|
43
|
+
/**
|
|
44
|
+
* The human table for adults of 20 to 44 years, both sexes: 139 joints in ISO/IEC 19774 (HAnim) names from
|
|
45
|
+
* `humanoid_root`, neutral with the arms down and the palms to the thighs.
|
|
46
|
+
* @example
|
|
47
|
+
* import { fitAnatomy, clampPose } from '@margoengine/rigging/anatomy';
|
|
48
|
+
* import { human } from '@margoengine/rigging/anatomy/human';
|
|
49
|
+
*
|
|
50
|
+
* const body = fitAnatomy(rig, { species: human });
|
|
51
|
+
* clampPose(body, pose);
|
|
52
|
+
*/
|
|
53
|
+
export declare const human: SpeciesTable;
|
|
54
|
+
/** Options of {@link fitHuman}: those of `fitAnatomy` without the species, and who the body is. */
|
|
55
|
+
export interface FitHumanOptions extends Omit<FitOptions, 'species'>, HumanGroup {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Fits the human table to a rig, with limits on: `fitAnatomy(rig, { species: human })`, or the table of a sex or age
|
|
59
|
+
* when one is given.
|
|
60
|
+
* @example
|
|
61
|
+
* import { fitHuman } from '@margoengine/rigging/anatomy/human';
|
|
62
|
+
*
|
|
63
|
+
* const body = fitHuman(rig);
|
|
64
|
+
* console.log(body.preset, body.restPose, body.stature);
|
|
65
|
+
* @throws As `fitAnatomy` and `humanTable` do.
|
|
66
|
+
*/
|
|
67
|
+
export declare function fitHuman(rig: RigPose | readonly RigJoint[], options?: FitHumanOptions): AnatomicalRig;
|