@things-factory/figure-ui 10.1.245 → 10.1.247

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.
Files changed (127) hide show
  1. package/client/modeller/align.ts +51 -13
  2. package/client/modeller/clips.ts +51 -1
  3. package/client/modeller/data-interface.ts +16 -0
  4. package/client/modeller/editor-styles.ts +6 -0
  5. package/client/modeller/editor.ts +112 -25
  6. package/client/modeller/fasten-form.ts +8 -1
  7. package/client/modeller/fasten-geometry.ts +24 -2
  8. package/client/modeller/figure-clips.ts +137 -4
  9. package/client/modeller/figure-fasten-dialog.ts +1 -0
  10. package/client/modeller/figure-fasten-drawing.ts +11 -5
  11. package/client/modeller/figure-links.ts +25 -0
  12. package/client/modeller/figure-material-panel.ts +54 -4
  13. package/client/modeller/figure-parts.ts +7 -2
  14. package/client/modeller/figure-pipe-panel.ts +215 -0
  15. package/client/modeller/figure-preview.ts +125 -4
  16. package/client/modeller/figure-section-editor.ts +36 -3
  17. package/client/modeller/links.ts +24 -2
  18. package/client/modeller/material-edit.ts +9 -0
  19. package/client/modeller/maturity.ts +15 -4
  20. package/client/modeller/palette.ts +9 -0
  21. package/client/modeller/pipe-path.ts +21 -0
  22. package/client/modeller/refusals.ts +66 -1
  23. package/client/modeller/section-controls.ts +2 -1
  24. package/client/modeller/section-drawing.ts +20 -1
  25. package/client/modeller/starting-shape.ts +8 -5
  26. package/dist-client/modeller/align.d.ts +28 -7
  27. package/dist-client/modeller/align.js +37 -12
  28. package/dist-client/modeller/align.js.map +1 -1
  29. package/dist-client/modeller/clips.d.ts +24 -0
  30. package/dist-client/modeller/clips.js +53 -1
  31. package/dist-client/modeller/clips.js.map +1 -1
  32. package/dist-client/modeller/data-interface.d.ts +6 -0
  33. package/dist-client/modeller/data-interface.js +17 -0
  34. package/dist-client/modeller/data-interface.js.map +1 -1
  35. package/dist-client/modeller/editor-styles.js +6 -0
  36. package/dist-client/modeller/editor-styles.js.map +1 -1
  37. package/dist-client/modeller/editor.d.ts +10 -1
  38. package/dist-client/modeller/editor.js +117 -26
  39. package/dist-client/modeller/editor.js.map +1 -1
  40. package/dist-client/modeller/fasten-form.d.ts +2 -0
  41. package/dist-client/modeller/fasten-form.js +5 -1
  42. package/dist-client/modeller/fasten-form.js.map +1 -1
  43. package/dist-client/modeller/fasten-geometry.d.ts +8 -1
  44. package/dist-client/modeller/fasten-geometry.js +22 -1
  45. package/dist-client/modeller/fasten-geometry.js.map +1 -1
  46. package/dist-client/modeller/figure-clips.d.ts +9 -0
  47. package/dist-client/modeller/figure-clips.js +137 -4
  48. package/dist-client/modeller/figure-clips.js.map +1 -1
  49. package/dist-client/modeller/figure-fasten-dialog.js +1 -0
  50. package/dist-client/modeller/figure-fasten-dialog.js.map +1 -1
  51. package/dist-client/modeller/figure-fasten-drawing.d.ts +3 -1
  52. package/dist-client/modeller/figure-fasten-drawing.js +13 -5
  53. package/dist-client/modeller/figure-fasten-drawing.js.map +1 -1
  54. package/dist-client/modeller/figure-links.d.ts +5 -0
  55. package/dist-client/modeller/figure-links.js +22 -0
  56. package/dist-client/modeller/figure-links.js.map +1 -1
  57. package/dist-client/modeller/figure-material-panel.d.ts +2 -0
  58. package/dist-client/modeller/figure-material-panel.js +53 -4
  59. package/dist-client/modeller/figure-material-panel.js.map +1 -1
  60. package/dist-client/modeller/figure-parts.d.ts +1 -1
  61. package/dist-client/modeller/figure-parts.js +5 -1
  62. package/dist-client/modeller/figure-parts.js.map +1 -1
  63. package/dist-client/modeller/figure-pipe-panel.d.ts +29 -0
  64. package/dist-client/modeller/figure-pipe-panel.js +221 -0
  65. package/dist-client/modeller/figure-pipe-panel.js.map +1 -0
  66. package/dist-client/modeller/figure-preview.d.ts +8 -0
  67. package/dist-client/modeller/figure-preview.js +128 -4
  68. package/dist-client/modeller/figure-preview.js.map +1 -1
  69. package/dist-client/modeller/figure-section-editor.d.ts +5 -0
  70. package/dist-client/modeller/figure-section-editor.js +33 -3
  71. package/dist-client/modeller/figure-section-editor.js.map +1 -1
  72. package/dist-client/modeller/links.d.ts +6 -0
  73. package/dist-client/modeller/links.js +17 -2
  74. package/dist-client/modeller/links.js.map +1 -1
  75. package/dist-client/modeller/material-edit.d.ts +8 -0
  76. package/dist-client/modeller/material-edit.js +8 -0
  77. package/dist-client/modeller/material-edit.js.map +1 -1
  78. package/dist-client/modeller/maturity.js +16 -5
  79. package/dist-client/modeller/maturity.js.map +1 -1
  80. package/dist-client/modeller/palette.js +9 -0
  81. package/dist-client/modeller/palette.js.map +1 -1
  82. package/dist-client/modeller/pipe-path.d.ts +19 -0
  83. package/dist-client/modeller/pipe-path.js +14 -0
  84. package/dist-client/modeller/pipe-path.js.map +1 -0
  85. package/dist-client/modeller/refusals.d.ts +12 -1
  86. package/dist-client/modeller/refusals.js +67 -0
  87. package/dist-client/modeller/refusals.js.map +1 -1
  88. package/dist-client/modeller/section-controls.js +2 -1
  89. package/dist-client/modeller/section-controls.js.map +1 -1
  90. package/dist-client/modeller/section-drawing.d.ts +5 -0
  91. package/dist-client/modeller/section-drawing.js +19 -1
  92. package/dist-client/modeller/section-drawing.js.map +1 -1
  93. package/dist-client/modeller/starting-shape.d.ts +9 -2
  94. package/dist-client/modeller/starting-shape.js +8 -3
  95. package/dist-client/modeller/starting-shape.js.map +1 -1
  96. package/dist-client/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +8 -8
  98. package/test/align.test.ts +28 -6
  99. package/test/browser/editing-page.js +21 -1
  100. package/test/browser/editing.check.mjs +124 -0
  101. package/test/browser/links.check.mjs +49 -8
  102. package/test/browser/modeller.check.mjs +27 -1
  103. package/test/browser/part-ids.check.mjs +60 -3
  104. package/test/browser/parts.check.mjs +2 -2
  105. package/test/browser/places-mesh.check.mjs +14 -8
  106. package/test/browser/screen.check.mjs +54 -1
  107. package/test/browser/section-page.js +7 -1
  108. package/test/browser/section.check.mjs +81 -0
  109. package/test/browser/side-panel-sweep.check.mjs +13 -0
  110. package/test/clips.test.ts +30 -1
  111. package/test/data-motion.test.ts +14 -1
  112. package/test/fasten-geometry.test.ts +13 -2
  113. package/test/joint-frames.test.ts +12 -2
  114. package/test/links.test.ts +24 -0
  115. package/test/material.test.ts +15 -1
  116. package/test/maturity.test.ts +19 -1
  117. package/test/palette-icons.test.ts +2 -1
  118. package/test/pipe-panel.test.ts +33 -0
  119. package/test/refusals.test.ts +29 -0
  120. package/test/revision.test.ts +1 -1
  121. package/test/section-editor.test.ts +17 -1
  122. package/translations/en.json +86 -3
  123. package/translations/es.json +86 -3
  124. package/translations/ja.json +86 -3
  125. package/translations/ko.json +86 -3
  126. package/translations/ms.json +86 -3
  127. package/translations/zh.json +86 -3
@@ -35,7 +35,8 @@ export function cavityRequestOf(shape, patch = {}) {
35
35
  }
36
36
  /** The most a rectangle's corners can reach: half its narrower side (the kernel's CORNER_TOO_LARGE says where). */
