@things-factory/figure-service 10.1.36 → 10.1.38

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.
@@ -51,13 +51,17 @@ function getDeps(): any {
51
51
  // eslint-disable-next-line @typescript-eslint/no-var-requires
52
52
  const entity = require('./figure.js')
53
53
  // eslint-disable-next-line @typescript-eslint/no-var-requires
54
- const gate = require('./figure-gate.js')
54
+ const format = require('./figure-format.js')
55
55
  // eslint-disable-next-line @typescript-eslint/no-var-requires
56
56
  const propose = require('./figure-propose.js')
57
57
  _deps = {
58
58
  getRepository: shell.getRepository,
59
59
  Figure: entity.Figure,
60
- inspectSource: gate.inspectSource,
60
+ /*
61
+ The format-aware door, so an AI asked about a V3 model gets the V3 judgement rather than a V2 parser's
62
+ complaint. The tool's own contract is unchanged: it reads, it never saves (ADR-0087).
63
+ */
64
+ inspectSource: format.inspectAnySource,
61
65
  proposeFigure: propose.proposeFigure,
62
66
  compile: model.compile,
63
67
  costOf: model.costOf,
@@ -1,4 +1,4 @@
1
- import { parseV3Asset, serializeV3Asset, compileV3Asset } from '@hatiolab/figure-model'
1
+ import { parseV3Asset, serializeV3Asset, compileV3Asset, v3CostOf } from '@hatiolab/figure-model'
2
2
 
3
3
  export interface V3WriteCriteria {
4
4
  id: string
@@ -22,14 +22,30 @@ export function prepareV3Write(source: string, existing?: { source?: string }, e
22
22
  throw Error('다른 편집에서 모델이 변경되었습니다. 최신 모델을 다시 연 뒤 적용해 주세요.')
23
23
  }
24
24
  const asset = parseV3Asset(source)
25
- const evaluated = compileV3Asset(asset).evaluate()
25
+ compileV3Asset(asset)
26
+ /*
27
+ The same measure `parseAnySource` uses, so the catalogue's budget columns do not depend on which mutation
28
+ wrote the row. `score` stays null: it measures V2 reuse and nothing has measured V3 (ADR-0087).
29
+ */
30
+ const cost = v3CostOf(asset)
26
31
  return {
27
32
  source: serializeV3Asset(asset),
28
33
  name: asset.name,
29
- // V2 scores are not V3 evidence. Clear them instead of carrying a previous model's score.
30
34
  score: null,
31
- triangles: null,
32
- groups: evaluated.geometry.length,
35
+ triangles: cost.triangles,
36
+ groups: cost.groups,
33
37
  state: 'draft' as const
34
38
  }
35
39
  }
40
+
41
+ /**
42
+ * The picture a card shows, when the modeller sent one.
43
+ *
44
+ * Absent means the author saved without one — a tab in the background cannot draw, and the source matters more
45
+ * than the picture, so the save goes on and the modeller fills it in next time. The timestamp moves only when
46
+ * the picture itself is new, so renaming a figure does not make every card look freshly drawn.
47
+ */
48
+ export function pictureOf(thumbnail?: string, existing?: { thumbnail?: string }) {
49
+ if (thumbnail === undefined || thumbnail === existing?.thumbnail) return {}
50
+ return { thumbnail, thumbnailUpdatedAt: new Date() }
51
+ }
@@ -1,3 +1,21 @@
1
1
  {
2
- "error.figure-release-does-not-compile": "the released source of {type} (version {version}) does not compile. open it in the modeller, fix it and release it again before it draws on a board."
2
+ "error.figure-release-does-not-compile": "the released source of {type} (version {version}) does not compile. open it in the modeller, fix it and release it again before it draws on a board.",
3
+ "figure.gate.occupancy-empty-axis.message": "The declared space is empty on {axis}.",
4
+ "figure.gate.occupancy-undeclared.how": "Use \"fit to parts\" to declare the space from the parts as they are now.",
5
+ "figure.gate.occupancy-undeclared.message": "This figure has not declared the space it takes up.",
6
+ "figure.gate.occupancy-undeclared.why": "Without a declared space the scale a figure is placed at cannot be set.",
7
+ "figure.gate.part-outside-occupancy.how": "Use \"fit to parts\" to declare the space from the parts again, or move '{part}' {mm} mm inward on {axis}.",
8
+ "figure.gate.part-outside-occupancy.message": "'{part}' goes {mm} mm past the declared space on {axis}.",
9
+ "figure.gate.part-outside-occupancy.why": "The declared space sets the scale a figure is placed at. What lies past it is left out of that scale, so on a board this part lands outside the place given to the figure.",
10
+ "figure.gate.parts-off-placement-face.how": "Move '{part}' {mm} mm on Y so the face meets the plane, or choose a different mounting face.",
11
+ "figure.gate.parts-off-placement-face.message": "The mounting face of '{part}' is {mm} mm off the plane the figure stands on.",
12
+ "figure.gate.parts-off-placement-face.why": "The figure is declared to stand on that face. If the face does not reach the plane, the figure floats on the board by that much, and whatever is placed on it floats too.",
13
+ "figure.gate.placement-face-tilted.how": "Choose a mounting face parallel to the plane, or turn '{part}' upright.",
14
+ "figure.gate.placement-face-tilted.message": "The mounting face of '{part}' is tilted {degrees}° from the plane the figure stands on.",
15
+ "figure.gate.placement-face-tilted.why": "A tilted face cannot lie on the plane, so how the figure stands is not settled.",
16
+ "figure.gate.state-range-sampled.how": "Re-author the motion that could not be proven, and the whole range can be proven.",
17
+ "figure.gate.state-range-sampled.message": "The whole range of motion could not be proven, so {states} poses were checked.",
18
+ "figure.gate.state-range-sampled.why": "Between the poses that were checked, a part may still go past the declared space.",
19
+ "figure.gate.v3-released-not-compared.message": "Not compared with the last release. V3 figures have no comparison between releases yet.",
20
+ "figure.gate.v3-released-not-compared.why": "Whether this release breaks the instances already placed has not been checked."
3
21
  }
@@ -1,3 +1,21 @@
1
1
  {
2
- "error.figure-release-does-not-compile": "{type} 의 발행판({version})이 지금 컴파일되지 않습니다. 저작 화면에서 열어 고친 뒤 다시 발행해야 보드에 나옵니다."
2
+ "error.figure-release-does-not-compile": "{type} 의 발행판({version})이 지금 컴파일되지 않습니다. 저작 화면에서 열어 고친 뒤 다시 발행해야 보드에 나옵니다.",
3
+ "figure.gate.occupancy-empty-axis.message": "공간 선언의 {axis} 가 비어 있습니다.",
4
+ "figure.gate.occupancy-undeclared.how": "「부품에 맞추기」를 누르면 지금 부품으로 공간을 선언합니다.",
5
+ "figure.gate.occupancy-undeclared.message": "이 도형은 차지하는 공간을 아직 선언하지 않았습니다.",
6
+ "figure.gate.occupancy-undeclared.why": "공간 선언이 없으면 도면에 놓일 때의 배율을 정할 수 없습니다.",
7
+ "figure.gate.part-outside-occupancy.how": "「부품에 맞추기」로 공간을 부품에서 다시 선언하거나, '{part}' 을 {axis} 로 {mm}mm 안으로 옮기세요.",
8
+ "figure.gate.part-outside-occupancy.message": "'{part}' 부품이 공간 선언을 {axis} 로 {mm}mm 넘습니다.",
9
+ "figure.gate.part-outside-occupancy.why": "공간 선언이 도면에 놓일 때의 배율을 정합니다. 넘은 만큼은 그 배율에 들어가지 않아서, 도면에서 이 부품이 도형에 주어진 자리 밖으로 나갑니다.",
10
+ "figure.gate.parts-off-placement-face.how": "'{part}' 을 Y 로 {mm}mm 옮겨 그 면을 평면에 맞추거나, 장착면을 다른 면으로 다시 정하세요.",
11
+ "figure.gate.parts-off-placement-face.message": "장착면으로 정한 '{part}' 부품의 면이 놓이는 평면에서 {mm}mm 떨어져 있습니다.",
12
+ "figure.gate.parts-off-placement-face.why": "도형은 그 면으로 놓인다고 선언돼 있습니다. 닿지 않으면 도면에서 그만큼 떠 보이고, 자리에 놓인 물건도 함께 뜹니다.",
13
+ "figure.gate.placement-face-tilted.how": "평면과 나란한 면을 장착면으로 다시 정하거나, '{part}' 을 바로 세우세요.",
14
+ "figure.gate.placement-face-tilted.message": "장착면으로 정한 '{part}' 부품의 면이 놓이는 평면에서 {degrees}° 기울어 있습니다.",
15
+ "figure.gate.placement-face-tilted.why": "기운 면은 평면에 닿을 수 없어서, 도형이 어떤 자세로 놓이는지 정해지지 않습니다.",
16
+ "figure.gate.state-range-sampled.how": "증명하지 못한 움직임을 다시 저작하면 범위 전체를 증명할 수 있습니다.",
17
+ "figure.gate.state-range-sampled.message": "움직이는 범위 전체를 증명하지 못해 자세 {states}개만 검사했습니다.",
18
+ "figure.gate.state-range-sampled.why": "검사한 자세 사이에서 부품이 공간 선언을 넘을 수 있습니다.",
19
+ "figure.gate.v3-released-not-compared.message": "직전 발행판과 견주지 못했습니다. V3 도형은 발행 사이의 비교가 아직 없습니다.",
20
+ "figure.gate.v3-released-not-compared.why": "이 발행이 이미 놓인 인스턴스를 깨는지는 확인되지 않았습니다."
3
21
  }