@things-factory/figure-ui 10.1.83 → 10.1.85
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/client/modeller/command-preview.ts +4 -2
- package/client/modeller/drawn-shapes.ts +29 -0
- package/client/modeller/editor.ts +17 -1
- package/client/modeller/figure-material-panel.ts +2 -3
- package/client/modeller/figure-parts.ts +13 -15
- package/client/modeller/figure-section-panel.ts +304 -0
- package/client/modeller/gizmo.ts +26 -16
- package/client/modeller/joint-fan.ts +4 -3
- package/client/modeller/links.ts +24 -24
- package/client/modeller/live.ts +8 -4
- package/client/modeller/maturity.ts +12 -6
- package/client/modeller/motion-ends.ts +2 -1
- package/client/modeller/refusals.ts +20 -0
- package/client/modeller/renderer.ts +3 -2
- package/client/modeller/section-controls.ts +115 -0
- package/client/modeller/starting-shape.ts +34 -0
- package/dist-client/modeller/command-preview.js +4 -2
- package/dist-client/modeller/command-preview.js.map +1 -1
- package/dist-client/modeller/drawn-shapes.d.ts +44 -0
- package/dist-client/modeller/drawn-shapes.js +12 -0
- package/dist-client/modeller/drawn-shapes.js.map +1 -0
- package/dist-client/modeller/editor.d.ts +3 -0
- package/dist-client/modeller/editor.js +16 -1
- package/dist-client/modeller/editor.js.map +1 -1
- package/dist-client/modeller/figure-capability-panel.d.ts +1 -1
- package/dist-client/modeller/figure-clips.d.ts +1 -1
- package/dist-client/modeller/figure-controls.d.ts +1 -1
- package/dist-client/modeller/figure-links.d.ts +1 -1
- package/dist-client/modeller/figure-material-panel.d.ts +1 -1
- package/dist-client/modeller/figure-material-panel.js +2 -3
- package/dist-client/modeller/figure-material-panel.js.map +1 -1
- package/dist-client/modeller/figure-parts.d.ts +3 -2
- package/dist-client/modeller/figure-parts.js +7 -12
- package/dist-client/modeller/figure-parts.js.map +1 -1
- package/dist-client/modeller/figure-properties.d.ts +1 -1
- package/dist-client/modeller/figure-section-panel.d.ts +42 -0
- package/dist-client/modeller/figure-section-panel.js +289 -0
- package/dist-client/modeller/figure-section-panel.js.map +1 -0
- package/dist-client/modeller/gizmo.d.ts +3 -3
- package/dist-client/modeller/gizmo.js +24 -11
- package/dist-client/modeller/gizmo.js.map +1 -1
- package/dist-client/modeller/joint-fan.js +4 -3
- package/dist-client/modeller/joint-fan.js.map +1 -1
- package/dist-client/modeller/links.d.ts +4 -1
- package/dist-client/modeller/links.js +23 -25
- package/dist-client/modeller/links.js.map +1 -1
- package/dist-client/modeller/live.d.ts +3 -1
- package/dist-client/modeller/live.js +6 -3
- package/dist-client/modeller/live.js.map +1 -1
- package/dist-client/modeller/maturity.d.ts +3 -2
- package/dist-client/modeller/maturity.js +9 -6
- package/dist-client/modeller/maturity.js.map +1 -1
- package/dist-client/modeller/motion-ends.js +2 -1
- package/dist-client/modeller/motion-ends.js.map +1 -1
- package/dist-client/modeller/refusals.d.ts +0 -5
- package/dist-client/modeller/refusals.js +25 -0
- package/dist-client/modeller/refusals.js.map +1 -1
- package/dist-client/modeller/renderer.d.ts +3 -4
- package/dist-client/modeller/renderer.js +3 -2
- package/dist-client/modeller/renderer.js.map +1 -1
- package/dist-client/modeller/section-controls.d.ts +44 -0
- package/dist-client/modeller/section-controls.js +91 -0
- package/dist-client/modeller/section-controls.js.map +1 -0
- package/dist-client/modeller/starting-shape.d.ts +32 -0
- package/dist-client/modeller/starting-shape.js +37 -0
- package/dist-client/modeller/starting-shape.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/test/browser/acceptance-page.js +8 -0
- package/test/command-preview.test.ts +3 -2
- package/test/fixtures/joint-column.json +110 -15
- package/test/fixtures/joint-roller.json +66 -9
- package/test/fixtures/robot-arm-6dof.json +203 -27
- package/test/joint-fan.test.ts +10 -7
- package/test/links.test.ts +4 -4
- package/test/material.test.ts +7 -2
- package/test/palette-icons.test.ts +1 -1
- package/test/parts-wiring.test.ts +6 -2
- package/test/renderer.test.ts +2 -1
- package/test/resize-with-placement.test.ts +3 -3
- package/test/scene-canvas.test.ts +2 -1
- package/test/section-panel.test.ts +192 -0
- package/translations/en.json +24 -0
- package/translations/ja.json +24 -0
- package/translations/ko.json +24 -0
- package/translations/ms.json +24 -0
- package/translations/zh.json +24 -0
- package/dist-client/tsconfig.localkernel.tsbuildinfo +0 -1
|
@@ -132,6 +132,21 @@
|
|
|
132
132
|
"id": "k.roller.dim.z",
|
|
133
133
|
"unit": "mm",
|
|
134
134
|
"value": 60
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "base.k.centre",
|
|
138
|
+
"unit": "ratio",
|
|
139
|
+
"value": -0.5
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "link.k.centre",
|
|
143
|
+
"unit": "ratio",
|
|
144
|
+
"value": -0.5
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "roller.k.centre",
|
|
148
|
+
"unit": "ratio",
|
|
149
|
+
"value": -0.5
|
|
135
150
|
}
|
|
136
151
|
],
|
|
137
152
|
"nodes": [
|
|
@@ -590,17 +605,20 @@
|
|
|
590
605
|
},
|
|
591
606
|
{
|
|
592
607
|
"id": "base.shape",
|
|
593
|
-
"op": "
|
|
608
|
+
"op": "extrude@1",
|
|
594
609
|
"args": [
|
|
595
|
-
"base.
|
|
610
|
+
"base.start.value",
|
|
596
611
|
"base.dim.y.value",
|
|
612
|
+
"base.dim.x.value",
|
|
597
613
|
"base.dim.z.value"
|
|
598
614
|
],
|
|
599
615
|
"outputs": {
|
|
600
616
|
"shape": "base.shape.value"
|
|
601
617
|
},
|
|
602
618
|
"params": {
|
|
603
|
-
"frame": "base.local"
|
|
619
|
+
"frame": "base.local",
|
|
620
|
+
"axis": "y",
|
|
621
|
+
"section": "rectangle"
|
|
604
622
|
}
|
|
605
623
|
},
|
|
606
624
|
{
|
|
@@ -668,17 +686,20 @@
|
|
|
668
686
|
},
|
|
669
687
|
{
|
|
670
688
|
"id": "link.shape",
|
|
671
|
-
"op": "
|
|
689
|
+
"op": "extrude@1",
|
|
672
690
|
"args": [
|
|
673
|
-
"link.
|
|
691
|
+
"link.start.value",
|
|
674
692
|
"link.dim.y.value",
|
|
693
|
+
"link.dim.x.value",
|
|
675
694
|
"link.dim.z.value"
|
|
676
695
|
],
|
|
677
696
|
"outputs": {
|
|
678
697
|
"shape": "link.shape.value"
|
|
679
698
|
},
|
|
680
699
|
"params": {
|
|
681
|
-
"frame": "link.local"
|
|
700
|
+
"frame": "link.local",
|
|
701
|
+
"axis": "y",
|
|
702
|
+
"section": "rectangle"
|
|
682
703
|
}
|
|
683
704
|
},
|
|
684
705
|
{
|
|
@@ -757,17 +778,20 @@
|
|
|
757
778
|
},
|
|
758
779
|
{
|
|
759
780
|
"id": "roller.shape",
|
|
760
|
-
"op": "
|
|
781
|
+
"op": "extrude@1",
|
|
761
782
|
"args": [
|
|
762
|
-
"roller.
|
|
783
|
+
"roller.start.value",
|
|
763
784
|
"roller.dim.y.value",
|
|
785
|
+
"roller.dim.x.value",
|
|
764
786
|
"roller.dim.z.value"
|
|
765
787
|
],
|
|
766
788
|
"outputs": {
|
|
767
789
|
"shape": "roller.shape.value"
|
|
768
790
|
},
|
|
769
791
|
"params": {
|
|
770
|
-
"frame": "roller.local"
|
|
792
|
+
"frame": "roller.local",
|
|
793
|
+
"axis": "y",
|
|
794
|
+
"section": "rectangle"
|
|
771
795
|
}
|
|
772
796
|
},
|
|
773
797
|
{
|
|
@@ -810,6 +834,39 @@
|
|
|
810
834
|
"outputs": {
|
|
811
835
|
"placed": "roller.value"
|
|
812
836
|
}
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"id": "base.start",
|
|
840
|
+
"op": "mul@1",
|
|
841
|
+
"args": [
|
|
842
|
+
"base.dim.y.value",
|
|
843
|
+
"base.k.centre"
|
|
844
|
+
],
|
|
845
|
+
"outputs": {
|
|
846
|
+
"value": "base.start.value"
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"id": "link.start",
|
|
851
|
+
"op": "mul@1",
|
|
852
|
+
"args": [
|
|
853
|
+
"link.dim.y.value",
|
|
854
|
+
"link.k.centre"
|
|
855
|
+
],
|
|
856
|
+
"outputs": {
|
|
857
|
+
"value": "link.start.value"
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"id": "roller.start",
|
|
862
|
+
"op": "mul@1",
|
|
863
|
+
"args": [
|
|
864
|
+
"roller.dim.y.value",
|
|
865
|
+
"roller.k.centre"
|
|
866
|
+
],
|
|
867
|
+
"outputs": {
|
|
868
|
+
"value": "roller.start.value"
|
|
869
|
+
}
|
|
813
870
|
}
|
|
814
871
|
]
|
|
815
872
|
},
|
|
@@ -322,6 +322,51 @@
|
|
|
322
322
|
"id": "k.finger-left.dim.z",
|
|
323
323
|
"unit": "mm",
|
|
324
324
|
"value": 24
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"id": "pedestal.k.centre",
|
|
328
|
+
"unit": "ratio",
|
|
329
|
+
"value": -0.5
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "shoulder.k.centre",
|
|
333
|
+
"unit": "ratio",
|
|
334
|
+
"value": -0.5
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"id": "upper-arm.k.centre",
|
|
338
|
+
"unit": "ratio",
|
|
339
|
+
"value": -0.5
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"id": "forearm.k.centre",
|
|
343
|
+
"unit": "ratio",
|
|
344
|
+
"value": -0.5
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"id": "wrist-1.k.centre",
|
|
348
|
+
"unit": "ratio",
|
|
349
|
+
"value": -0.5
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"id": "wrist-2.k.centre",
|
|
353
|
+
"unit": "ratio",
|
|
354
|
+
"value": -0.5
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "flange.k.centre",
|
|
358
|
+
"unit": "ratio",
|
|
359
|
+
"value": -0.5
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"id": "finger-left.k.centre",
|
|
363
|
+
"unit": "ratio",
|
|
364
|
+
"value": -0.5
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"id": "finger-right.k.centre",
|
|
368
|
+
"unit": "ratio",
|
|
369
|
+
"value": -0.5
|
|
325
370
|
}
|
|
326
371
|
],
|
|
327
372
|
"nodes": [
|
|
@@ -1818,16 +1863,20 @@
|
|
|
1818
1863
|
},
|
|
1819
1864
|
{
|
|
1820
1865
|
"id": "pedestal.shape",
|
|
1821
|
-
"op": "
|
|
1866
|
+
"op": "extrude@1",
|
|
1822
1867
|
"args": [
|
|
1868
|
+
"pedestal.start.value",
|
|
1869
|
+
"pedestal.dim.y.value",
|
|
1823
1870
|
"pedestal.dim.radiusX.value",
|
|
1824
|
-
"pedestal.dim.
|
|
1871
|
+
"pedestal.dim.radiusX.value"
|
|
1825
1872
|
],
|
|
1826
1873
|
"outputs": {
|
|
1827
1874
|
"shape": "pedestal.shape.value"
|
|
1828
1875
|
},
|
|
1829
1876
|
"params": {
|
|
1830
|
-
"frame": "pedestal.local"
|
|
1877
|
+
"frame": "pedestal.local",
|
|
1878
|
+
"axis": "y",
|
|
1879
|
+
"section": "ellipse"
|
|
1831
1880
|
}
|
|
1832
1881
|
},
|
|
1833
1882
|
{
|
|
@@ -1895,16 +1944,20 @@
|
|
|
1895
1944
|
},
|
|
1896
1945
|
{
|
|
1897
1946
|
"id": "shoulder.shape",
|
|
1898
|
-
"op": "
|
|
1947
|
+
"op": "extrude@1",
|
|
1899
1948
|
"args": [
|
|
1949
|
+
"shoulder.start.value",
|
|
1950
|
+
"shoulder.dim.y.value",
|
|
1900
1951
|
"shoulder.dim.radiusX.value",
|
|
1901
|
-
"shoulder.dim.
|
|
1952
|
+
"shoulder.dim.radiusX.value"
|
|
1902
1953
|
],
|
|
1903
1954
|
"outputs": {
|
|
1904
1955
|
"shape": "shoulder.shape.value"
|
|
1905
1956
|
},
|
|
1906
1957
|
"params": {
|
|
1907
|
-
"frame": "shoulder.local"
|
|
1958
|
+
"frame": "shoulder.local",
|
|
1959
|
+
"axis": "y",
|
|
1960
|
+
"section": "ellipse"
|
|
1908
1961
|
}
|
|
1909
1962
|
},
|
|
1910
1963
|
{
|
|
@@ -1983,17 +2036,20 @@
|
|
|
1983
2036
|
},
|
|
1984
2037
|
{
|
|
1985
2038
|
"id": "upper-arm.shape",
|
|
1986
|
-
"op": "
|
|
2039
|
+
"op": "extrude@1",
|
|
1987
2040
|
"args": [
|
|
1988
|
-
"upper-arm.
|
|
2041
|
+
"upper-arm.start.value",
|
|
1989
2042
|
"upper-arm.dim.y.value",
|
|
2043
|
+
"upper-arm.dim.x.value",
|
|
1990
2044
|
"upper-arm.dim.z.value"
|
|
1991
2045
|
],
|
|
1992
2046
|
"outputs": {
|
|
1993
2047
|
"shape": "upper-arm.shape.value"
|
|
1994
2048
|
},
|
|
1995
2049
|
"params": {
|
|
1996
|
-
"frame": "upper-arm.local"
|
|
2050
|
+
"frame": "upper-arm.local",
|
|
2051
|
+
"axis": "y",
|
|
2052
|
+
"section": "rectangle"
|
|
1997
2053
|
}
|
|
1998
2054
|
},
|
|
1999
2055
|
{
|
|
@@ -2072,17 +2128,20 @@
|
|
|
2072
2128
|
},
|
|
2073
2129
|
{
|
|
2074
2130
|
"id": "forearm.shape",
|
|
2075
|
-
"op": "
|
|
2131
|
+
"op": "extrude@1",
|
|
2076
2132
|
"args": [
|
|
2077
|
-
"forearm.
|
|
2133
|
+
"forearm.start.value",
|
|
2078
2134
|
"forearm.dim.y.value",
|
|
2135
|
+
"forearm.dim.x.value",
|
|
2079
2136
|
"forearm.dim.z.value"
|
|
2080
2137
|
],
|
|
2081
2138
|
"outputs": {
|
|
2082
2139
|
"shape": "forearm.shape.value"
|
|
2083
2140
|
},
|
|
2084
2141
|
"params": {
|
|
2085
|
-
"frame": "forearm.local"
|
|
2142
|
+
"frame": "forearm.local",
|
|
2143
|
+
"axis": "y",
|
|
2144
|
+
"section": "rectangle"
|
|
2086
2145
|
}
|
|
2087
2146
|
},
|
|
2088
2147
|
{
|
|
@@ -2161,16 +2220,20 @@
|
|
|
2161
2220
|
},
|
|
2162
2221
|
{
|
|
2163
2222
|
"id": "wrist-1.shape",
|
|
2164
|
-
"op": "
|
|
2223
|
+
"op": "extrude@1",
|
|
2165
2224
|
"args": [
|
|
2225
|
+
"wrist-1.start.value",
|
|
2226
|
+
"wrist-1.dim.y.value",
|
|
2166
2227
|
"wrist-1.dim.radiusX.value",
|
|
2167
|
-
"wrist-1.dim.
|
|
2228
|
+
"wrist-1.dim.radiusX.value"
|
|
2168
2229
|
],
|
|
2169
2230
|
"outputs": {
|
|
2170
2231
|
"shape": "wrist-1.shape.value"
|
|
2171
2232
|
},
|
|
2172
2233
|
"params": {
|
|
2173
|
-
"frame": "wrist-1.local"
|
|
2234
|
+
"frame": "wrist-1.local",
|
|
2235
|
+
"axis": "y",
|
|
2236
|
+
"section": "ellipse"
|
|
2174
2237
|
}
|
|
2175
2238
|
},
|
|
2176
2239
|
{
|
|
@@ -2249,16 +2312,20 @@
|
|
|
2249
2312
|
},
|
|
2250
2313
|
{
|
|
2251
2314
|
"id": "wrist-2.shape",
|
|
2252
|
-
"op": "
|
|
2315
|
+
"op": "extrude@1",
|
|
2253
2316
|
"args": [
|
|
2317
|
+
"wrist-2.start.value",
|
|
2318
|
+
"wrist-2.dim.y.value",
|
|
2254
2319
|
"wrist-2.dim.radiusX.value",
|
|
2255
|
-
"wrist-2.dim.
|
|
2320
|
+
"wrist-2.dim.radiusX.value"
|
|
2256
2321
|
],
|
|
2257
2322
|
"outputs": {
|
|
2258
2323
|
"shape": "wrist-2.shape.value"
|
|
2259
2324
|
},
|
|
2260
2325
|
"params": {
|
|
2261
|
-
"frame": "wrist-2.local"
|
|
2326
|
+
"frame": "wrist-2.local",
|
|
2327
|
+
"axis": "y",
|
|
2328
|
+
"section": "ellipse"
|
|
2262
2329
|
}
|
|
2263
2330
|
},
|
|
2264
2331
|
{
|
|
@@ -2337,16 +2404,20 @@
|
|
|
2337
2404
|
},
|
|
2338
2405
|
{
|
|
2339
2406
|
"id": "flange.shape",
|
|
2340
|
-
"op": "
|
|
2407
|
+
"op": "extrude@1",
|
|
2341
2408
|
"args": [
|
|
2409
|
+
"flange.start.value",
|
|
2410
|
+
"flange.dim.y.value",
|
|
2342
2411
|
"flange.dim.radiusX.value",
|
|
2343
|
-
"flange.dim.
|
|
2412
|
+
"flange.dim.radiusX.value"
|
|
2344
2413
|
],
|
|
2345
2414
|
"outputs": {
|
|
2346
2415
|
"shape": "flange.shape.value"
|
|
2347
2416
|
},
|
|
2348
2417
|
"params": {
|
|
2349
|
-
"frame": "flange.local"
|
|
2418
|
+
"frame": "flange.local",
|
|
2419
|
+
"axis": "y",
|
|
2420
|
+
"section": "ellipse"
|
|
2350
2421
|
}
|
|
2351
2422
|
},
|
|
2352
2423
|
{
|
|
@@ -2425,17 +2496,20 @@
|
|
|
2425
2496
|
},
|
|
2426
2497
|
{
|
|
2427
2498
|
"id": "finger-left.shape",
|
|
2428
|
-
"op": "
|
|
2499
|
+
"op": "extrude@1",
|
|
2429
2500
|
"args": [
|
|
2430
|
-
"finger-left.
|
|
2501
|
+
"finger-left.start.value",
|
|
2431
2502
|
"finger-left.dim.y.value",
|
|
2503
|
+
"finger-left.dim.x.value",
|
|
2432
2504
|
"finger-left.dim.z.value"
|
|
2433
2505
|
],
|
|
2434
2506
|
"outputs": {
|
|
2435
2507
|
"shape": "finger-left.shape.value"
|
|
2436
2508
|
},
|
|
2437
2509
|
"params": {
|
|
2438
|
-
"frame": "finger-left.local"
|
|
2510
|
+
"frame": "finger-left.local",
|
|
2511
|
+
"axis": "y",
|
|
2512
|
+
"section": "rectangle"
|
|
2439
2513
|
}
|
|
2440
2514
|
},
|
|
2441
2515
|
{
|
|
@@ -2542,17 +2616,20 @@
|
|
|
2542
2616
|
},
|
|
2543
2617
|
{
|
|
2544
2618
|
"id": "finger-right.shape",
|
|
2545
|
-
"op": "
|
|
2619
|
+
"op": "extrude@1",
|
|
2546
2620
|
"args": [
|
|
2547
|
-
"finger-right.
|
|
2621
|
+
"finger-right.start.value",
|
|
2548
2622
|
"finger-right.dim.y.value",
|
|
2623
|
+
"finger-right.dim.x.value",
|
|
2549
2624
|
"finger-right.dim.z.value"
|
|
2550
2625
|
],
|
|
2551
2626
|
"outputs": {
|
|
2552
2627
|
"shape": "finger-right.shape.value"
|
|
2553
2628
|
},
|
|
2554
2629
|
"params": {
|
|
2555
|
-
"frame": "finger-right.local"
|
|
2630
|
+
"frame": "finger-right.local",
|
|
2631
|
+
"axis": "y",
|
|
2632
|
+
"section": "rectangle"
|
|
2556
2633
|
}
|
|
2557
2634
|
},
|
|
2558
2635
|
{
|
|
@@ -2623,6 +2700,105 @@
|
|
|
2623
2700
|
"outputs": {
|
|
2624
2701
|
"placed": "finger-right.value"
|
|
2625
2702
|
}
|
|
2703
|
+
},
|
|
2704
|
+
{
|
|
2705
|
+
"id": "pedestal.start",
|
|
2706
|
+
"op": "mul@1",
|
|
2707
|
+
"args": [
|
|
2708
|
+
"pedestal.dim.y.value",
|
|
2709
|
+
"pedestal.k.centre"
|
|
2710
|
+
],
|
|
2711
|
+
"outputs": {
|
|
2712
|
+
"value": "pedestal.start.value"
|
|
2713
|
+
}
|
|
2714
|
+
},
|
|
2715
|
+
{
|
|
2716
|
+
"id": "shoulder.start",
|
|
2717
|
+
"op": "mul@1",
|
|
2718
|
+
"args": [
|
|
2719
|
+
"shoulder.dim.y.value",
|
|
2720
|
+
"shoulder.k.centre"
|
|
2721
|
+
],
|
|
2722
|
+
"outputs": {
|
|
2723
|
+
"value": "shoulder.start.value"
|
|
2724
|
+
}
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
"id": "upper-arm.start",
|
|
2728
|
+
"op": "mul@1",
|
|
2729
|
+
"args": [
|
|
2730
|
+
"upper-arm.dim.y.value",
|
|
2731
|
+
"upper-arm.k.centre"
|
|
2732
|
+
],
|
|
2733
|
+
"outputs": {
|
|
2734
|
+
"value": "upper-arm.start.value"
|
|
2735
|
+
}
|
|
2736
|
+
},
|
|
2737
|
+
{
|
|
2738
|
+
"id": "forearm.start",
|
|
2739
|
+
"op": "mul@1",
|
|
2740
|
+
"args": [
|
|
2741
|
+
"forearm.dim.y.value",
|
|
2742
|
+
"forearm.k.centre"
|
|
2743
|
+
],
|
|
2744
|
+
"outputs": {
|
|
2745
|
+
"value": "forearm.start.value"
|
|
2746
|
+
}
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
"id": "wrist-1.start",
|
|
2750
|
+
"op": "mul@1",
|
|
2751
|
+
"args": [
|
|
2752
|
+
"wrist-1.dim.y.value",
|
|
2753
|
+
"wrist-1.k.centre"
|
|
2754
|
+
],
|
|
2755
|
+
"outputs": {
|
|
2756
|
+
"value": "wrist-1.start.value"
|
|
2757
|
+
}
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
"id": "wrist-2.start",
|
|
2761
|
+
"op": "mul@1",
|
|
2762
|
+
"args": [
|
|
2763
|
+
"wrist-2.dim.y.value",
|
|
2764
|
+
"wrist-2.k.centre"
|
|
2765
|
+
],
|
|
2766
|
+
"outputs": {
|
|
2767
|
+
"value": "wrist-2.start.value"
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
"id": "flange.start",
|
|
2772
|
+
"op": "mul@1",
|
|
2773
|
+
"args": [
|
|
2774
|
+
"flange.dim.y.value",
|
|
2775
|
+
"flange.k.centre"
|
|
2776
|
+
],
|
|
2777
|
+
"outputs": {
|
|
2778
|
+
"value": "flange.start.value"
|
|
2779
|
+
}
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
"id": "finger-left.start",
|
|
2783
|
+
"op": "mul@1",
|
|
2784
|
+
"args": [
|
|
2785
|
+
"finger-left.dim.y.value",
|
|
2786
|
+
"finger-left.k.centre"
|
|
2787
|
+
],
|
|
2788
|
+
"outputs": {
|
|
2789
|
+
"value": "finger-left.start.value"
|
|
2790
|
+
}
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
"id": "finger-right.start",
|
|
2794
|
+
"op": "mul@1",
|
|
2795
|
+
"args": [
|
|
2796
|
+
"finger-right.dim.y.value",
|
|
2797
|
+
"finger-right.k.centre"
|
|
2798
|
+
],
|
|
2799
|
+
"outputs": {
|
|
2800
|
+
"value": "finger-right.start.value"
|
|
2801
|
+
}
|
|
2626
2802
|
}
|
|
2627
2803
|
]
|
|
2628
2804
|
},
|
package/test/joint-fan.test.ts
CHANGED
|
@@ -26,6 +26,9 @@ function arm(): FigureAsset {
|
|
|
26
26
|
}
|
|
27
27
|
const PIVOT = [-100, 100, 0]
|
|
28
28
|
|
|
29
|
+
/** The fan's section as points (x, y): the section lies in its local X–Z, so a point (x, y) is local (x, 0, y). */
|
|
30
|
+
const profileOf = (fan: unknown) => ((fan as { shape: { extrusion: { section: { points: Array<{ x: number; z: number }> } } } }).shape.extrusion.section.points).map(p => ({ x: p.x, y: p.z }))
|
|
31
|
+
|
|
29
32
|
/** The fan's profile point in the figure's frame. The polygon lies in its local X–Z: profile (x, y) is local (x, 0, y). */
|
|
30
33
|
const world = (fan: { pose: { t: number[]; r: number[][] } }, p: { x: number; y: number }) =>
|
|
31
34
|
[0, 1, 2].map(i => fan.pose.t[i]! + fan.pose.r[i]![0]! * p.x + fan.pose.r[i]![2]! * p.y)
|
|
@@ -43,8 +46,8 @@ test('a part that turns gets a fan from the lowest value to the highest, where t
|
|
|
43
46
|
const fan = jointFanOf(asset, 'arm') as unknown as { id: string; shape: { provider: string; profile: { x: number; y: number }[] }; pose: { t: number[]; r: number[][] } }
|
|
44
47
|
assert.ok(fan)
|
|
45
48
|
assert.equal(fan.id, JOINT_FAN)
|
|
46
|
-
assert.equal(fan.shape.provider, '
|
|
47
|
-
const profile = fan
|
|
49
|
+
assert.equal(fan.shape.provider, 'extrude', 'a section pushed thin, drawn as a part is')
|
|
50
|
+
const profile = profileOf(fan)
|
|
48
51
|
assert.deepEqual(profile[0], { x: 0, y: 0 }, 'not a full turn: the fan starts at the pivot')
|
|
49
52
|
|
|
50
53
|
const armAt = (deg: number) => {
|
|
@@ -63,7 +66,7 @@ test('a part that turns gets a fan from the lowest value to the highest, where t
|
|
|
63
66
|
|
|
64
67
|
test('a fan is as large as what turns, and never smaller than 60 mm', () => {
|
|
65
68
|
const big = jointFanOf(arm(), 'arm') as unknown as { shape: { profile: { x: number; y: number }[] } }
|
|
66
|
-
const radius = Math.max(...big.
|
|
69
|
+
const radius = Math.max(...profileOf(big).map(p => Math.hypot(p.x, p.y)))
|
|
67
70
|
assert.ok(Math.abs(radius - 240) < 1e-3, `0.6 × 400 — ${radius}`)
|
|
68
71
|
})
|
|
69
72
|
|
|
@@ -71,7 +74,7 @@ test('no fan for a part that does not turn, nor for a slide -- a fan in a guesse
|
|
|
71
74
|
/* The base does not turn; it shows the joint that sits on it, the arm's -- one joint, one fan (the elbow rule). */
|
|
72
75
|
const onBase = jointFanOf(arm(), 'base') as unknown as { shape: { profile: unknown[] } }
|
|
73
76
|
const ofArm = jointFanOf(arm(), 'arm') as unknown as { shape: { profile: unknown[] } }
|
|
74
|
-
assert.deepEqual(onBase
|
|
77
|
+
assert.deepEqual(profileOf(onBase), profileOf(ofArm))
|
|
75
78
|
assert.equal(jointFanOf(arm(), ''), null)
|
|
76
79
|
let slider = createFigureAsset('Probe')
|
|
77
80
|
slider = addFigureBox(slider, { id: 'block', size: { x: 100, y: 100, z: 100 }, position: { x: 0, y: 50, z: 0 } })
|
|
@@ -132,7 +135,7 @@ for (const [part, joint] of [
|
|
|
132
135
|
const axial = [input.min!, 0, input.max!].map(s => dot(sub(at(s).pose.t, pivot), axis))
|
|
133
136
|
assert.ok(Math.max(...axial) - Math.min(...axial) < 1e-6, `the part stays in the fan's plane: ${axial}`)
|
|
134
137
|
|
|
135
|
-
const edges = fan.
|
|
138
|
+
const edges = profileOf(fan).filter(p => p.x !== 0 || p.y !== 0)
|
|
136
139
|
assert.ok(angle(flat(sub(onFan(edges[0]!), pivot)), flat(sub(at(input.min!).pose.t, pivot))) < 0.01, 'the first edge is where the part is at the lowest value (the profile is kept to a micrometre)')
|
|
137
140
|
assert.ok(angle(flat(sub(onFan(edges[edges.length - 1]!), pivot)), flat(sub(at(input.max!).pose.t, pivot))) < 0.01, 'the last edge, at the highest')
|
|
138
141
|
|
|
@@ -162,7 +165,7 @@ test('a housing shows the joint it houses, not the one that carries it; a part t
|
|
|
162
165
|
const flat = (v: number[]) => sub(v, axis.map(a => a * dot(v, axis)))
|
|
163
166
|
const onFan = (p: { x: number; y: number }) => [0, 1, 2].map(i => fan.pose.t[i]! + fan.pose.r[i]![0]! * p.x + fan.pose.r[i]![2]! * p.y)
|
|
164
167
|
const tipAt = (s: number) => (compileFigureAsset({ ...asset, stateDefaults: { ...asset.stateDefaults, wrist: s } }).evaluate().geometry.find(g => g.id === 'tip') as unknown as { pose: { t: number[] } }).pose.t
|
|
165
|
-
const edges = fan.
|
|
168
|
+
const edges = profileOf(fan).filter(p => p.x !== 0 || p.y !== 0)
|
|
166
169
|
assert.ok(angle(flat(sub(onFan(edges[0]!), fan.pose.t)), flat(sub(tipAt(-120), fan.pose.t))) < 0.01)
|
|
167
170
|
assert.ok(angle(flat(sub(onFan(edges[edges.length - 1]!), fan.pose.t)), flat(sub(tipAt(120), fan.pose.t))) < 0.01)
|
|
168
171
|
})
|
|
@@ -171,7 +174,7 @@ test('one joint, one fan: the housing and the part it turns show the same fan, s
|
|
|
171
174
|
const asset = column()
|
|
172
175
|
const size = (part: string) => {
|
|
173
176
|
const fan = jointFanOf(asset, part) as unknown as { shape: { profile: { x: number; y: number }[] }; pose: { t: number[] } }
|
|
174
|
-
return { radius: Math.max(...fan.
|
|
177
|
+
return { radius: Math.max(...profileOf(fan).map(p => Math.hypot(p.x, p.y))), pivot: fan.pose.t }
|
|
175
178
|
}
|
|
176
179
|
const housing = size('housing'),
|
|
177
180
|
tip = size('tip')
|
package/test/links.test.ts
CHANGED
|
@@ -121,7 +121,7 @@ test('자리 — 부품의 면에 둔 집는 자리·놓는 자리를 그 부품
|
|
|
121
121
|
let asset = pair()
|
|
122
122
|
asset = addFigurePrimitive(asset, { id: 'drum', kind: 'cylinder', dimensions: { radius: 100, length: 300 }, position: { x: 0, y: 400, z: 0 } } as never)
|
|
123
123
|
assert.deepEqual(placeFacesOf(asset, 'block'), ['left', 'right', 'bottom', 'top', 'back', 'front'])
|
|
124
|
-
assert.deepEqual(placeFacesOf(asset, 'drum'), [], '둥근
|
|
124
|
+
assert.deepEqual(placeFacesOf(asset, 'drum'), ['bottom', 'top'], '둥근 몸은 두 끝면에만 — 옆면은 선으로 닿을 뿐이다(Q3)')
|
|
125
125
|
|
|
126
126
|
assert.equal(placeIdFor(asset, 'block', 'grip'), 'block-grip')
|
|
127
127
|
asset = applyFigureAuthoring(asset, { kind: 'add-binding', id: placeIdFor(asset, 'block', 'grip'), label: '집는 자리', role: 'grip', part: 'block', face: 'top', accepts: acceptsOf(' BOX, TOTE,, BOX '), capacity: 2 })
|
|
@@ -435,7 +435,7 @@ test('모델러에서 만든 도형은 부품에서 재어 도형 크기를 선
|
|
|
435
435
|
assert.equal(instanceRangeToDeclare(asset), undefined, '이미 있으면 다시 권하지 않는다')
|
|
436
436
|
assert.equal(hasInstanceSize(asset, 'x'), true, '부품이 도형 크기를 따르는 선택이 열린다')
|
|
437
437
|
asset = applyFigureAuthoring(asset, { kind: 'link-dimension', part: 'frame', axis: 'x', source: { of: 'instance', axis: 'x' } } as never)
|
|
438
|
-
const at = (size: number) => (compileFigureAsset({ ...asset, designInputs: { ...asset.designInputs, 'size.x': size } }).evaluate().geometry.find(g => g.id === 'frame')!.shape.dimensions as
|
|
438
|
+
const at = (size: number) => (compileFigureAsset({ ...asset, designInputs: { ...asset.designInputs, 'size.x': size } }).evaluate().geometry.find(g => g.id === 'frame')!.shape.dimensions as Record<string, number>)['size.x']
|
|
439
439
|
assert.equal(at(3000), 3000, '보드가 3000 으로 놓으면 틀도 3000')
|
|
440
440
|
})
|
|
441
441
|
|
|
@@ -449,7 +449,7 @@ test('따르는 치수의 더하기를 읽는다 — 문짝 폭 = 개구부 −
|
|
|
449
449
|
assert.equal(choiceOf(followOf(asset, 'leaf', 'x')), 'part:head:x', '선택은 그대로 — 더하기는 따로')
|
|
450
450
|
const { compileFigureAsset } = await import('@hatiolab/figure-model')
|
|
451
451
|
const wide = { ...asset, designInputs: { ...asset.designInputs, 'head.size.x': 1500 } }
|
|
452
|
-
assert.equal((compileFigureAsset(wide).evaluate().geometry.find(g => g.id === 'leaf')!.shape.dimensions as
|
|
452
|
+
assert.equal((compileFigureAsset(wide).evaluate().geometry.find(g => g.id === 'leaf')!.shape.dimensions as Record<string, number>)['size.x'], 1290, '상인방 1500 이면 문짝 1290')
|
|
453
453
|
asset = applyFigureAuthoring(asset, { kind: 'declare-instance-size', range: { x: { min: 500, max: 5000 }, y: { min: 500, max: 5000 }, z: { min: 50, max: 500 } }, at: { x: 1100, y: 2200, z: 150 } })
|
|
454
454
|
asset = applyFigureAuthoring(asset, { kind: 'link-dimension', part: 'head', axis: 'x', source: { of: 'instance', axis: 'x' }, times: 0.5, plus: 20 })
|
|
455
455
|
assert.deepEqual(followOf(asset, 'head', 'x'), { of: 'instance', axis: 'x', times: 0.5, plus: 20 })
|
|
@@ -596,7 +596,7 @@ test('보이는 때 — 명령이 남긴 것을 읽고, 폼은 그 명령을 낸
|
|
|
596
596
|
assert.ok(form.includes('${this.renderShown(asset)}'), '움직임 칸에')
|
|
597
597
|
})
|
|
598
598
|
|
|
599
|
-
/* 문틀은 폭 · 높이 · 깊이로 — 상자처럼 크기를 따르고, 손잡이로 키운다 (figure-model portal
|
|
599
|
+
/* 문틀은 폭 · 높이 · 깊이로 — 상자처럼 크기를 따르고, 손잡이로 키운다 (figure-model 의 portal 단면, 09-26 · ADR-0100). */
|
|
600
600
|
test('팔레트의 문틀은 문 크기로 서고, 세 축 모두 크기를 따를 수 있고, 손잡이로 키울 수 있다', async () => {
|
|
601
601
|
const { paletteRecipe } = await import('../client/modeller/palette.ts')
|
|
602
602
|
const { gizmoReachOf } = await import('../client/modeller/gizmo.ts')
|
package/test/material.test.ts
CHANGED
|
@@ -45,8 +45,13 @@ test('발광 세기 0 은 발광을 없앤다 — 빈 칸을 남기지 않는다
|
|
|
45
45
|
assert.match(material, /if \(material\[key\] === undefined\) delete material\[key\]/)
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
test('곡면 분할은 둥근 몸체에만 내고, 고르면 삼각형 수가 그만큼 바뀐다', () => {
|
|
49
|
-
assert.match(material, /
|
|
48
|
+
test('곡면 분할은 둥근 몸체에만 내고, 고르면 삼각형 수가 그만큼 바뀐다', async () => {
|
|
49
|
+
assert.match(material, /if \(!isRoundBody\(/, 'the panel asks the one rule')
|
|
50
|
+
const { isRoundBody } = await import('../client/modeller/starting-shape.ts')
|
|
51
|
+
const { boxShape, discShape } = await import('../client/modeller/drawn-shapes.ts')
|
|
52
|
+
assert.equal(isRoundBody(discShape(50, 10) as never), true, 'a circle pushed is round')
|
|
53
|
+
assert.equal(isRoundBody(boxShape(50, 10, 50) as never), false, 'a box is not')
|
|
54
|
+
assert.equal(isRoundBody({ provider: 'revolve', dimensions: {}, revolution: { profile: { kind: 'half-ellipse' } } } as never), true, 'a turned body is')
|
|
50
55
|
const coarse = figureCostOf(editFigurePart(probe(), { kind: 'set-segments', target: 'drum', segments: 8 })).triangles
|
|
51
56
|
const fine = figureCostOf(editFigurePart(probe(), { kind: 'set-segments', target: 'drum', segments: 48 })).triangles
|
|
52
57
|
assert.ok(fine > coarse, `48 분할이 8 분할보다 삼각형이 많다 (${coarse} → ${fine})`)
|
|
@@ -17,6 +17,6 @@ test('every shape in the palette has an icon the font draws', () => {
|
|
|
17
17
|
const parts = readFileSync(fileURLToPath(new URL('../client/modeller/figure-parts.ts', import.meta.url)), 'utf8')
|
|
18
18
|
const recipes = parts.slice(parts.indexOf('const RECIPES'), parts.indexOf(']', parts.indexOf('const RECIPES')))
|
|
19
19
|
const icons = [...recipes.matchAll(/icon: '([a-z_]+)'/g)].map(m => m[1]!)
|
|
20
|
-
assert.ok(icons.length >=
|
|
20
|
+
assert.ok(icons.length >= 8, 'the eight starting shapes (ADR-0100 §2.1)')
|
|
21
21
|
assert.deepEqual(icons.filter(icon => !RENDERS.has(icon)), [])
|
|
22
22
|
})
|
|
@@ -57,8 +57,12 @@ test('좁은 칸에서도 고른 줄의 이름과 조작이 다 보인다 —
|
|
|
57
57
|
assert.match(narrow, /li\[selected\] div\[ops\] \{\s*flex-basis: 100%;/)
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
test('둥근
|
|
61
|
-
|
|
60
|
+
test('팔레트는 시작 모양만 낸다 — 둥근 상자와 통은 상자의 모서리·속 공간으로 만든다 (ADR-0100 §2.1·§3.3)', () => {
|
|
61
|
+
const recipes = panel.slice(panel.indexOf('const RECIPES'), panel.indexOf(']', panel.indexOf('const RECIPES')))
|
|
62
|
+
const kinds = [...recipes.matchAll(/kind: '([\w-]+)'/g)].map(m => m[1])
|
|
63
|
+
assert.deepEqual(kinds, ['box', 'cylinder', 'sphere', 'frustum', 'polygon', 'plate', 'wall', 'portal'])
|
|
64
|
+
/* A part made so is still called by what it is: its icon in the parts list, its name over the properties (links.ts). */
|
|
65
|
+
assert.match(panel, /'rounded-box': 'crop_square'/)
|
|
62
66
|
for (const lang of ['ko', 'en', 'ja', 'zh', 'ms'])
|
|
63
67
|
assert.ok(JSON.parse(read(`../translations/${lang}.json`))['figure.label.primitive-rounded-box'], lang)
|
|
64
68
|
})
|
package/test/renderer.test.ts
CHANGED
|
@@ -3,7 +3,8 @@ import assert from 'node:assert/strict'
|
|
|
3
3
|
import * as THREE from 'three'
|
|
4
4
|
import {replaceFigureMeshes} from '../client/modeller/renderer.ts'
|
|
5
5
|
import type {FigureRenderPart} from '../client/modeller/renderer.ts'
|
|
6
|
-
|
|
6
|
+
import {boxShape} from '../client/modeller/drawn-shapes.ts'
|
|
7
|
+
const box=(id:string):FigureRenderPart=>({id,shape:boxShape(100,200,300),pose:{r:[[1,0,0],[0,1,0],[0,0,1]],t:[0,100,0]},material:{token:'primary'}})
|
|
7
8
|
test('renderer replaces rather than accumulates; empty scene disposes old resources',()=>{
|
|
8
9
|
const group=new THREE.Group();replaceFigureMeshes(group,[box('a'),box('b')],{primary:'#123456'})
|
|
9
10
|
assert.equal(group.children.length,2);let disposed=0
|