37
37
  export function cornerLimitOf(shape) {
38
- const e = shape.extrusion;
38
+ /* A tapered box's bottom: its corners are its first section's (ADR-0100 §16.1). */
39
+ const e = shape.extrusion ?? (shape.loft?.to ? shape.loft : undefined);
39
40
  if (e?.section.kind !== 'rectangle')
40
41
  return undefined;
41
42
  const [u, v] = FIGURE_SECTION_PLANE[e.axis];
@@ -1 +1 @@
1
- {"version":3,"file":"section-controls.js","sourceRoot":"","sources":["../../client/modeller/section-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAa5G,kGAAkG;AAClG,MAAM,CAAC,MAAM,SAAS,GAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1I,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG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AE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAClG,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,KAA2B,EAAE,GAAiC;IACvF,OAAO,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AACnE,CAAC","sourcesContent":["import { FIGURE_SECTION_PLANE, checkFigureSection, figureExtrusionFeaturesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape } from '@hatiolab/figure-model'\n\n/*\n * What the 단면 section of the properties tab reads and asks (ADR-0100 §3.3): a pushed part's corners and its inside.\n * Whether a value can be taken is asked of the kernel's own section checks -- the screen keeps no rule of its own -- and\n * the most it can take is said beside the field, so a refusal names the value to type rather than only that it failed.\n */\n\ntype Axis = 'x' | 'y' | 'z'\ntype End = 'start' | 'end'\ntype Extrusion = NonNullable<FigureEvaluatedShape['extrusion']>\n\n/** The face each side of a section is, and each end of a push: a push's start is its low side. */\nexport const SIDE_FACE: Record<string, string> = { 'x-': 'left', 'x+': 'right', 'y-': 'bottom', 'y+': 'top', 'z-': 'back', 'z+': 'front' }\nexport const END_FACE = (axis: Axis, end: End) => SIDE_FACE[`${axis}${end === 'start' ? '-' : '+'}`]!\n\n/** The one value every entry holds, or undefined when they differ (or there are none). */\nexport const sameOf = (values: readonly (number | undefined)[]) =>\n values.length && values.every(v => v !== undefined && Math.abs(v - values[0]!) < 1e-6) ? values[0] : undefined\n\nexport const mm = (value: number) => Math.round(value * 1000) / 1000\n\n/** The four sides of a push's section, in the kernel's order: the first plane axis low and high, then the second. */\nexport const sidesOf = (axis: Axis) => FIGURE_SECTION_PLANE[axis].flatMap(a => [`${a}-`, `${a}+`])\n\n/** The section's widths across, one per plane axis: a rectangle's sides, an ellipse's diameters. */\nfunction acrossOf(e: Extrusion): number[] {\n const s = e.section\n if (s.kind === 'rectangle') return FIGURE_SECTION_PLANE[e.axis].map(a => s.size[a]!)\n if (s.kind === 'ellipse') return FIGURE_SECTION_PLANE[e.axis].map(a => 2 * s.radius[a]!)\n return []\n}\n\n/** The wall a new inside starts with: a tenth of the section's narrower side, at least 1 mm. */\nexport function defaultWallOf(shape: FigureEvaluatedShape): number {\n return Math.max(1, Math.round(Math.min(...acrossOf(shape.extrusion!)) / 10))\n}\n\n/**\n * The inside as the panel asks for it: the part's own, with one thing changed. A part with none yet gets a default\n * wall all round, a closed start as thick as the wall and an open end -- a tray standing on its floor.\n */\nexport function cavityRequestOf(shape: FigureEvaluatedShape, patch: Partial<FigureCavityRequest> = {}): FigureCavityRequest {\n const cavity = shape.cavity\n return {\n wall: cavity ? (sameOf(Object.values(cavity.wall)) ?? { ...cavity.wall }) : defaultWallOf(shape),\n start: cavity?.start ?? { closed: defaultWallOf(shape) },\n end: cavity?.end ?? 'open',\n ...patch\n }\n}\n\n/** The most a rectangle's corners can reach: half its narrower side (the kernel's CORNER_TOO_LARGE says where). */\nexport function cornerLimitOf(shape: FigureEvaluatedShape): number | undefined {\n const e = shape.extrusion\n if (e?.section.kind !== 'rectangle') return undefined\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const far = 2 * Math.max(...acrossOf(e))\n const issues = checkFigureSection({ kind: 'rectangle', size: e.section.size, corner: { [u]: far, [v]: far } }, e.axis)\n const maxes = issues.flatMap(i => (i.code === 'CORNER_TOO_LARGE' ? [i.max] : []))\n return maxes.length ? Math.min(...maxes) : undefined\n}\n\n/** A corner radius as the one command: 0 takes the rounding away. */\nexport const cornerActionOf = (part: string, radius: number): FigureAuthoringAction => ({ kind: 'set-section-corner', part, corner: radius > 0 ? radius : null })\n\n/** Whether a corner radius can be taken; if not, the most it can be. */\nexport function cornerRefusalOf(shape: FigureEvaluatedShape, radius: number): { max: number } | null {\n const e = shape.extrusion\n if (e?.section.kind !== 'rectangle' || !(radius > 0)) return null\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const issues = checkFigureSection({ kind: 'rectangle', size: e.section.size, corner: { [u]: radius, [v]: radius } }, e.axis)\n return issues.some(i => i.code === 'CORNER_TOO_LARGE') ? { max: cornerLimitOf(shape)! } : null\n}\n\n/** One side's wall, the others kept: it must leave room inside, so under the width across it less the opposite wall. */\nexport function sideWallLimitOf(shape: FigureEvaluatedShape, wall: Record<string, number>, side: string): number {\n const e = shape.extrusion!\n const axis = side[0] as Axis\n const across = acrossOf(e)[FIGURE_SECTION_PLANE[e.axis].indexOf(axis)]!\n return across - (wall[`${axis}${side[1] === '-' ? '+' : '-'}`] ?? 0)\n}\n\n/** A wall must leave room inside: under half the narrower width the section has. */\nexport const wallLimitOf = (shape: FigureEvaluatedShape) => Math.min(...acrossOf(shape.extrusion!)) / 2\n\nexport type FigureCavityAsk =\n | { code: 'wall-too-thick'; max: number }\n | { code: 'ends-too-thick'; max: number }\n | { code: 'not-positive' }\n\n/** Whether an inside can be taken, asked of the kernel; if not, what to change and the most it can be. */\nexport function cavityRefusalOf(shape: FigureEvaluatedShape, request: FigureCavityRequest): FigureCavityAsk | null {\n const e = shape.extrusion!\n const sides = sidesOf(e.axis)\n const wall = typeof request.wall === 'number' ? Object.fromEntries(sides.map(s => [s, request.wall as number])) : request.wall\n const made = figureExtrusionFeaturesOf(e, [{ id: 'inside', wall: wall as Record<string, number>, start: request.start, end: request.end }])\n if (!('refused' in made)) return null\n const r = made.refused\n if (r.code === 'CAVITY' && r.refused === 'NO_ROOM_INSIDE') return { code: 'wall-too-thick', max: mm(wallLimitOf(shape)) }\n if (r.code === 'CAVITY_NO_LENGTH') return { code: 'ends-too-thick', max: mm(e.end - e.start) }\n return { code: 'not-positive' }\n}\n\n/**\n * What the kernel would refuse of an inside, as words: an i18n key and its values; null when it would take it. For one\n * side's wall with the walls one per side, the most is that side's with the opposite kept, not the kernel's all-round one.\n */\nexport function cavityRefusalWordsOf(\n shape: FigureEvaluatedShape,\n request: { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] },\n perSide: boolean,\n side?: string\n): { key: string; params: Record<string, string> } | null {\n const ask = cavityRefusalOf(shape, { wall: { ...request.wall }, start: request.start, end: request.end })\n if (!ask) return null\n if (ask.code === 'wall-too-thick')\n return { key: 'figure.text.section-wall-over', params: { max: String(perSide && side ? mm(sideWallLimitOf(shape, request.wall, side)) : ask.max) } }\n if (ask.code === 'ends-too-thick') return { key: 'figure.text.section-ends-over', params: { max: String(ask.max) } }\n return { key: 'figure.text.section-not-positive', params: {} }\n}\n\n/** Whether a part can have an inside: a pushed rectangle or ellipse (a drawn section's is a later stage). */\nexport const hollowableOf = (shape: FigureEvaluatedShape) => shape.extrusion?.section.kind === 'rectangle' || shape.extrusion?.section.kind === 'ellipse'\n\n/** What the inside makes of the part (§3.3): open at both ends a pipe, at one a container, at neither a closed space. */\nexport function cavityResultOf(cavity: NonNullable<FigureEvaluatedShape['cavity']>): 'pipe' | 'container' | 'sealed' {\n const open = [cavity.start, cavity.end].filter(e => e === 'open').length\n return open === 2 ? 'pipe' : open === 1 ? 'container' : 'sealed'\n}\n\n/** How deep the inside is along the push: the length less the closed ends. */\nexport function cavityDepthOf(shape: FigureEvaluatedShape): number {\n const e = shape.extrusion!,\n c = shape.cavity!\n const closed = (x: typeof c.start) => (x === 'open' ? 0 : x.closed)\n return mm(e.end - e.start - closed(c.start) - closed(c.end))\n}\n\n/** The inside as it stands, every side's wall written out. */\nexport function cavityWorkingOf(shape: FigureEvaluatedShape): { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] } | undefined {\n const c = shape.cavity\n const e = shape.extrusion\n if (!c || !e) return undefined\n return { wall: Object.fromEntries(sidesOf(e.axis).map(s => [s, c.wall[s]!])), start: c.start, end: c.end }\n}\n\n/** A wall dragged to `value`: that side alone, or every side when the walls are one. */\nexport function wallDragged(wall: Record<string, number>, side: string, value: number, perSide: boolean): Record<string, number> {\n const v = Math.max(1, Math.round(value))\n return perSide ? { ...wall, [side]: v } : Object.fromEntries(Object.keys(wall).map(s => [s, v]))\n}\n\n/** An end pressed: open becomes closed by the default wall, closed becomes open. */\nexport function endToggled(shape: FigureEvaluatedShape, now: FigureCavityRequest['start']): FigureCavityRequest['start'] {\n return now === 'open' ? { closed: defaultWallOf(shape) } : 'open'\n}\n"]}
1
+ {"version":3,"file":"section-controls.js","sourceRoot":"","sources":["../../client/modeller/section-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAa5G,kGAAkG;AAClG,MAAM,CAAC,MAAM,SAAS,GAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1I,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAE,CAAA;AAErG,0FAA0F;AAC1F,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAuC,EAAE,EAAE,CAChE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAEh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AAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AACnE,CAAC","sourcesContent":["import { FIGURE_SECTION_PLANE, checkFigureSection, figureExtrusionFeaturesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape } from '@hatiolab/figure-model'\n\n/*\n * What the 단면 section of the properties tab reads and asks (ADR-0100 §3.3): a pushed part's corners and its inside.\n * Whether a value can be taken is asked of the kernel's own section checks -- the screen keeps no rule of its own -- and\n * the most it can take is said beside the field, so a refusal names the value to type rather than only that it failed.\n */\n\ntype Axis = 'x' | 'y' | 'z'\ntype End = 'start' | 'end'\ntype Extrusion = NonNullable<FigureEvaluatedShape['extrusion']>\n\n/** The face each side of a section is, and each end of a push: a push's start is its low side. */\nexport const SIDE_FACE: Record<string, string> = { 'x-': 'left', 'x+': 'right', 'y-': 'bottom', 'y+': 'top', 'z-': 'back', 'z+': 'front' }\nexport const END_FACE = (axis: Axis, end: End) => SIDE_FACE[`${axis}${end === 'start' ? '-' : '+'}`]!\n\n/** The one value every entry holds, or undefined when they differ (or there are none). */\nexport const sameOf = (values: readonly (number | undefined)[]) =>\n values.length && values.every(v => v !== undefined && Math.abs(v - values[0]!) < 1e-6) ? values[0] : undefined\n\nexport const mm = (value: number) => Math.round(value * 1000) / 1000\n\n/** The four sides of a push's section, in the kernel's order: the first plane axis low and high, then the second. */\nexport const sidesOf = (axis: Axis) => FIGURE_SECTION_PLANE[axis].flatMap(a => [`${a}-`, `${a}+`])\n\n/** The section's widths across, one per plane axis: a rectangle's sides, an ellipse's diameters. */\nfunction acrossOf(e: Extrusion): number[] {\n const s = e.section\n if (s.kind === 'rectangle') return FIGURE_SECTION_PLANE[e.axis].map(a => s.size[a]!)\n if (s.kind === 'ellipse') return FIGURE_SECTION_PLANE[e.axis].map(a => 2 * s.radius[a]!)\n return []\n}\n\n/** The wall a new inside starts with: a tenth of the section's narrower side, at least 1 mm. */\nexport function defaultWallOf(shape: FigureEvaluatedShape): number {\n return Math.max(1, Math.round(Math.min(...acrossOf(shape.extrusion!)) / 10))\n}\n\n/**\n * The inside as the panel asks for it: the part's own, with one thing changed. A part with none yet gets a default\n * wall all round, a closed start as thick as the wall and an open end -- a tray standing on its floor.\n */\nexport function cavityRequestOf(shape: FigureEvaluatedShape, patch: Partial<FigureCavityRequest> = {}): FigureCavityRequest {\n const cavity = shape.cavity\n return {\n wall: cavity ? (sameOf(Object.values(cavity.wall)) ?? { ...cavity.wall }) : defaultWallOf(shape),\n start: cavity?.start ?? { closed: defaultWallOf(shape) },\n end: cavity?.end ?? 'open',\n ...patch\n }\n}\n\n/** The most a rectangle's corners can reach: half its narrower side (the kernel's CORNER_TOO_LARGE says where). */\nexport function cornerLimitOf(shape: FigureEvaluatedShape): number | undefined {\n /* A tapered box's bottom: its corners are its first section's (ADR-0100 §16.1). */\n const e = shape.extrusion ?? (shape.loft?.to ? shape.loft : undefined)\n if (e?.section.kind !== 'rectangle') return undefined\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const far = 2 * Math.max(...acrossOf(e))\n const issues = checkFigureSection({ kind: 'rectangle', size: e.section.size, corner: { [u]: far, [v]: far } }, e.axis)\n const maxes = issues.flatMap(i => (i.code === 'CORNER_TOO_LARGE' ? [i.max] : []))\n return maxes.length ? Math.min(...maxes) : undefined\n}\n\n/** A corner radius as the one command: 0 takes the rounding away. */\nexport const cornerActionOf = (part: string, radius: number): FigureAuthoringAction => ({ kind: 'set-section-corner', part, corner: radius > 0 ? radius : null })\n\n/** Whether a corner radius can be taken; if not, the most it can be. */\nexport function cornerRefusalOf(shape: FigureEvaluatedShape, radius: number): { max: number } | null {\n const e = shape.extrusion\n if (e?.section.kind !== 'rectangle' || !(radius > 0)) return null\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const issues = checkFigureSection({ kind: 'rectangle', size: e.section.size, corner: { [u]: radius, [v]: radius } }, e.axis)\n return issues.some(i => i.code === 'CORNER_TOO_LARGE') ? { max: cornerLimitOf(shape)! } : null\n}\n\n/** One side's wall, the others kept: it must leave room inside, so under the width across it less the opposite wall. */\nexport function sideWallLimitOf(shape: FigureEvaluatedShape, wall: Record<string, number>, side: string): number {\n const e = shape.extrusion!\n const axis = side[0] as Axis\n const across = acrossOf(e)[FIGURE_SECTION_PLANE[e.axis].indexOf(axis)]!\n return across - (wall[`${axis}${side[1] === '-' ? '+' : '-'}`] ?? 0)\n}\n\n/** A wall must leave room inside: under half the narrower width the section has. */\nexport const wallLimitOf = (shape: FigureEvaluatedShape) => Math.min(...acrossOf(shape.extrusion!)) / 2\n\nexport type FigureCavityAsk =\n | { code: 'wall-too-thick'; max: number }\n | { code: 'ends-too-thick'; max: number }\n | { code: 'not-positive' }\n\n/** Whether an inside can be taken, asked of the kernel; if not, what to change and the most it can be. */\nexport function cavityRefusalOf(shape: FigureEvaluatedShape, request: FigureCavityRequest): FigureCavityAsk | null {\n const e = shape.extrusion!\n const sides = sidesOf(e.axis)\n const wall = typeof request.wall === 'number' ? Object.fromEntries(sides.map(s => [s, request.wall as number])) : request.wall\n const made = figureExtrusionFeaturesOf(e, [{ id: 'inside', wall: wall as Record<string, number>, start: request.start, end: request.end }])\n if (!('refused' in made)) return null\n const r = made.refused\n if (r.code === 'CAVITY' && r.refused === 'NO_ROOM_INSIDE') return { code: 'wall-too-thick', max: mm(wallLimitOf(shape)) }\n if (r.code === 'CAVITY_NO_LENGTH') return { code: 'ends-too-thick', max: mm(e.end - e.start) }\n return { code: 'not-positive' }\n}\n\n/**\n * What the kernel would refuse of an inside, as words: an i18n key and its values; null when it would take it. For one\n * side's wall with the walls one per side, the most is that side's with the opposite kept, not the kernel's all-round one.\n */\nexport function cavityRefusalWordsOf(\n shape: FigureEvaluatedShape,\n request: { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] },\n perSide: boolean,\n side?: string\n): { key: string; params: Record<string, string> } | null {\n const ask = cavityRefusalOf(shape, { wall: { ...request.wall }, start: request.start, end: request.end })\n if (!ask) return null\n if (ask.code === 'wall-too-thick')\n return { key: 'figure.text.section-wall-over', params: { max: String(perSide && side ? mm(sideWallLimitOf(shape, request.wall, side)) : ask.max) } }\n if (ask.code === 'ends-too-thick') return { key: 'figure.text.section-ends-over', params: { max: String(ask.max) } }\n return { key: 'figure.text.section-not-positive', params: {} }\n}\n\n/** Whether a part can have an inside: a pushed rectangle or ellipse (a drawn section's is a later stage). */\nexport const hollowableOf = (shape: FigureEvaluatedShape) => shape.extrusion?.section.kind === 'rectangle' || shape.extrusion?.section.kind === 'ellipse'\n\n/** What the inside makes of the part (§3.3): open at both ends a pipe, at one a container, at neither a closed space. */\nexport function cavityResultOf(cavity: NonNullable<FigureEvaluatedShape['cavity']>): 'pipe' | 'container' | 'sealed' {\n const open = [cavity.start, cavity.end].filter(e => e === 'open').length\n return open === 2 ? 'pipe' : open === 1 ? 'container' : 'sealed'\n}\n\n/** How deep the inside is along the push: the length less the closed ends. */\nexport function cavityDepthOf(shape: FigureEvaluatedShape): number {\n const e = shape.extrusion!,\n c = shape.cavity!\n const closed = (x: typeof c.start) => (x === 'open' ? 0 : x.closed)\n return mm(e.end - e.start - closed(c.start) - closed(c.end))\n}\n\n/** The inside as it stands, every side's wall written out. */\nexport function cavityWorkingOf(shape: FigureEvaluatedShape): { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] } | undefined {\n const c = shape.cavity\n const e = shape.extrusion\n if (!c || !e) return undefined\n return { wall: Object.fromEntries(sidesOf(e.axis).map(s => [s, c.wall[s]!])), start: c.start, end: c.end }\n}\n\n/** A wall dragged to `value`: that side alone, or every side when the walls are one. */\nexport function wallDragged(wall: Record<string, number>, side: string, value: number, perSide: boolean): Record<string, number> {\n const v = Math.max(1, Math.round(value))\n return perSide ? { ...wall, [side]: v } : Object.fromEntries(Object.keys(wall).map(s => [s, v]))\n}\n\n/** An end pressed: open becomes closed by the default wall, closed becomes open. */\nexport function endToggled(shape: FigureEvaluatedShape, now: FigureCavityRequest['start']): FigureCavityRequest['start'] {\n return now === 'open' ? { closed: defaultWallOf(shape) } : 'open'\n}\n"]}
@@ -38,6 +38,11 @@ export interface SectionWorking {
38
38
  length: number;
39
39
  /** A drawn section's end drawn to one point (a pyramid), across the plane axes; null for a push. */
40
40
  apex: Partial<Record<Axis, number>> | null;
41
+ /** A rectangle's top another size across and one corner radius: a tapered box (ADR-0100 §16.1); null for a push. */
42
+ top: {
43
+ across: Partial<Record<Axis, number>>;
44
+ corner: number;
45
+ } | null;
41
46
  /** A pushed rectangle's or ellipse's inside, every side's wall written out; null for none or a drawn section. */
42
47
  cavity: {
43
48
  wall: Record<string, number>;
@@ -86,7 +86,7 @@ export function drawnOf(shape) {
86
86
  if (shape.extrusion)
87
87
  return { ...shape.extrusion, apex: null };
88
88
  if (shape.loft)
89
- return { ...shape.loft, apex: shape.loft.apex };
89
+ return { ...shape.loft, apex: shape.loft.apex ?? null };
90
90
  return undefined;
91
91
  }
92
92
  /** Where a new apex goes: over the middle of the points' span, whole millimetres. */
@@ -111,9 +111,18 @@ export function workingOf(shape) {
111
111
  across,
112
112
  length: e.end - e.start,
113
113
  apex: e.apex ? { ...e.apex } : null,
114
+ top: topOf(shape),
114
115
  cavity: c ? { wall: { ...c.wall }, start: c.start, end: c.end } : null
115
116
  };
116
117
  }
118
+ /** A tapered box's top as the editor holds it: its size across and its one corner radius. */
119
+ function topOf(shape) {
120
+ const t = shape.loft?.to;
121
+ if (t?.kind !== 'rectangle')
122
+ return null;
123
+ const [u, v] = FIGURE_SECTION_PLANE[shape.loft.axis];
124
+ return { across: { [u]: t.size[u], [v]: t.size[v] }, corner: t.corner?.[u] ?? 0 };
125
+ }
117
126
  /**
118
127
  * The part as the working state would make it: its section, its length from the same start, its inside -- what the
119
128
  * inside's drawing reads, so its walls are judged against the widths being typed and not the ones the editor opened with.
@@ -148,6 +157,13 @@ export function workingIssuesOf(shape, w) {
148
157
  words.push({ key: 'figure.text.section-issue-length', params: {} });
149
158
  if (w.apex && !Object.values(w.apex).every(n => Number.isFinite(n)))
150
159
  words.push({ key: 'figure.text.section-issue-number', params: {} });
160
+ if (w.top) {
161
+ /* The top is a section of its own, checked by the same rule (ADR-0100 §16.1). */
162
+ const [u, v] = FIGURE_SECTION_PLANE[e.axis];
163
+ const top = { kind: 'rectangle', size: { [u]: w.top.across[u], [v]: w.top.across[v] }, ...(w.top.corner > 0 ? { corner: { [u]: w.top.corner, [v]: w.top.corner } } : {}) };
164
+ if (checkFigureSection(top, e.axis).length || !(w.top.corner >= 0))
165
+ words.push({ key: 'figure.text.section-issue-top', params: {} });
166
+ }
151
167
  if (!issues.length && words.length === 0 && w.cavity) {
152
168
  const made = figureExtrusionFeaturesOf({ axis: e.axis, section, start: e.start, end: e.start + w.length }, [{ id: 'inside', ...w.cavity }]);
153
169
  if ('refused' in made) {
@@ -169,6 +185,7 @@ export function sectionActionOf(part, kind, opened, w) {
169
185
  const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, opened.across[k])));
170
186
  const apexMoved = !w.apex !== !opened.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, opened.apex[k])));
