@hatiolab/figure-model 0.1.82 → 0.1.84
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 +21 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/v3-authoring-actions.d.ts +2 -0
- package/dist/v3-authoring-actions.d.ts.map +1 -1
- package/dist/v3-authoring-actions.js +27 -6
- package/dist/v3-authoring-actions.js.map +1 -1
- package/dist/v3-create.d.ts +14 -0
- package/dist/v3-create.d.ts.map +1 -1
- package/dist/v3-create.js +2 -1
- package/dist/v3-create.js.map +1 -1
- package/dist/v3-follow.d.ts +28 -0
- package/dist/v3-follow.d.ts.map +1 -0
- package/dist/v3-follow.js +68 -0
- package/dist/v3-follow.js.map +1 -0
- package/dist/v3-graph.d.ts.map +1 -1
- package/dist/v3-graph.js +12 -1
- package/dist/v3-graph.js.map +1 -1
- package/dist/v3-kernel-version.d.ts +1 -1
- package/dist/v3-kernel-version.js +1 -1
- package/dist/v3-proposal.js +2 -2
- package/dist/v3-proposal.js.map +1 -1
- package/dist/v3-recipe-build.d.ts +27 -0
- package/dist/v3-recipe-build.d.ts.map +1 -0
- package/dist/v3-recipe-build.js +125 -0
- package/dist/v3-recipe-build.js.map +1 -0
- package/dist/v3-recipe-from-parts.d.ts +8 -0
- package/dist/v3-recipe-from-parts.d.ts.map +1 -0
- package/dist/v3-recipe-from-parts.js +183 -0
- package/dist/v3-recipe-from-parts.js.map +1 -0
- package/dist/v3-recipe.d.ts +25 -0
- package/dist/v3-recipe.d.ts.map +1 -1
- package/dist/v3-recipe.js +53 -5
- package/dist/v3-recipe.js.map +1 -1
- package/package.json +2 -4
- package/recipes/hinged-door.json +0 -46
- package/recipes/roller-row.json +0 -19
- package/recipes/sliding-door.json +0 -69
package/recipes/hinged-door.json
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hinged-door",
|
|
3
|
-
"title": { "ko": "여닫이 문", "en": "hinged door" },
|
|
4
|
-
"description": {
|
|
5
|
-
"ko": "고른 부품의 앞면에 문틀과 여닫이 문짝을 넣습니다. 문틀은 그 부품의 폭과 높이를 따르고, 문짝은 경첩 쪽을 축으로 90° 열립니다.",
|
|
6
|
-
"en": "A frame and a hinged leaf on the chosen part's front. The frame follows the part's width and height; the leaf swings 90° about its hinge."
|
|
7
|
-
},
|
|
8
|
-
"target": "part",
|
|
9
|
-
"params": [
|
|
10
|
-
{ "name": "share", "kind": "ratio", "default": 0.25, "min": 0.05, "max": 0.95, "label": { "ko": "문틀 폭 (부품 폭에 대해)", "en": "frame width (of the part's)" } },
|
|
11
|
-
{ "name": "height", "kind": "ratio", "default": 0.8, "min": 0.3, "max": 1, "label": { "ko": "문틀 높이 (부품 높이에 대해)", "en": "frame height (of the part's)" } },
|
|
12
|
-
{ "name": "hinge", "kind": "choice", "default": "left", "options": ["left", "right"], "label": { "ko": "경첩 쪽", "en": "hinge side" } }
|
|
13
|
-
],
|
|
14
|
-
"steps": [
|
|
15
|
-
{ "kind": "add-part", "part": { "id": "{id}-frame", "kind": "portal", "dimensions": { "width": 1000, "height": 2200, "depth": 150, "jamb": 100, "head": 100 } } },
|
|
16
|
-
{ "kind": "attach", "part": "{id}-frame", "face": "back", "to": { "part": "{target}", "face": "front" }, "align": { "y": "min" } },
|
|
17
|
-
{ "kind": "link-dimension", "part": "{id}-frame", "axis": "x", "source": { "of": "part", "part": "{target}", "axis": "x" }, "times": { "param": "share" }, "narrowRange": true },
|
|
18
|
-
{ "kind": "link-dimension", "part": "{id}-frame", "axis": "y", "source": { "of": "part", "part": "{target}", "axis": "y" }, "times": { "param": "height" }, "narrowRange": true },
|
|
19
|
-
|
|
20
|
-
{ "kind": "add-part", "part": { "id": "{id}-leaf", "kind": "box", "dimensions": { "width": 790, "height": 2090, "depth": 40 } } },
|
|
21
|
-
{ "kind": "link-dimension", "part": "{id}-leaf", "axis": "x", "source": { "of": "part", "part": "{id}-frame", "axis": "x" }, "plus": -210, "narrowRange": true },
|
|
22
|
-
{ "kind": "link-dimension", "part": "{id}-leaf", "axis": "y", "source": { "of": "part", "part": "{id}-frame", "axis": "y" }, "plus": -110, "narrowRange": true },
|
|
23
|
-
{
|
|
24
|
-
"when": { "param": "hinge", "is": "left" },
|
|
25
|
-
"kind": "set-joint",
|
|
26
|
-
"joint": {
|
|
27
|
-
"id": "{id}-leaf", "type": "revolute",
|
|
28
|
-
"body0": { "part": "{id}-frame", "face": "opening-left" }, "body1": { "part": "{id}-leaf", "face": "left" },
|
|
29
|
-
"origin": { "facing": "meet", "gap": 5, "align": { "y": "min", "z": "max" } },
|
|
30
|
-
"axis": "Y", "lowerLimit": -90, "upperLimit": 0,
|
|
31
|
-
"state": { "id": "{id}-open" }
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"when": { "param": "hinge", "is": "right" },
|
|
36
|
-
"kind": "set-joint",
|
|
37
|
-
"joint": {
|
|
38
|
-
"id": "{id}-leaf", "type": "revolute",
|
|
39
|
-
"body0": { "part": "{id}-frame", "face": "opening-right" }, "body1": { "part": "{id}-leaf", "face": "right" },
|
|
40
|
-
"origin": { "facing": "meet", "gap": 5, "align": { "y": "min", "z": "max" } },
|
|
41
|
-
"axis": "Y", "lowerLimit": 0, "upperLimit": 90,
|
|
42
|
-
"state": { "id": "{id}-open" }
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
package/recipes/roller-row.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "roller-row",
|
|
3
|
-
"title": { "ko": "롤러 줄", "en": "roller row" },
|
|
4
|
-
"description": {
|
|
5
|
-
"ko": "고른 부품의 윗면에 롤러를 한 줄로 깝니다. 롤러는 그 부품의 폭을 가로지르고, 길이를 따라 간격마다 들어갑니다.",
|
|
6
|
-
"en": "A row of rollers on the chosen part's top, across its depth, as many as fit along its length at the pitch."
|
|
7
|
-
},
|
|
8
|
-
"target": "part",
|
|
9
|
-
"params": [
|
|
10
|
-
{ "name": "pitch", "kind": "mm", "default": 200, "min": 20, "max": 2000, "label": { "ko": "롤러 간격 (mm)", "en": "pitch (mm)" } },
|
|
11
|
-
{ "name": "radius", "kind": "mm", "default": 30, "min": 5, "max": 500, "label": { "ko": "롤러 반지름 (mm)", "en": "roller radius (mm)" } }
|
|
12
|
-
],
|
|
13
|
-
"steps": [
|
|
14
|
-
{ "kind": "add-part", "part": { "id": "{id}-roller", "kind": "cylinder", "dimensions": { "radius": "{radius}", "length": 500 }, "rotation": { "x": 90, "y": 0, "z": 0 } } },
|
|
15
|
-
{ "kind": "link-dimension", "part": "{id}-roller", "axis": "y", "source": { "of": "part", "part": "{target}", "axis": "z" }, "times": 0.9, "narrowRange": true },
|
|
16
|
-
{ "kind": "attach", "part": "{id}-roller", "face": "bottom", "to": { "part": "{target}", "face": "top" } },
|
|
17
|
-
{ "kind": "make-repeat", "part": "{id}-roller", "axis": "x", "pitch": "{pitch}", "narrowRange": true }
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sliding-door",
|
|
3
|
-
"title": { "ko": "미닫이 문", "en": "sliding door" },
|
|
4
|
-
"description": {
|
|
5
|
-
"ko": "고른 부품의 앞면에 문틀과 미닫이 문짝을 넣습니다. 문틀은 그 부품의 폭과 높이를 따르고, 문짝은 열림 조작값 하나로 열립니다.",
|
|
6
|
-
"en": "A frame and sliding leaves on the chosen part's front. The frame follows the part's width and height; one control opens the leaves."
|
|
7
|
-
},
|
|
8
|
-
"target": "part",
|
|
9
|
-
"params": [
|
|
10
|
-
{ "name": "share", "kind": "ratio", "default": 0.35, "min": 0.05, "max": 0.95, "label": { "ko": "문틀 폭 (부품 폭에 대해)", "en": "frame width (of the part's)" } },
|
|
11
|
-
{ "name": "height", "kind": "ratio", "default": 0.95, "min": 0.3, "max": 1, "label": { "ko": "문틀 높이 (부품 높이에 대해)", "en": "frame height (of the part's)" } },
|
|
12
|
-
{ "name": "leaves", "kind": "choice", "default": 2, "options": [1, 2], "label": { "ko": "문짝 수", "en": "leaves" } },
|
|
13
|
-
{ "name": "lamp", "kind": "flag", "default": true, "label": { "ko": "열리면 켜지는 램프", "en": "a lamp lit while open" } }
|
|
14
|
-
],
|
|
15
|
-
"steps": [
|
|
16
|
-
{ "kind": "add-part", "part": { "id": "{id}-frame", "kind": "portal", "dimensions": { "width": 1400, "height": 2900, "depth": 300, "jamb": 300, "head": 700 } } },
|
|
17
|
-
{ "kind": "attach", "part": "{id}-frame", "face": "back", "to": { "part": "{target}", "face": "front" }, "align": { "y": "min" } },
|
|
18
|
-
{ "kind": "link-dimension", "part": "{id}-frame", "axis": "x", "source": { "of": "part", "part": "{target}", "axis": "x" }, "times": { "param": "share" }, "narrowRange": true },
|
|
19
|
-
{ "kind": "link-dimension", "part": "{id}-frame", "axis": "y", "source": { "of": "part", "part": "{target}", "axis": "y" }, "times": { "param": "height" }, "narrowRange": true },
|
|
20
|
-
|
|
21
|
-
{ "kind": "add-part", "part": { "id": "{id}-left", "kind": "box", "dimensions": { "width": 400, "height": 2200, "depth": 40 } } },
|
|
22
|
-
{ "when": { "param": "leaves", "is": 1 }, "kind": "link-dimension", "part": "{id}-left", "axis": "x", "source": { "of": "part", "part": "{id}-frame", "axis": "x" }, "plus": -600, "narrowRange": true },
|
|
23
|
-
{ "when": { "param": "leaves", "is": 2 }, "kind": "link-dimension", "part": "{id}-left", "axis": "x", "source": { "of": "part", "part": "{id}-frame", "axis": "x" }, "times": 0.5, "plus": -300, "narrowRange": true },
|
|
24
|
-
{ "kind": "link-dimension", "part": "{id}-left", "axis": "y", "source": { "of": "part", "part": "{id}-frame", "axis": "y" }, "plus": -700, "narrowRange": true },
|
|
25
|
-
{
|
|
26
|
-
"when": { "param": "leaves", "is": 1 },
|
|
27
|
-
"kind": "set-joint",
|
|
28
|
-
"joint": {
|
|
29
|
-
"id": "{id}-left", "type": "prismatic",
|
|
30
|
-
"body0": { "part": "{id}-frame", "face": "front" }, "body1": { "part": "{id}-left", "face": "back" },
|
|
31
|
-
"origin": { "facing": "meet", "align": { "y": "min" } },
|
|
32
|
-
"axis": "X", "lowerLimit": 0, "upperLimit": 1,
|
|
33
|
-
"travel": { "source": { "of": "part", "part": "{id}-left", "axis": "x" }, "times": -1 },
|
|
34
|
-
"state": { "id": "{id}-open" }
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"when": { "param": "leaves", "is": 2 },
|
|
39
|
-
"kind": "set-joint",
|
|
40
|
-
"joint": {
|
|
41
|
-
"id": "{id}-left", "type": "prismatic",
|
|
42
|
-
"body0": { "part": "{id}-frame", "face": "front" }, "body1": { "part": "{id}-left", "face": "back" },
|
|
43
|
-
"origin": { "facing": "meet", "align": { "y": "min", "x": { "mm": { "from": { "of": "part", "part": "{id}-frame", "axis": "x" }, "times": -0.25, "plus": 150 } } } },
|
|
44
|
-
"axis": "X", "lowerLimit": 0, "upperLimit": 1,
|
|
45
|
-
"travel": { "source": { "of": "part", "part": "{id}-left", "axis": "x" }, "times": -1 },
|
|
46
|
-
"state": { "id": "{id}-open" }
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
{ "when": { "param": "leaves", "is": 2 }, "kind": "add-part", "part": { "id": "{id}-right", "kind": "box", "dimensions": { "width": 400, "height": 2200, "depth": 40 } } },
|
|
51
|
-
{ "when": { "param": "leaves", "is": 2 }, "kind": "link-dimension", "part": "{id}-right", "axis": "x", "source": { "of": "part", "part": "{id}-left", "axis": "x" }, "narrowRange": true },
|
|
52
|
-
{ "when": { "param": "leaves", "is": 2 }, "kind": "link-dimension", "part": "{id}-right", "axis": "y", "source": { "of": "part", "part": "{id}-left", "axis": "y" }, "narrowRange": true },
|
|
53
|
-
{
|
|
54
|
-
"when": { "param": "leaves", "is": 2 },
|
|
55
|
-
"kind": "set-joint",
|
|
56
|
-
"joint": {
|
|
57
|
-
"id": "{id}-right", "type": "prismatic",
|
|
58
|
-
"body0": { "part": "{id}-frame", "face": "front" }, "body1": { "part": "{id}-right", "face": "back" },
|
|
59
|
-
"origin": { "facing": "meet", "align": { "y": "min", "x": { "mm": { "from": { "of": "part", "part": "{id}-frame", "axis": "x" }, "times": 0.25, "plus": -150 } } } },
|
|
60
|
-
"axis": "X",
|
|
61
|
-
"mimic": { "joint": "{id}-left", "multiplier": -1 }
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
{ "when": { "param": "lamp", "is": true }, "kind": "add-part", "part": { "id": "{id}-lamp", "kind": "cylinder", "dimensions": { "radius": 80, "length": 80 } } },
|
|
66
|
-
{ "when": { "param": "lamp", "is": true }, "kind": "attach", "part": "{id}-lamp", "face": "bottom", "to": { "part": "{id}-frame", "face": "top" } },
|
|
67
|
-
{ "when": { "param": "lamp", "is": true }, "kind": "set-visibility", "target": "{id}-lamp", "shownWhen": { "input": "{id}-open", "atLeast": 0.01 } }
|
|
68
|
-
]
|
|
69
|
-
}
|