171
187
  const cavityMoved = JSON.stringify(cavityKeyOf(w)) !== JSON.stringify(cavityKeyOf(opened));
188
+ const topMoved = JSON.stringify(w.top) !== JSON.stringify(opened.top);
172
189
  return {
173
190
  kind: 'set-section',
174
191
  part,
@@ -176,6 +193,7 @@ export function sectionActionOf(part, kind, opened, w) {
176
193
  ...(Object.keys(across).length ? { across } : {}),
177
194
  ...(changed(w.length, opened.length) ? { length: w.length } : {}),
178
195
  ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),
196
+ ...(topMoved ? { top: w.top ? { across: { ...w.top.across }, corner: w.top.corner } : null } : {}),
179
197
  ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})
180
198
  };
181
199
  }
@@ -1 +1 @@
1
- {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OAAO,IAAI,CAAA;AACb,CAAC;AAED,sHAAsH;AACtH,MAAM,UAAU,oBAAoB,CAAC,KAAiC;IACpE,IAAI,KAAK,EAAE,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IAClD,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,4BAA4B,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA;AACxJ,CAAC","sourcesContent":["import { FIGURE_SECTION_PLANE, FIGURE_SECTION_POINT_LIMIT, checkFigureSection, figureExtrusionFeaturesOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape, FigureSection, FigureSectionIssue, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\n\n/*\n * What the section editor does to a drawn section's points, and how it says what is wrong with them (ADR-0100 §3.2).\n * The points are the kernel's own (`{ id, x, z }` for a push along Y), their validity is the kernel's own check, and a\n * point's number on screen is its own name's number (Q9): p3 is 「3」 before and after any edit, and deleting it leaves\n * 1, 2 and 4.\n */\n\ntype Axis = 'x' | 'y' | 'z'\nexport type Points = readonly FigureSectionPoint[]\n\n/** The number a point is shown by: its name's number. */\nexport const pointLabel = (id: string) => /^p(\\d+)$/.exec(id)?.[1] ?? id\n\n/** The next point's name: one past the highest number the loop has, so a new point never takes a gap's number. */\nexport function nextPointId(points: Points): string {\n return `p${Math.max(0, ...points.map(p => Number(/^p(\\d+)$/.exec(p.id)?.[1] ?? 0))) + 1}`\n}\n\n/** A point in the middle of the side from `from` to the point after it, whole millimetres; the new point's id with it. */\nexport function insertAfter(points: Points, from: string, axis: Axis): { points: FigureSectionPoint[]; id: string } {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const i = points.findIndex(p => p.id === from)\n const a = points[i]!,\n b = points[(i + 1) % points.length]!\n const id = nextPointId(points)\n const mid = { id, [u]: Math.round((a[u]! + b[u]!) / 2), [v]: Math.round((a[v]! + b[v]!) / 2) } as FigureSectionPoint\n return { points: [...points.slice(0, i + 1), mid, ...points.slice(i + 1)], id }\n}\n\n/** The points less one, or why not: a section is three points or more. */\nexport function removePoint(points: Points, id: string): FigureSectionPoint[] | { refused: 'too-few' } {\n if (points.length <= 3) return { refused: 'too-few' }\n return points.filter(p => p.id !== id)\n}\n\nexport function movePoint(points: Points, id: string, at: Partial<Record<Axis, number>>): FigureSectionPoint[] {\n return points.map(p => (p.id === id ? { ...p, ...at } : p))\n}\n\n/** What is wrong with the points, by the kernel's own check. */\nexport const issuesOf = (points: Points, axis: Axis) => checkFigureSection({ kind: 'polygon', points: [...points] }, axis)\n\n/** A side said in the loop's order, 3–4 not 4–3: its id is the pair in name order, which a person never sees. */\nfunction sideLabel(points: Points, axis: Axis, side: string): string {\n const s = figureSectionSidesOf({ kind: 'polygon', points: [...points] }, axis).find(x => x.id === side)\n const [a, b] = s?.from ? [s.from, s.to!] : side.split('~')\n return `${pointLabel(a!)}–${pointLabel(b!)}`\n}\n\n/** An issue as the words that say it: an i18n key and its values. */\nexport function issueWords(issue: FigureSectionIssue, points: Points, axis: Axis): { key: string; params: Record<string, string> } {\n const line = (s: string) => sideLabel(points, axis, s)\n switch (issue.code) {\n case 'SIDES_CROSS':\n return { key: 'figure.text.section-issue-cross', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'SIDES_TOUCH':\n return { key: 'figure.text.section-issue-touch', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'SIDES_FOLD':\n return { key: 'figure.text.section-issue-fold', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'ZERO_LENGTH_SIDE':\n return { key: 'figure.text.section-issue-zero-length', params: { a: line(issue.side) } }\n case 'ZERO_AREA':\n return { key: 'figure.text.section-issue-zero-area', params: {} }\n case 'TOO_FEW_POINTS':\n return { key: 'figure.text.section-issue-too-few', params: {} }\n case 'TOO_MANY_POINTS':\n return { key: 'figure.text.section-issue-too-many', params: { limit: String(issue.limit) } }\n case 'CORNER_TOO_LARGE':\n return { key: 'figure.text.section-issue-corner', params: { max: String(Math.round(issue.max * 1000) / 1000) } }\n default:\n return { key: 'figure.text.section-issue-number', params: {} }\n }\n}\n\n/** Every side and point an issue names, to mark on the drawing -- by more than colour: the list says them too. */\nexport function markedBy(issues: readonly FigureSectionIssue[]): { sides: Set<string>; points: Set<string> } {\n const sides = new Set<string>(),\n points = new Set<string>()\n for (const i of issues) {\n if ('sides' in i) for (const s of i.sides) sides.add(s)\n if ('side' in i) sides.add(i.side)\n if ('point' in i) points.add(i.point)\n if ('at' in i) points.add(String(i.at).split('.')[0]!)\n }\n for (const s of sides) for (const p of s.split('~')) points.add(p)\n return { sides, points }\n}\n\n/** How far the drawing reaches from the origin: the points' farthest coordinate with room around, in 50 mm steps. */\nexport function extentOf(points: Points, axis: Axis): number {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const far = Math.max(1, ...points.flatMap(p => [Math.abs(p[u] ?? 0), Math.abs(p[v] ?? 0)]))\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n}\n\nexport const POINT_LIMIT = FIGURE_SECTION_POINT_LIMIT\n\n/** What the section editor holds while it is open: the points of a drawn section, the widths across, the length. */\nexport interface SectionWorking {\n points: FigureSectionPoint[]\n /** Along each plane axis: a rectangle's size, an ellipse's diameter. Empty for a drawn section. */\n across: Partial<Record<Axis, number>>\n length: number\n /** A drawn section's end drawn to one point (a pyramid), across the plane axes; null for a push. */\n apex: Partial<Record<Axis, number>> | null\n /** A pushed rectangle's or ellipse's inside, every side's wall written out; null for none or a drawn section. */\n cavity: { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] } | null\n}\n\n/** A pushed part's section, axis and ends -- or a pyramid's, whose end is its apex (figure-model `loft@1`). */\nexport function drawnOf(shape: FigureEvaluatedShape):\n | { axis: Axis; section: FigureSection; start: number; end: number; apex: Partial<Record<Axis, number>> | null }\n | undefined {\n if (shape.extrusion) return { ...shape.extrusion, apex: null }\n if (shape.loft) return { ...shape.loft, apex: shape.loft.apex }\n return undefined\n}\n\n/** Where a new apex goes: over the middle of the points' span, whole millimetres. */\nexport function apexOver(points: Points, axis: Axis): Partial<Record<Axis, number>> {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const mid = (x: Axis) => Math.round((Math.min(...points.map(p => p[x]!)) + Math.max(...points.map(p => p[x]!))) / 2)\n return { [u]: mid(u), [v]: mid(v) }\n}\n\n/** The working state of a pushed part as it stands. */\nexport function workingOf(shape: FigureEvaluatedShape): SectionWorking {\n const e = drawnOf(shape)!\n const s = e.section\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const across =\n s.kind === 'rectangle'\n ? { [u]: s.size[u]!, [v]: s.size[v]! }\n : s.kind === 'ellipse'\n ? { [u]: 2 * s.radius[u]!, [v]: 2 * s.radius[v]! }\n : {}\n const c = shape.extrusion && shape.cavity\n return {\n points: s.kind === 'polygon' ? s.points.map(p => ({ ...p })) : [],\n across,\n length: e.end - e.start,\n apex: e.apex ? { ...e.apex } : null,\n cavity: c ? { wall: { ...c.wall }, start: c.start, end: c.end } : null\n }\n}\n\n/**\n * The part as the working state would make it: its section, its length from the same start, its inside -- what the\n * inside's drawing reads, so its walls are judged against the widths being typed and not the ones the editor opened with.\n */\nexport function workingShapeOf(shape: FigureEvaluatedShape, w: SectionWorking): FigureEvaluatedShape {\n const e = shape.extrusion!\n const { cavity: _, ...rest } = shape\n return {\n ...rest,\n extrusion: { ...e, section: sectionOf(shape, w), end: e.start + w.length },\n ...(w.cavity ? { cavity: { id: shape.cavity?.id ?? 'inside', wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } } : {})\n } as FigureEvaluatedShape\n}\n\n/** The section the working state makes, of the part's own kind: its corners kept, its points or widths the working ones. */\nexport function sectionOf(shape: FigureEvaluatedShape, w: SectionWorking): FigureSection {\n const e = drawnOf(shape)!\n const s = e.section\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n if (s.kind === 'polygon') return { kind: 'polygon', points: w.points }\n if (s.kind === 'ellipse') return { kind: 'ellipse', radius: { [u]: w.across[u]! / 2, [v]: w.across[v]! / 2 } }\n return { kind: 'rectangle', size: { [u]: w.across[u]!, [v]: w.across[v]! }, ...(s.corner ? { corner: s.corner } : {}) }\n}\n\n/** What would be refused, as words, with the section's own issues for marking points and sides. By the kernel's checks. */\nexport function workingIssuesOf(\n shape: FigureEvaluatedShape,\n w: SectionWorking\n): { issues: FigureSectionIssue[]; words: Array<{ key: string; params: Record<string, string> }> } {\n const e = drawnOf(shape)!\n const section = sectionOf(shape, w)\n const issues = checkFigureSection(section, e.axis)\n const words = issues.map(i => issueWords(i, w.points, e.axis))\n if (!(Number.isFinite(w.length) && w.length > 0)) words.push({ key: 'figure.text.section-issue-length', params: {} })\n if (w.apex && !Object.values(w.apex).every(n => Number.isFinite(n))) words.push({ key: 'figure.text.section-issue-number', params: {} })\n if (!issues.length && words.length === 0 && w.cavity) {\n const made = figureExtrusionFeaturesOf({ axis: e.axis, section, start: e.start, end: e.start + w.length }, [{ id: 'inside', ...w.cavity }])\n if ('refused' in made) {\n const r = made.refused\n words.push({ key: r.code === 'CAVITY_NO_LENGTH' ? 'figure.text.section-issue-cavity-length' : 'figure.text.section-issue-cavity-walls', params: {} })\n }\n }\n return { issues, words }\n}\n\n/** The inside said so two can be compared: its walls by side, its ends. */\nexport const cavityKeyOf = (w: SectionWorking) => (w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null)\n\n/**\n * The one command for everything changed since the editor opened: a drawn section's points always, and of the rest only\n * what changed -- a measure left alone may follow another value and must not be written; an apex taken away is null\n * (back to a push), an inside taken away is null.\n */\nexport function sectionActionOf(part: string, kind: FigureSection['kind'] | undefined, opened: SectionWorking, w: SectionWorking): FigureAuthoringAction {\n const changed = (a: number | undefined, b: number | undefined) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9\n const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, opened.across[k as Axis])))\n const apexMoved = !w.apex !== !opened.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, opened.apex![k as Axis])))\n const cavityMoved = JSON.stringify(cavityKeyOf(w)) !== JSON.stringify(cavityKeyOf(opened))\n return {\n kind: 'set-section',\n part,\n ...(kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),\n ...(Object.keys(across).length ? { across } : {}),\n ...(changed(w.length, opened.length) ? { length: w.length } : {}),\n ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),\n ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})\n }\n}\n\n/**\n * What a measure's field says under it: that it follows another value, or what a measure typed keeps -- the part's\n * middle, or its fastening (ADR-0140 4.1, figure-model's `figureSizeEditOf`); null when there is nothing to say.\n */\nexport function measureNoteOf(measure: FigureSectionMeasure | undefined, kept: 'centre' | 'relation' | 'none' | undefined): { key: string } | null {\n if (measure === 'linked') return { key: 'figure.text.section-editor-linked' }\n if (kept === 'centre') return { key: 'figure.text.size-keeps-centre' }\n if (kept === 'relation') return { key: 'figure.text.size-keeps-fastening' }\n if (kept === 'none') return { key: 'figure.text.size-keeps-none' }\n return null\n}\n\n/** The words beside a drawn section's edit button: how many points it has, and the apex when its end is one point. */\nexport function sectionPointsWordsOf(drawn: ReturnType<typeof drawnOf>): { key: string; params: Record<string, string> } | null {\n if (drawn?.section.kind !== 'polygon') return null\n return { key: drawn.apex ? 'figure.text.section-points-apex' : 'figure.text.section-points', params: { points: String(drawn.section.points.length) } }\n}\n"]}
1
+ {"version":3,"file":"section-drawing.js","sourceRoot":"","sources":["../../client/modeller/section-drawing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,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K,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/H,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAyC,EAAE,IAAgD;IACvH,IAAI,OAAO,KAAK,QAAQ;QAAE,OAAO,EAAE,GAAG,EAAE,mCAAmC,EAAE,CAAA;IAC7E,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAA;IACtE,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,EAAE,GAAG,EAAE,kCAAkC,EAAE,CAAA;IAC3E,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,EAAE,GAAG,EAAE,6BAA6B,EAAE,CAAA;IAClE,OAAO,IAAI,CAAA;AACb,CAAC;AAED,sHAAsH;AACtH,MAAM,UAAU,oBAAoB,CAAC,KAAiC;IACpE,IAAI,KAAK,EAAE,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IAClD,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,4BAA4B,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA;AACxJ,CAAC","sourcesContent":["import { FIGURE_SECTION_PLANE, FIGURE_SECTION_POINT_LIMIT, checkFigureSection, figureExtrusionFeaturesOf, figureSectionSidesOf } from '@hatiolab/figure-model'\nimport type { FigureAuthoringAction, FigureCavityRequest, FigureEvaluatedShape, FigureSection, FigureSectionIssue, FigureSectionMeasure, FigureSectionPoint } from '@hatiolab/figure-model'\n\n/*\n * What the section editor does to a drawn section's points, and how it says what is wrong with them (ADR-0100 §3.2).\n * The points are the kernel's own (`{ id, x, z }` for a push along Y), their validity is the kernel's own check, and a\n * point's number on screen is its own name's number (Q9): p3 is 「3」 before and after any edit, and deleting it leaves\n * 1, 2 and 4.\n */\n\ntype Axis = 'x' | 'y' | 'z'\nexport type Points = readonly FigureSectionPoint[]\n\n/** The number a point is shown by: its name's number. */\nexport const pointLabel = (id: string) => /^p(\\d+)$/.exec(id)?.[1] ?? id\n\n/** The next point's name: one past the highest number the loop has, so a new point never takes a gap's number. */\nexport function nextPointId(points: Points): string {\n return `p${Math.max(0, ...points.map(p => Number(/^p(\\d+)$/.exec(p.id)?.[1] ?? 0))) + 1}`\n}\n\n/** A point in the middle of the side from `from` to the point after it, whole millimetres; the new point's id with it. */\nexport function insertAfter(points: Points, from: string, axis: Axis): { points: FigureSectionPoint[]; id: string } {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const i = points.findIndex(p => p.id === from)\n const a = points[i]!,\n b = points[(i + 1) % points.length]!\n const id = nextPointId(points)\n const mid = { id, [u]: Math.round((a[u]! + b[u]!) / 2), [v]: Math.round((a[v]! + b[v]!) / 2) } as FigureSectionPoint\n return { points: [...points.slice(0, i + 1), mid, ...points.slice(i + 1)], id }\n}\n\n/** The points less one, or why not: a section is three points or more. */\nexport function removePoint(points: Points, id: string): FigureSectionPoint[] | { refused: 'too-few' } {\n if (points.length <= 3) return { refused: 'too-few' }\n return points.filter(p => p.id !== id)\n}\n\nexport function movePoint(points: Points, id: string, at: Partial<Record<Axis, number>>): FigureSectionPoint[] {\n return points.map(p => (p.id === id ? { ...p, ...at } : p))\n}\n\n/** What is wrong with the points, by the kernel's own check. */\nexport const issuesOf = (points: Points, axis: Axis) => checkFigureSection({ kind: 'polygon', points: [...points] }, axis)\n\n/** A side said in the loop's order, 3–4 not 4–3: its id is the pair in name order, which a person never sees. */\nfunction sideLabel(points: Points, axis: Axis, side: string): string {\n const s = figureSectionSidesOf({ kind: 'polygon', points: [...points] }, axis).find(x => x.id === side)\n const [a, b] = s?.from ? [s.from, s.to!] : side.split('~')\n return `${pointLabel(a!)}–${pointLabel(b!)}`\n}\n\n/** An issue as the words that say it: an i18n key and its values. */\nexport function issueWords(issue: FigureSectionIssue, points: Points, axis: Axis): { key: string; params: Record<string, string> } {\n const line = (s: string) => sideLabel(points, axis, s)\n switch (issue.code) {\n case 'SIDES_CROSS':\n return { key: 'figure.text.section-issue-cross', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'SIDES_TOUCH':\n return { key: 'figure.text.section-issue-touch', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'SIDES_FOLD':\n return { key: 'figure.text.section-issue-fold', params: { a: line(issue.sides[0]), b: line(issue.sides[1]) } }\n case 'ZERO_LENGTH_SIDE':\n return { key: 'figure.text.section-issue-zero-length', params: { a: line(issue.side) } }\n case 'ZERO_AREA':\n return { key: 'figure.text.section-issue-zero-area', params: {} }\n case 'TOO_FEW_POINTS':\n return { key: 'figure.text.section-issue-too-few', params: {} }\n case 'TOO_MANY_POINTS':\n return { key: 'figure.text.section-issue-too-many', params: { limit: String(issue.limit) } }\n case 'CORNER_TOO_LARGE':\n return { key: 'figure.text.section-issue-corner', params: { max: String(Math.round(issue.max * 1000) / 1000) } }\n default:\n return { key: 'figure.text.section-issue-number', params: {} }\n }\n}\n\n/** Every side and point an issue names, to mark on the drawing -- by more than colour: the list says them too. */\nexport function markedBy(issues: readonly FigureSectionIssue[]): { sides: Set<string>; points: Set<string> } {\n const sides = new Set<string>(),\n points = new Set<string>()\n for (const i of issues) {\n if ('sides' in i) for (const s of i.sides) sides.add(s)\n if ('side' in i) sides.add(i.side)\n if ('point' in i) points.add(i.point)\n if ('at' in i) points.add(String(i.at).split('.')[0]!)\n }\n for (const s of sides) for (const p of s.split('~')) points.add(p)\n return { sides, points }\n}\n\n/** How far the drawing reaches from the origin: the points' farthest coordinate with room around, in 50 mm steps. */\nexport function extentOf(points: Points, axis: Axis): number {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const far = Math.max(1, ...points.flatMap(p => [Math.abs(p[u] ?? 0), Math.abs(p[v] ?? 0)]))\n return Math.ceil((far * 1.4 + 40) / 50) * 50\n}\n\nexport const POINT_LIMIT = FIGURE_SECTION_POINT_LIMIT\n\n/** What the section editor holds while it is open: the points of a drawn section, the widths across, the length. */\nexport interface SectionWorking {\n points: FigureSectionPoint[]\n /** Along each plane axis: a rectangle's size, an ellipse's diameter. Empty for a drawn section. */\n across: Partial<Record<Axis, number>>\n length: number\n /** A drawn section's end drawn to one point (a pyramid), across the plane axes; null for a push. */\n apex: Partial<Record<Axis, number>> | null\n /** A rectangle's top another size across and one corner radius: a tapered box (ADR-0100 §16.1); null for a push. */\n top: { across: Partial<Record<Axis, number>>; corner: number } | null\n /** A pushed rectangle's or ellipse's inside, every side's wall written out; null for none or a drawn section. */\n cavity: { wall: Record<string, number>; start: FigureCavityRequest['start']; end: FigureCavityRequest['end'] } | null\n}\n\n/** A pushed part's section, axis and ends -- or a pyramid's, whose end is its apex (figure-model `loft@1`). */\nexport function drawnOf(shape: FigureEvaluatedShape):\n | { axis: Axis; section: FigureSection; start: number; end: number; apex: Partial<Record<Axis, number>> | null }\n | undefined {\n if (shape.extrusion) return { ...shape.extrusion, apex: null }\n if (shape.loft) return { ...shape.loft, apex: shape.loft.apex ?? null }\n return undefined\n}\n\n/** Where a new apex goes: over the middle of the points' span, whole millimetres. */\nexport function apexOver(points: Points, axis: Axis): Partial<Record<Axis, number>> {\n const [u, v] = FIGURE_SECTION_PLANE[axis]\n const mid = (x: Axis) => Math.round((Math.min(...points.map(p => p[x]!)) + Math.max(...points.map(p => p[x]!))) / 2)\n return { [u]: mid(u), [v]: mid(v) }\n}\n\n/** The working state of a pushed part as it stands. */\nexport function workingOf(shape: FigureEvaluatedShape): SectionWorking {\n const e = drawnOf(shape)!\n const s = e.section\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const across =\n s.kind === 'rectangle'\n ? { [u]: s.size[u]!, [v]: s.size[v]! }\n : s.kind === 'ellipse'\n ? { [u]: 2 * s.radius[u]!, [v]: 2 * s.radius[v]! }\n : {}\n const c = shape.extrusion && shape.cavity\n return {\n points: s.kind === 'polygon' ? s.points.map(p => ({ ...p })) : [],\n across,\n length: e.end - e.start,\n apex: e.apex ? { ...e.apex } : null,\n top: topOf(shape),\n cavity: c ? { wall: { ...c.wall }, start: c.start, end: c.end } : null\n }\n}\n\n/** A tapered box's top as the editor holds it: its size across and its one corner radius. */\nfunction topOf(shape: FigureEvaluatedShape): SectionWorking['top'] {\n const t = shape.loft?.to\n if (t?.kind !== 'rectangle') return null\n const [u, v] = FIGURE_SECTION_PLANE[shape.loft!.axis]\n return { across: { [u]: t.size[u]!, [v]: t.size[v]! }, corner: t.corner?.[u] ?? 0 }\n}\n\n/**\n * The part as the working state would make it: its section, its length from the same start, its inside -- what the\n * inside's drawing reads, so its walls are judged against the widths being typed and not the ones the editor opened with.\n */\nexport function workingShapeOf(shape: FigureEvaluatedShape, w: SectionWorking): FigureEvaluatedShape {\n const e = shape.extrusion!\n const { cavity: _, ...rest } = shape\n return {\n ...rest,\n extrusion: { ...e, section: sectionOf(shape, w), end: e.start + w.length },\n ...(w.cavity ? { cavity: { id: shape.cavity?.id ?? 'inside', wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } } : {})\n } as FigureEvaluatedShape\n}\n\n/** The section the working state makes, of the part's own kind: its corners kept, its points or widths the working ones. */\nexport function sectionOf(shape: FigureEvaluatedShape, w: SectionWorking): FigureSection {\n const e = drawnOf(shape)!\n const s = e.section\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n if (s.kind === 'polygon') return { kind: 'polygon', points: w.points }\n if (s.kind === 'ellipse') return { kind: 'ellipse', radius: { [u]: w.across[u]! / 2, [v]: w.across[v]! / 2 } }\n return { kind: 'rectangle', size: { [u]: w.across[u]!, [v]: w.across[v]! }, ...(s.corner ? { corner: s.corner } : {}) }\n}\n\n/** What would be refused, as words, with the section's own issues for marking points and sides. By the kernel's checks. */\nexport function workingIssuesOf(\n shape: FigureEvaluatedShape,\n w: SectionWorking\n): { issues: FigureSectionIssue[]; words: Array<{ key: string; params: Record<string, string> }> } {\n const e = drawnOf(shape)!\n const section = sectionOf(shape, w)\n const issues = checkFigureSection(section, e.axis)\n const words = issues.map(i => issueWords(i, w.points, e.axis))\n if (!(Number.isFinite(w.length) && w.length > 0)) words.push({ key: 'figure.text.section-issue-length', params: {} })\n if (w.apex && !Object.values(w.apex).every(n => Number.isFinite(n))) words.push({ key: 'figure.text.section-issue-number', params: {} })\n if (w.top) {\n /* The top is a section of its own, checked by the same rule (ADR-0100 §16.1). */\n const [u, v] = FIGURE_SECTION_PLANE[e.axis]\n const top: FigureSection = { kind: 'rectangle', size: { [u]: w.top.across[u]!, [v]: w.top.across[v]! }, ...(w.top.corner > 0 ? { corner: { [u]: w.top.corner, [v]: w.top.corner } } : {}) }\n if (checkFigureSection(top, e.axis).length || !(w.top.corner >= 0)) words.push({ key: 'figure.text.section-issue-top', params: {} })\n }\n if (!issues.length && words.length === 0 && w.cavity) {\n const made = figureExtrusionFeaturesOf({ axis: e.axis, section, start: e.start, end: e.start + w.length }, [{ id: 'inside', ...w.cavity }])\n if ('refused' in made) {\n const r = made.refused\n words.push({ key: r.code === 'CAVITY_NO_LENGTH' ? 'figure.text.section-issue-cavity-length' : 'figure.text.section-issue-cavity-walls', params: {} })\n }\n }\n return { issues, words }\n}\n\n/** The inside said so two can be compared: its walls by side, its ends. */\nexport const cavityKeyOf = (w: SectionWorking) => (w.cavity ? [Object.entries(w.cavity.wall).sort(), w.cavity.start, w.cavity.end] : null)\n\n/**\n * The one command for everything changed since the editor opened: a drawn section's points always, and of the rest only\n * what changed -- a measure left alone may follow another value and must not be written; an apex taken away is null\n * (back to a push), an inside taken away is null.\n */\nexport function sectionActionOf(part: string, kind: FigureSection['kind'] | undefined, opened: SectionWorking, w: SectionWorking): FigureAuthoringAction {\n const changed = (a: number | undefined, b: number | undefined) => Math.abs((a ?? 0) - (b ?? 0)) > 1e-9\n const across = Object.fromEntries(Object.entries(w.across).filter(([k, v]) => changed(v, opened.across[k as Axis])))\n const apexMoved = !w.apex !== !opened.apex || (!!w.apex && Object.entries(w.apex).some(([k, v]) => changed(v, opened.apex![k as Axis])))\n const cavityMoved = JSON.stringify(cavityKeyOf(w)) !== JSON.stringify(cavityKeyOf(opened))\n const topMoved = JSON.stringify(w.top) !== JSON.stringify(opened.top)\n return {\n kind: 'set-section',\n part,\n ...(kind === 'polygon' ? { points: w.points.map(p => ({ ...p })) } : {}),\n ...(Object.keys(across).length ? { across } : {}),\n ...(changed(w.length, opened.length) ? { length: w.length } : {}),\n ...(apexMoved ? { apex: w.apex ? { ...w.apex } : null } : {}),\n ...(topMoved ? { top: w.top ? { across: { ...w.top.across }, corner: w.top.corner } : null } : {}),\n ...(cavityMoved ? { cavity: w.cavity ? { wall: { ...w.cavity.wall }, start: w.cavity.start, end: w.cavity.end } : null } : {})\n }\n}\n\n/**\n * What a measure's field says under it: that it follows another value, or what a measure typed keeps -- the part's\n * middle, or its fastening (ADR-0140 4.1, figure-model's `figureSizeEditOf`); null when there is nothing to say.\n */\nexport function measureNoteOf(measure: FigureSectionMeasure | undefined, kept: 'centre' | 'relation' | 'none' | undefined): { key: string } | null {\n if (measure === 'linked') return { key: 'figure.text.section-editor-linked' }\n if (kept === 'centre') return { key: 'figure.text.size-keeps-centre' }\n if (kept === 'relation') return { key: 'figure.text.size-keeps-fastening' }\n if (kept === 'none') return { key: 'figure.text.size-keeps-none' }\n return null\n}\n\n/** The words beside a drawn section's edit button: how many points it has, and the apex when its end is one point. */\nexport function sectionPointsWordsOf(drawn: ReturnType<typeof drawnOf>): { key: string; params: Record<string, string> } | null {\n if (drawn?.section.kind !== 'polygon') return null\n return { key: drawn.apex ? 'figure.text.section-points-apex' : 'figure.text.section-points', params: { points: String(drawn.section.points.length) } }\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * 원기둥, 문틀, 구, 원뿔, 그린 단면, 뿔. A word for the screen, read from the shape node's own params; it is not a kind of
4
4
  * stored shape, and nothing is decided by it.
5
5
  */
6
- export type StartingShapeKind = 'cube' | 'rounded-box' | 'hollow-box' | 'cylinder' | 'portal' | 'sphere' | 'frustum' | 'polygon' | 'pyramid';
6
+ export type StartingShapeKind = 'cube' | 'rounded-box' | 'hollow-box' | 'cylinder' | 'portal' | 'sphere' | 'frustum' | 'polygon' | 'pyramid' | 'tapered-box' | 'pipe' | 'duct';
7
7
  export declare function startingShapeKindOf(shape: {
8
8
  op: string;
9
9
  params?: Record<string, unknown>;
@@ -27,7 +27,14 @@ export declare function startingShapeKindOfBody(shape: {
27
27
  kind: string;
28
28
  };
29
29
  };
30
- loft?: unknown;
30
+ loft?: {
31
+ to?: unknown;
32
+ };
33
+ sweep?: {
34
+ section: {
35
+ kind: string;
36
+ };
37
+ };
31
38
  } | undefined): StartingShapeKind | undefined;
32
39
  /** Whether a body is round across -- a circle or an ellipse pushed, anything turned: it takes a segment count. */
33
40
  export declare const isRoundBody: (shape: Parameters<typeof startingShapeKindOfBody>[0]) => boolean;
@@ -3,7 +3,10 @@ export function startingShapeKindOf(shape) {
3
3
  if (shape?.op === 'revolve@1')
4
4
  return p.profile === 'taper' ? 'frustum' : 'sphere';
5
5
  if (shape?.op === 'loft@1')
6
- return 'pyramid';
6
+ return p.section === 'rectangle' ? 'tapered-box' : 'pyramid';
7
+ /* A section along a path (ADR-0100 §16.2): a round one is a pipe, a bent bar without a wall; a rectangle's a duct. */
8
+ if (shape?.op === 'sweep@1')
9
+ return p.section === 'ellipse' ? 'pipe' : 'duct';
7
10
  if (shape?.op !== 'extrude@1')
8
11
  return undefined;
9
12
  if (p.section === 'ellipse')
@@ -22,7 +25,9 @@ export function startingShapeKindOf(shape) {
22
25
  */
23
26
  export function startingShapeKindOfBody(shape) {
24
27
  if (shape?.loft)
25
- return 'pyramid';
28
+ return shape.loft.to ? 'tapered-box' : 'pyramid';
29
+ if (shape?.sweep)
30
+ return shape.sweep.section.kind === 'ellipse' ? 'pipe' : 'duct';
26
31
  if (shape?.revolution)
27
32
  return shape.revolution.profile.kind === 'taper' ? 'frustum' : 'sphere';
28
33
  const s = shape?.extrusion?.section;
@@ -37,5 +42,5 @@ export function startingShapeKindOfBody(shape) {
37
42
  return s.corner ? 'rounded-box' : 'cube';
38
43
  }
39
44
  /** Whether a body is round across -- a circle or an ellipse pushed, anything turned: it takes a segment count. */
40
- export const isRoundBody = (shape) => ['cylinder', 'sphere', 'frustum'].includes(startingShapeKindOfBody(shape) ?? '');
45
+ export const isRoundBody = (shape) => ['cylinder', 'sphere', 'frustum', 'pipe'].includes(startingShapeKindOfBody(shape) ?? '');
41
46
  //# sourceMappingURL=starting-shape.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"starting-shape.js","sourceRoot":"","sources":["../../client/modeller/starting-shape.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CAAC,KAAmE;IACrG,MAAM,CAAC,GAAG,KAAK,EAAE,MAAM,IAAI,EAAE,CAAA;IAC7B,IAAI,KAAK,EAAE,EAAE,KAAK,WAAW;QAAE,OAAO,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;IAClF,IAAI,KAAK,EAAE,EAAE,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAA;IAC5C,IAAI,KAAK,EAAE,EAAE,KAAK,WAAW;QAAE,OAAO,SAAS,CAAA;IAC/C,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,UAAU,CAAA;IAC9C,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IAC7C,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC3C,IAAI,CAAC,CAAC,MAAM;QAAE,OAAO,YAAY,CAAA;IACjC,OAAO,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAA;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAwN;IAC9P,IAAI,KAAK,EAAE,IAAI;QAAE,OAAO,SAAS,CAAA;IACjC,IAAI,KAAK,EAAE,UAAU;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC9F,MAAM,CAAC,GAAG,KAAK,EAAE,SAAS,EAAE,OAAO,CAAA;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAA;IACxB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,UAAU,CAAA;IAC3C,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAM,CAAC,UAAU,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7F,IAAI,KAAM,CAAC,MAAM;QAAE,OAAO,YAAY,CAAA;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAA;AAC1C,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAoD,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA","sourcesContent":["/**\n * What a person calls a part's shape (ADR-0100 §2.1): the starting shape it reads as -- 상자, 둥근 상자, 위가 열린 상자,\n * 원기둥, 문틀, 구, 원뿔, 그린 단면, 뿔. A word for the screen, read from the shape node's own params; it is not a kind of\n * stored shape, and nothing is decided by it.\n */\nexport type StartingShapeKind = 'cube' | 'rounded-box' | 'hollow-box' | 'cylinder' | 'portal' | 'sphere' | 'frustum' | 'polygon' | 'pyramid'\n\nexport function startingShapeKindOf(shape: { op: string; params?: Record<string, unknown> } | undefined): StartingShapeKind | undefined {\n const p = shape?.params ?? {}\n if (shape?.op === 'revolve@1') return p.profile === 'taper' ? 'frustum' : 'sphere'\n if (shape?.op === 'loft@1') return 'pyramid'\n if (shape?.op !== 'extrude@1') return undefined\n if (p.section === 'ellipse') return 'cylinder'\n if (p.section === 'polygon') return 'polygon'\n if (p.section === 'portal') return 'portal'\n if (p.cavity) return 'hollow-box'\n return p.corner === 'round' ? 'rounded-box' : 'cube'\n}\n\n/**\n * The same word for an evaluated body, when only the shape the kernel evaluated is in hand (a row of the parts list):\n * a door frame is the section with jambs, a drawn section the rest of the drawn ones.\n */\nexport function startingShapeKindOfBody(shape: { provider?: string; dimensions?: Record<string, number>; extrusion?: { section: { kind: string; corner?: unknown } }; cavity?: unknown; revolution?: { profile: { kind: string } }; loft?: unknown } | undefined): StartingShapeKind | undefined {\n if (shape?.loft) return 'pyramid'\n if (shape?.revolution) return shape.revolution.profile.kind === 'taper' ? 'frustum' : 'sphere'\n const s = shape?.extrusion?.section\n if (!s) return undefined\n if (s.kind === 'ellipse') return 'cylinder'\n if (s.kind === 'polygon') return shape!.dimensions?.jamb !== undefined ? 'portal' : 'polygon'\n if (shape!.cavity) return 'hollow-box'\n return s.corner ? 'rounded-box' : 'cube'\n}\n\n/** Whether a body is round across -- a circle or an ellipse pushed, anything turned: it takes a segment count. */\nexport const isRoundBody = (shape: Parameters<typeof startingShapeKindOfBody>[0]) => ['cylinder', 'sphere', 'frustum'].includes(startingShapeKindOfBody(shape) ?? '')\n"]}
1
+ {"version":3,"file":"starting-shape.js","sourceRoot":"","sources":["../../client/modeller/starting-shape.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CAAC,KAAmE;IACrG,MAAM,CAAC,GAAG,KAAK,EAAE,MAAM,IAAI,EAAE,CAAA;IAC7B,IAAI,KAAK,EAAE,EAA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AAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC9F,MAAM,CAAC,GAAG,KAAK,EAAE,SAAS,EAAE,OAAO,CAAA;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAA;IACxB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,UAAU,CAAA;IAC3C,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAM,CAAC,UAAU,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7F,IAAI,KAAM,CAAC,MAAM;QAAE,OAAO,YAAY,CAAA;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAA;AAC1C,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAoD,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA","sourcesContent":["/**\n * What a person calls a part's shape (ADR-0100 §2.1): the starting shape it reads as -- 상자, 둥근 상자, 위가 열린 상자,\n * 원기둥, 문틀, 구, 원뿔, 그린 단면, 뿔. A word for the screen, read from the shape node's own params; it is not a kind of\n * stored shape, and nothing is decided by it.\n */\nexport type StartingShapeKind = 'cube' | 'rounded-box' | 'hollow-box' | 'cylinder' | 'portal' | 'sphere' | 'frustum' | 'polygon' | 'pyramid' | 'tapered-box' | 'pipe' | 'duct'\n\nexport function startingShapeKindOf(shape: { op: string; params?: Record<string, unknown> } | undefined): StartingShapeKind | undefined {\n const p = shape?.params ?? {}\n if (shape?.op === 'revolve@1') return p.profile === 'taper' ? 'frustum' : 'sphere'\n if (shape?.op === 'loft@1') return p.section === 'rectangle' ? 'tapered-box' : 'pyramid'\n /* A section along a path (ADR-0100 §16.2): a round one is a pipe, a bent bar without a wall; a rectangle's a duct. */\n if (shape?.op === 'sweep@1') return p.section === 'ellipse' ? 'pipe' : 'duct'\n if (shape?.op !== 'extrude@1') return undefined\n if (p.section === 'ellipse') return 'cylinder'\n if (p.section === 'polygon') return 'polygon'\n if (p.section === 'portal') return 'portal'\n if (p.cavity) return 'hollow-box'\n return p.corner === 'round' ? 'rounded-box' : 'cube'\n}\n\n/**\n * The same word for an evaluated body, when only the shape the kernel evaluated is in hand (a row of the parts list):\n * a door frame is the section with jambs, a drawn section the rest of the drawn ones.\n */\nexport function startingShapeKindOfBody(shape: { provider?: string; dimensions?: Record<string, number>; extrusion?: { section: { kind: string; corner?: unknown } }; cavity?: unknown; revolution?: { profile: { kind: string } }; loft?: { to?: unknown }; sweep?: { section: { kind: string } } } | undefined): StartingShapeKind | undefined {\n if (shape?.loft) return shape.loft.to ? 'tapered-box' : 'pyramid'\n if (shape?.sweep) return shape.sweep.section.kind === 'ellipse' ? 'pipe' : 'duct'\n if (shape?.revolution) return shape.revolution.profile.kind === 'taper' ? 'frustum' : 'sphere'\n const s = shape?.extrusion?.section\n if (!s) return undefined\n if (s.kind === 'ellipse') return 'cylinder'\n if (s.kind === 'polygon') return shape!.dimensions?.jamb !== undefined ? 'portal' : 'polygon'\n if (shape!.cavity) return 'hollow-box'\n return s.corner ? 'rounded-box' : 'cube'\n}\n\n/** Whether a body is round across -- a circle or an ellipse pushed, anything turned: it takes a segment count. */\nexport const isRoundBody = (shape: Parameters<typeof startingShapeKindOfBody>[0]) => ['cylinder', 'sphere', 'frustum', 'pipe'].includes(startingShapeKindOfBody(shape) ?? '')\n"]}