@mlightcad/cad-simple-viewer 1.4.13 → 1.5.1

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 (465) hide show
  1. package/dist/index.js +26532 -44513
  2. package/dist/index.umd.cjs +163 -52
  3. package/dist/libredwg-parser-worker.js +4378 -7481
  4. package/dist/mtext-renderer-worker.js +4107 -3865
  5. package/dist/viewer-runtime.iife.js +3879 -0
  6. package/lib/app/AcApAnnotation.js +4 -4
  7. package/lib/app/AcApAnnotation.js.map +1 -1
  8. package/lib/app/AcApDocManager.d.ts +59 -6
  9. package/lib/app/AcApDocManager.d.ts.map +1 -1
  10. package/lib/app/AcApDocManager.js +188 -28
  11. package/lib/app/AcApDocManager.js.map +1 -1
  12. package/lib/command/AcApLogCmd.d.ts +1 -1
  13. package/lib/command/AcApLogCmd.d.ts.map +1 -1
  14. package/lib/command/AcApLogCmd.js +1 -1
  15. package/lib/command/AcApLogCmd.js.map +1 -1
  16. package/lib/command/AcApOpenCmd.d.ts +1 -1
  17. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  18. package/lib/command/AcApOpenCmd.js +1 -2
  19. package/lib/command/AcApOpenCmd.js.map +1 -1
  20. package/lib/command/AcApPanCmd.d.ts +1 -1
  21. package/lib/command/AcApPanCmd.d.ts.map +1 -1
  22. package/lib/command/AcApPanCmd.js +1 -2
  23. package/lib/command/AcApPanCmd.js.map +1 -1
  24. package/lib/command/AcApQNewCmd.d.ts +1 -1
  25. package/lib/command/AcApQNewCmd.d.ts.map +1 -1
  26. package/lib/command/AcApQNewCmd.js +1 -1
  27. package/lib/command/AcApQNewCmd.js.map +1 -1
  28. package/lib/command/AcApRegenCmd.d.ts +1 -1
  29. package/lib/command/AcApRegenCmd.d.ts.map +1 -1
  30. package/lib/command/AcApRegenCmd.js +1 -1
  31. package/lib/command/AcApRegenCmd.js.map +1 -1
  32. package/lib/command/AcApSelectCmd.d.ts +1 -1
  33. package/lib/command/AcApSelectCmd.d.ts.map +1 -1
  34. package/lib/command/AcApSelectCmd.js +1 -2
  35. package/lib/command/AcApSelectCmd.js.map +1 -1
  36. package/lib/command/AcApZoomCmd.js +3 -3
  37. package/lib/command/AcApZoomCmd.js.map +1 -1
  38. package/lib/command/{AcApConvertToDxfCmd.d.ts → convert/AcApConvertToDxfCmd.d.ts} +2 -2
  39. package/lib/command/convert/AcApConvertToDxfCmd.d.ts.map +1 -0
  40. package/lib/command/{AcApConvertToDxfCmd.js → convert/AcApConvertToDxfCmd.js} +1 -1
  41. package/lib/command/convert/AcApConvertToDxfCmd.js.map +1 -0
  42. package/lib/command/{AcApConvertToPngCmd.d.ts → convert/AcApConvertToPngCmd.d.ts} +23 -5
  43. package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -0
  44. package/lib/command/{AcApConvertToPngCmd.js → convert/AcApConvertToPngCmd.js} +88 -15
  45. package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -0
  46. package/lib/command/{AcApConvertToSvgCmd.d.ts → convert/AcApConvertToSvgCmd.d.ts} +2 -2
  47. package/lib/command/convert/AcApConvertToSvgCmd.d.ts.map +1 -0
  48. package/lib/command/{AcApConvertToSvgCmd.js → convert/AcApConvertToSvgCmd.js} +1 -1
  49. package/lib/command/convert/AcApConvertToSvgCmd.js.map +1 -0
  50. package/lib/command/convert/AcApDxfConvertor.d.ts.map +1 -0
  51. package/lib/command/{AcApDxfConvertor.js → convert/AcApDxfConvertor.js} +1 -1
  52. package/lib/command/convert/AcApDxfConvertor.js.map +1 -0
  53. package/lib/command/convert/AcApExportHtmlCmd.d.ts +22 -0
  54. package/lib/command/convert/AcApExportHtmlCmd.d.ts.map +1 -0
  55. package/lib/command/convert/AcApExportHtmlCmd.js +93 -0
  56. package/lib/command/convert/AcApExportHtmlCmd.js.map +1 -0
  57. package/lib/command/convert/AcApHtmlConvertor.d.ts +61 -0
  58. package/lib/command/convert/AcApHtmlConvertor.d.ts.map +1 -0
  59. package/lib/command/convert/AcApHtmlConvertor.js +223 -0
  60. package/lib/command/convert/AcApHtmlConvertor.js.map +1 -0
  61. package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts +65 -0
  62. package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts.map +1 -0
  63. package/lib/command/convert/AcApHtmlSnapshotBuilder.js +301 -0
  64. package/lib/command/convert/AcApHtmlSnapshotBuilder.js.map +1 -0
  65. package/lib/command/{AcApPngConvertor.d.ts → convert/AcApPngConvertor.d.ts} +20 -35
  66. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -0
  67. package/lib/command/{AcApPngConvertor.js → convert/AcApPngConvertor.js} +99 -71
  68. package/lib/command/convert/AcApPngConvertor.js.map +1 -0
  69. package/lib/command/convert/AcApSvgConvertor.d.ts.map +1 -0
  70. package/lib/command/{AcApSvgConvertor.js → convert/AcApSvgConvertor.js} +1 -1
  71. package/lib/command/convert/AcApSvgConvertor.js.map +1 -0
  72. package/lib/command/convert/index.d.ts +9 -0
  73. package/lib/command/convert/index.d.ts.map +1 -0
  74. package/lib/command/convert/index.js +9 -0
  75. package/lib/command/convert/index.js.map +1 -0
  76. package/lib/command/draw/AcApArcCmd.d.ts +297 -0
  77. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -0
  78. package/lib/command/{AcApArcCmd.js → draw/AcApArcCmd.js} +839 -32
  79. package/lib/command/draw/AcApArcCmd.js.map +1 -0
  80. package/lib/command/{AcApCircleCmd.d.ts → draw/AcApCircleCmd.d.ts} +2 -2
  81. package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -0
  82. package/lib/command/{AcApCircleCmd.js → draw/AcApCircleCmd.js} +8 -9
  83. package/lib/command/draw/AcApCircleCmd.js.map +1 -0
  84. package/lib/command/{AcApDimLinearCmd.d.ts → draw/AcApDimLinearCmd.d.ts} +2 -2
  85. package/lib/command/draw/AcApDimLinearCmd.d.ts.map +1 -0
  86. package/lib/command/{AcApDimLinearCmd.js → draw/AcApDimLinearCmd.js} +3 -3
  87. package/lib/command/draw/AcApDimLinearCmd.js.map +1 -0
  88. package/lib/command/{AcApEllipseCmd.d.ts → draw/AcApEllipseCmd.d.ts} +2 -2
  89. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -0
  90. package/lib/command/{AcApEllipseCmd.js → draw/AcApEllipseCmd.js} +7 -9
  91. package/lib/command/draw/AcApEllipseCmd.js.map +1 -0
  92. package/lib/command/{AcApHatchCmd.d.ts → draw/AcApHatchCmd.d.ts} +54 -17
  93. package/lib/command/draw/AcApHatchCmd.d.ts.map +1 -0
  94. package/lib/command/{AcApHatchCmd.js → draw/AcApHatchCmd.js} +122 -30
  95. package/lib/command/draw/AcApHatchCmd.js.map +1 -0
  96. package/lib/command/{AcApLineCmd.d.ts → draw/AcApLineCmd.d.ts} +2 -2
  97. package/lib/command/draw/AcApLineCmd.d.ts.map +1 -0
  98. package/lib/command/{AcApLineCmd.js → draw/AcApLineCmd.js} +3 -3
  99. package/lib/command/draw/AcApLineCmd.js.map +1 -0
  100. package/lib/command/draw/AcApMLineCmd.d.ts +31 -0
  101. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -0
  102. package/lib/command/draw/AcApMLineCmd.js +528 -0
  103. package/lib/command/draw/AcApMLineCmd.js.map +1 -0
  104. package/lib/command/{AcApMTextCmd.d.ts → draw/AcApMTextCmd.d.ts} +2 -2
  105. package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -0
  106. package/lib/command/{AcApMTextCmd.js → draw/AcApMTextCmd.js} +6 -4
  107. package/lib/command/draw/AcApMTextCmd.js.map +1 -0
  108. package/lib/command/draw/AcApPointCmd.d.ts +16 -0
  109. package/lib/command/draw/AcApPointCmd.d.ts.map +1 -0
  110. package/lib/command/draw/AcApPointCmd.js +98 -0
  111. package/lib/command/draw/AcApPointCmd.js.map +1 -0
  112. package/lib/command/{AcApPolygonCmd.d.ts → draw/AcApPolygonCmd.d.ts} +2 -2
  113. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -0
  114. package/lib/command/{AcApPolygonCmd.js → draw/AcApPolygonCmd.js} +7 -8
  115. package/lib/command/draw/AcApPolygonCmd.js.map +1 -0
  116. package/lib/command/{AcApPolylineCmd.d.ts → draw/AcApPolylineCmd.d.ts} +51 -2
  117. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -0
  118. package/lib/command/{AcApPolylineCmd.js → draw/AcApPolylineCmd.js} +203 -21
  119. package/lib/command/draw/AcApPolylineCmd.js.map +1 -0
  120. package/lib/command/draw/AcApRayCmd.d.ts +10 -0
  121. package/lib/command/draw/AcApRayCmd.d.ts.map +1 -0
  122. package/lib/command/draw/AcApRayCmd.js +144 -0
  123. package/lib/command/draw/AcApRayCmd.js.map +1 -0
  124. package/lib/command/{AcApRectCmd.d.ts → draw/AcApRectCmd.d.ts} +2 -2
  125. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -0
  126. package/lib/command/{AcApRectCmd.js → draw/AcApRectCmd.js} +12 -13
  127. package/lib/command/draw/AcApRectCmd.js.map +1 -0
  128. package/lib/command/{AcApSplineCmd.d.ts → draw/AcApSplineCmd.d.ts} +2 -2
  129. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -0
  130. package/lib/command/{AcApSplineCmd.js → draw/AcApSplineCmd.js} +6 -9
  131. package/lib/command/draw/AcApSplineCmd.js.map +1 -0
  132. package/lib/command/draw/AcApXLineCmd.d.ts +25 -0
  133. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -0
  134. package/lib/command/draw/AcApXLineCmd.js +209 -0
  135. package/lib/command/draw/AcApXLineCmd.js.map +1 -0
  136. package/lib/command/draw/index.d.ts +16 -0
  137. package/lib/command/draw/index.d.ts.map +1 -0
  138. package/lib/command/draw/index.js +16 -0
  139. package/lib/command/draw/index.js.map +1 -0
  140. package/lib/command/index.d.ts +6 -32
  141. package/lib/command/index.d.ts.map +1 -1
  142. package/lib/command/index.js +6 -32
  143. package/lib/command/index.js.map +1 -1
  144. package/lib/command/layer/AcApLayerCloseCmd.d.ts +23 -0
  145. package/lib/command/layer/AcApLayerCloseCmd.d.ts.map +1 -0
  146. package/lib/command/layer/AcApLayerCloseCmd.js +86 -0
  147. package/lib/command/layer/AcApLayerCloseCmd.js.map +1 -0
  148. package/lib/command/{AcApLayerCmd.d.ts → layer/AcApLayerCmd.d.ts} +3 -5
  149. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -0
  150. package/lib/command/{AcApLayerCmd.js → layer/AcApLayerCmd.js} +5 -8
  151. package/lib/command/layer/AcApLayerCmd.js.map +1 -0
  152. package/lib/command/layer/AcApLayerCurCmd.d.ts +43 -0
  153. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -0
  154. package/lib/command/layer/AcApLayerCurCmd.js +183 -0
  155. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -0
  156. package/lib/command/layer/AcApLayerDelCmd.d.ts +112 -0
  157. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -0
  158. package/lib/command/layer/AcApLayerDelCmd.js +446 -0
  159. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -0
  160. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +103 -0
  161. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -0
  162. package/lib/command/layer/AcApLayerFreezeCmd.js +398 -0
  163. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -0
  164. package/lib/command/layer/AcApLayerIsoCmd.d.ts +99 -0
  165. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -0
  166. package/lib/command/layer/AcApLayerIsoCmd.js +485 -0
  167. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -0
  168. package/lib/command/layer/AcApLayerIsoState.d.ts +68 -0
  169. package/lib/command/layer/AcApLayerIsoState.d.ts.map +1 -0
  170. package/lib/command/layer/AcApLayerIsoState.js +53 -0
  171. package/lib/command/layer/AcApLayerIsoState.js.map +1 -0
  172. package/lib/command/layer/AcApLayerLockCmd.d.ts +50 -0
  173. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -0
  174. package/lib/command/layer/AcApLayerLockCmd.js +175 -0
  175. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -0
  176. package/lib/command/layer/AcApLayerOffCmd.d.ts +95 -0
  177. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -0
  178. package/lib/command/layer/AcApLayerOffCmd.js +384 -0
  179. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -0
  180. package/lib/command/layer/AcApLayerOnCmd.d.ts +30 -0
  181. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -0
  182. package/lib/command/layer/AcApLayerOnCmd.js +138 -0
  183. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -0
  184. package/lib/command/layer/AcApLayerPCmd.d.ts +83 -0
  185. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -0
  186. package/lib/command/layer/AcApLayerPCmd.js +241 -0
  187. package/lib/command/layer/AcApLayerPCmd.js.map +1 -0
  188. package/lib/command/layer/AcApLayerThawCmd.d.ts +37 -0
  189. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -0
  190. package/lib/command/layer/AcApLayerThawCmd.js +150 -0
  191. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -0
  192. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +52 -0
  193. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -0
  194. package/lib/command/layer/AcApLayerUnisoCmd.js +199 -0
  195. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -0
  196. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +50 -0
  197. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -0
  198. package/lib/command/layer/AcApLayerUnlockCmd.js +175 -0
  199. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -0
  200. package/lib/command/layer/index.d.ts +14 -0
  201. package/lib/command/layer/index.d.ts.map +1 -0
  202. package/lib/command/layer/index.js +14 -0
  203. package/lib/command/layer/index.js.map +1 -0
  204. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts +24 -0
  205. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -0
  206. package/lib/command/{AcApClearMeasurementsCmd.js → measure/AcApClearMeasurementsCmd.js} +16 -5
  207. package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -0
  208. package/lib/command/{AcApMeasureAngleCmd.d.ts → measure/AcApMeasureAngleCmd.d.ts} +2 -2
  209. package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -0
  210. package/lib/command/{AcApMeasureAngleCmd.js → measure/AcApMeasureAngleCmd.js} +18 -9
  211. package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -0
  212. package/lib/command/{AcApMeasureArcCmd.d.ts → measure/AcApMeasureArcCmd.d.ts} +2 -2
  213. package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -0
  214. package/lib/command/{AcApMeasureArcCmd.js → measure/AcApMeasureArcCmd.js} +14 -7
  215. package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -0
  216. package/lib/command/{AcApMeasureAreaCmd.d.ts → measure/AcApMeasureAreaCmd.d.ts} +2 -2
  217. package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -0
  218. package/lib/command/{AcApMeasureAreaCmd.js → measure/AcApMeasureAreaCmd.js} +14 -7
  219. package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -0
  220. package/lib/command/{AcApMeasureDistanceCmd.d.ts → measure/AcApMeasureDistanceCmd.d.ts} +5 -4
  221. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -0
  222. package/lib/command/{AcApMeasureDistanceCmd.js → measure/AcApMeasureDistanceCmd.js} +17 -9
  223. package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -0
  224. package/lib/command/measure/index.d.ts +6 -0
  225. package/lib/command/measure/index.d.ts.map +1 -0
  226. package/lib/command/measure/index.js +6 -0
  227. package/lib/command/measure/index.js.map +1 -0
  228. package/lib/command/modify/AcApCopyCmd.d.ts +94 -0
  229. package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -0
  230. package/lib/command/modify/AcApCopyCmd.js +549 -0
  231. package/lib/command/modify/AcApCopyCmd.js.map +1 -0
  232. package/lib/command/{AcApEraseCmd.d.ts → modify/AcApEraseCmd.d.ts} +2 -2
  233. package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -0
  234. package/lib/command/{AcApEraseCmd.js → modify/AcApEraseCmd.js} +3 -5
  235. package/lib/command/modify/AcApEraseCmd.js.map +1 -0
  236. package/lib/command/{AcApMoveCmd.d.ts → modify/AcApMoveCmd.d.ts} +2 -2
  237. package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -0
  238. package/lib/command/{AcApMoveCmd.js → modify/AcApMoveCmd.js} +3 -4
  239. package/lib/command/modify/AcApMoveCmd.js.map +1 -0
  240. package/lib/command/modify/AcApOffsetCmd.d.ts +30 -0
  241. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -0
  242. package/lib/command/modify/AcApOffsetCmd.js +424 -0
  243. package/lib/command/modify/AcApOffsetCmd.js.map +1 -0
  244. package/lib/command/modify/AcApRotateCmd.d.ts +81 -0
  245. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -0
  246. package/lib/command/modify/AcApRotateCmd.js +486 -0
  247. package/lib/command/modify/AcApRotateCmd.js.map +1 -0
  248. package/lib/command/modify/index.d.ts +6 -0
  249. package/lib/command/modify/index.d.ts.map +1 -0
  250. package/lib/command/modify/index.js +6 -0
  251. package/lib/command/modify/index.js.map +1 -0
  252. package/lib/command/{AcApBaseRevCmd.d.ts → review/AcApBaseRevCmd.d.ts} +2 -2
  253. package/lib/command/review/AcApBaseRevCmd.d.ts.map +1 -0
  254. package/lib/command/{AcApBaseRevCmd.js → review/AcApBaseRevCmd.js} +2 -2
  255. package/lib/command/review/AcApBaseRevCmd.js.map +1 -0
  256. package/lib/command/{AcApRevCircleCmd.d.ts → review/AcApRevCircleCmd.d.ts} +1 -1
  257. package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -0
  258. package/lib/command/{AcApRevCircleCmd.js → review/AcApRevCircleCmd.js} +8 -5
  259. package/lib/command/review/AcApRevCircleCmd.js.map +1 -0
  260. package/lib/command/{AcApRevCloudCmd.d.ts → review/AcApRevCloudCmd.d.ts} +2 -2
  261. package/lib/command/review/AcApRevCloudCmd.d.ts.map +1 -0
  262. package/lib/command/{AcApRevCloudCmd.js → review/AcApRevCloudCmd.js} +3 -3
  263. package/lib/command/review/AcApRevCloudCmd.js.map +1 -0
  264. package/lib/command/{AcApRevRectCmd.d.ts → review/AcApRevRectCmd.d.ts} +1 -1
  265. package/lib/command/review/AcApRevRectCmd.d.ts.map +1 -0
  266. package/lib/command/{AcApRevRectCmd.js → review/AcApRevRectCmd.js} +3 -3
  267. package/lib/command/review/AcApRevRectCmd.js.map +1 -0
  268. package/lib/command/{AcApRevVisibilityCmd.d.ts → review/AcApRevVisibilityCmd.d.ts} +1 -1
  269. package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +1 -0
  270. package/lib/command/{AcApRevVisibilityCmd.js → review/AcApRevVisibilityCmd.js} +2 -2
  271. package/lib/command/review/AcApRevVisibilityCmd.js.map +1 -0
  272. package/lib/command/{AcApSketchCmd.d.ts → review/AcApSketchCmd.d.ts} +2 -2
  273. package/lib/command/review/AcApSketchCmd.d.ts.map +1 -0
  274. package/lib/command/{AcApSketchCmd.js → review/AcApSketchCmd.js} +3 -3
  275. package/lib/command/review/AcApSketchCmd.js.map +1 -0
  276. package/lib/command/review/index.d.ts +7 -0
  277. package/lib/command/review/index.d.ts.map +1 -0
  278. package/lib/command/review/index.js +7 -0
  279. package/lib/command/review/index.js.map +1 -0
  280. package/lib/editor/global/eventBus.d.ts +4 -6
  281. package/lib/editor/global/eventBus.d.ts.map +1 -1
  282. package/lib/editor/global/eventBus.js.map +1 -1
  283. package/lib/editor/input/AcEdSelectionFilter.js +7 -6
  284. package/lib/editor/input/AcEdSelectionFilter.js.map +1 -1
  285. package/lib/editor/input/AcEditor.d.ts +17 -0
  286. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  287. package/lib/editor/input/AcEditor.js +23 -0
  288. package/lib/editor/input/AcEditor.js.map +1 -1
  289. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +6 -0
  290. package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
  291. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +16 -0
  292. package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
  293. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -1
  294. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +1 -1
  295. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -1
  296. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +6 -0
  297. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
  298. package/lib/editor/input/prompt/AcEdPromptPointOptions.js +16 -0
  299. package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
  300. package/lib/editor/input/ui/AcEdCommandLine.d.ts +25 -23
  301. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  302. package/lib/editor/input/ui/AcEdCommandLine.js +101 -43
  303. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  304. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +9 -0
  305. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  306. package/lib/editor/input/ui/AcEdFloatingInput.js +25 -5
  307. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  308. package/lib/editor/input/ui/AcEdInputManager.d.ts +46 -6
  309. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  310. package/lib/editor/input/ui/AcEdInputManager.js +153 -43
  311. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  312. package/lib/editor/input/ui/AcEdMTextEditor.d.ts +67 -2
  313. package/lib/editor/input/ui/AcEdMTextEditor.d.ts.map +1 -1
  314. package/lib/editor/input/ui/AcEdMTextEditor.js +210 -19
  315. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  316. package/lib/editor/input/ui/AcEdMessageType.d.ts +10 -0
  317. package/lib/editor/input/ui/AcEdMessageType.d.ts.map +1 -0
  318. package/lib/editor/input/ui/AcEdMessageType.js +2 -0
  319. package/lib/editor/input/ui/AcEdMessageType.js.map +1 -0
  320. package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
  321. package/lib/editor/input/ui/AcEdRubberBand.js +16 -8
  322. package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
  323. package/lib/editor/input/ui/index.d.ts +1 -0
  324. package/lib/editor/input/ui/index.d.ts.map +1 -1
  325. package/lib/editor/input/ui/index.js +1 -0
  326. package/lib/editor/input/ui/index.js.map +1 -1
  327. package/lib/editor/view/AcEdBaseView.d.ts +3 -8
  328. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  329. package/lib/editor/view/AcEdBaseView.js +3 -5
  330. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  331. package/lib/editor/view/AcEdHoverController.d.ts +2 -3
  332. package/lib/editor/view/AcEdHoverController.d.ts.map +1 -1
  333. package/lib/editor/view/AcEdHoverController.js +7 -0
  334. package/lib/editor/view/AcEdHoverController.js.map +1 -1
  335. package/lib/editor/view/AcEdSelectionAction.d.ts +108 -0
  336. package/lib/editor/view/AcEdSelectionAction.d.ts.map +1 -0
  337. package/lib/editor/view/AcEdSelectionAction.js +74 -0
  338. package/lib/editor/view/AcEdSelectionAction.js.map +1 -0
  339. package/lib/editor/view/index.d.ts +1 -0
  340. package/lib/editor/view/index.d.ts.map +1 -1
  341. package/lib/editor/view/index.js +1 -0
  342. package/lib/editor/view/index.js.map +1 -1
  343. package/lib/i18n/en/command.d.ts +187 -13
  344. package/lib/i18n/en/command.d.ts.map +1 -1
  345. package/lib/i18n/en/command.js +195 -21
  346. package/lib/i18n/en/command.js.map +1 -1
  347. package/lib/i18n/en/jig.d.ts +579 -212
  348. package/lib/i18n/en/jig.d.ts.map +1 -1
  349. package/lib/i18n/en/jig.js +669 -302
  350. package/lib/i18n/en/jig.js.map +1 -1
  351. package/lib/i18n/zh/command.d.ts +187 -13
  352. package/lib/i18n/zh/command.d.ts.map +1 -1
  353. package/lib/i18n/zh/command.js +196 -22
  354. package/lib/i18n/zh/command.js.map +1 -1
  355. package/lib/i18n/zh/jig.d.ts +579 -212
  356. package/lib/i18n/zh/jig.d.ts.map +1 -1
  357. package/lib/i18n/zh/jig.js +668 -301
  358. package/lib/i18n/zh/jig.js.map +1 -1
  359. package/lib/index.d.ts +2 -1
  360. package/lib/index.d.ts.map +1 -1
  361. package/lib/index.js +2 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +136 -2
  364. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  365. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +154 -16
  366. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  367. package/lib/util/AcApFontUtil.d.ts +69 -0
  368. package/lib/util/AcApFontUtil.d.ts.map +1 -0
  369. package/lib/util/AcApFontUtil.js +161 -0
  370. package/lib/util/AcApFontUtil.js.map +1 -0
  371. package/lib/util/index.d.ts +2 -0
  372. package/lib/util/index.d.ts.map +1 -1
  373. package/lib/util/index.js +2 -0
  374. package/lib/util/index.js.map +1 -1
  375. package/lib/util/yieldToMain.d.ts +5 -0
  376. package/lib/util/yieldToMain.d.ts.map +1 -0
  377. package/lib/util/yieldToMain.js +11 -0
  378. package/lib/util/yieldToMain.js.map +1 -0
  379. package/lib/view/AcTrLayout.d.ts +17 -0
  380. package/lib/view/AcTrLayout.d.ts.map +1 -1
  381. package/lib/view/AcTrLayout.js +34 -2
  382. package/lib/view/AcTrLayout.js.map +1 -1
  383. package/lib/view/AcTrLayoutView.d.ts +12 -0
  384. package/lib/view/AcTrLayoutView.d.ts.map +1 -1
  385. package/lib/view/AcTrLayoutView.js +18 -0
  386. package/lib/view/AcTrLayoutView.js.map +1 -1
  387. package/lib/view/AcTrPickResultUtil.d.ts +4 -0
  388. package/lib/view/AcTrPickResultUtil.d.ts.map +1 -0
  389. package/lib/view/AcTrPickResultUtil.js +54 -0
  390. package/lib/view/AcTrPickResultUtil.js.map +1 -0
  391. package/lib/view/AcTrScene.d.ts +38 -6
  392. package/lib/view/AcTrScene.d.ts.map +1 -1
  393. package/lib/view/AcTrScene.js +57 -30
  394. package/lib/view/AcTrScene.js.map +1 -1
  395. package/lib/view/AcTrView2d.d.ts +191 -0
  396. package/lib/view/AcTrView2d.d.ts.map +1 -1
  397. package/lib/view/AcTrView2d.js +795 -137
  398. package/lib/view/AcTrView2d.js.map +1 -1
  399. package/package.json +14 -8
  400. package/lib/command/AcApArcCmd.d.ts +0 -140
  401. package/lib/command/AcApArcCmd.d.ts.map +0 -1
  402. package/lib/command/AcApArcCmd.js.map +0 -1
  403. package/lib/command/AcApBaseRevCmd.d.ts.map +0 -1
  404. package/lib/command/AcApBaseRevCmd.js.map +0 -1
  405. package/lib/command/AcApCircleCmd.d.ts.map +0 -1
  406. package/lib/command/AcApCircleCmd.js.map +0 -1
  407. package/lib/command/AcApClearMeasurementsCmd.d.ts +0 -13
  408. package/lib/command/AcApClearMeasurementsCmd.d.ts.map +0 -1
  409. package/lib/command/AcApClearMeasurementsCmd.js.map +0 -1
  410. package/lib/command/AcApConvertToDxfCmd.d.ts.map +0 -1
  411. package/lib/command/AcApConvertToDxfCmd.js.map +0 -1
  412. package/lib/command/AcApConvertToPngCmd.d.ts.map +0 -1
  413. package/lib/command/AcApConvertToPngCmd.js.map +0 -1
  414. package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
  415. package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
  416. package/lib/command/AcApDimLinearCmd.d.ts.map +0 -1
  417. package/lib/command/AcApDimLinearCmd.js.map +0 -1
  418. package/lib/command/AcApDxfConvertor.d.ts.map +0 -1
  419. package/lib/command/AcApDxfConvertor.js.map +0 -1
  420. package/lib/command/AcApEllipseCmd.d.ts.map +0 -1
  421. package/lib/command/AcApEllipseCmd.js.map +0 -1
  422. package/lib/command/AcApEraseCmd.d.ts.map +0 -1
  423. package/lib/command/AcApEraseCmd.js.map +0 -1
  424. package/lib/command/AcApHatchCmd.d.ts.map +0 -1
  425. package/lib/command/AcApHatchCmd.js.map +0 -1
  426. package/lib/command/AcApLayerCmd.d.ts.map +0 -1
  427. package/lib/command/AcApLayerCmd.js.map +0 -1
  428. package/lib/command/AcApLineCmd.d.ts.map +0 -1
  429. package/lib/command/AcApLineCmd.js.map +0 -1
  430. package/lib/command/AcApMTextCmd.d.ts.map +0 -1
  431. package/lib/command/AcApMTextCmd.js.map +0 -1
  432. package/lib/command/AcApMeasureAngleCmd.d.ts.map +0 -1
  433. package/lib/command/AcApMeasureAngleCmd.js.map +0 -1
  434. package/lib/command/AcApMeasureArcCmd.d.ts.map +0 -1
  435. package/lib/command/AcApMeasureArcCmd.js.map +0 -1
  436. package/lib/command/AcApMeasureAreaCmd.d.ts.map +0 -1
  437. package/lib/command/AcApMeasureAreaCmd.js.map +0 -1
  438. package/lib/command/AcApMeasureDistanceCmd.d.ts.map +0 -1
  439. package/lib/command/AcApMeasureDistanceCmd.js.map +0 -1
  440. package/lib/command/AcApMoveCmd.d.ts.map +0 -1
  441. package/lib/command/AcApMoveCmd.js.map +0 -1
  442. package/lib/command/AcApPngConvertor.d.ts.map +0 -1
  443. package/lib/command/AcApPngConvertor.js.map +0 -1
  444. package/lib/command/AcApPolygonCmd.d.ts.map +0 -1
  445. package/lib/command/AcApPolygonCmd.js.map +0 -1
  446. package/lib/command/AcApPolylineCmd.d.ts.map +0 -1
  447. package/lib/command/AcApPolylineCmd.js.map +0 -1
  448. package/lib/command/AcApRectCmd.d.ts.map +0 -1
  449. package/lib/command/AcApRectCmd.js.map +0 -1
  450. package/lib/command/AcApRevCircleCmd.d.ts.map +0 -1
  451. package/lib/command/AcApRevCircleCmd.js.map +0 -1
  452. package/lib/command/AcApRevCloudCmd.d.ts.map +0 -1
  453. package/lib/command/AcApRevCloudCmd.js.map +0 -1
  454. package/lib/command/AcApRevRectCmd.d.ts.map +0 -1
  455. package/lib/command/AcApRevRectCmd.js.map +0 -1
  456. package/lib/command/AcApRevVisibilityCmd.d.ts.map +0 -1
  457. package/lib/command/AcApRevVisibilityCmd.js.map +0 -1
  458. package/lib/command/AcApSketchCmd.d.ts.map +0 -1
  459. package/lib/command/AcApSketchCmd.js.map +0 -1
  460. package/lib/command/AcApSplineCmd.d.ts.map +0 -1
  461. package/lib/command/AcApSplineCmd.js.map +0 -1
  462. package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
  463. package/lib/command/AcApSvgConvertor.js.map +0 -1
  464. /package/lib/command/{AcApDxfConvertor.d.ts → convert/AcApDxfConvertor.d.ts} +0 -0
  465. /package/lib/command/{AcApSvgConvertor.d.ts → convert/AcApSvgConvertor.d.ts} +0 -0
@@ -49,12 +49,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import { AcDbArc, AcGePoint3d } from '@mlightcad/data-model';
53
- import { AcApDocManager } from '../app';
54
- import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptDistanceOptions, AcEdPromptDoubleOptions, AcEdPromptPointOptions, AcEdPromptStatus, eventBus } from '../editor';
55
- import { AcApI18n } from '../i18n';
56
- var TAU = Math.PI * 2;
57
- var EPSILON = 1e-9;
52
+ import { AcDbArc, AcGePoint3d, AcGeTol, FLOAT_TOL, TAU } from '@mlightcad/data-model';
53
+ import { AcApDocManager } from '../../app';
54
+ import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptAngleOptions, AcEdPromptDistanceOptions, AcEdPromptDoubleOptions, AcEdPromptPointOptions, AcEdPromptStatus, eventBus } from '../../editor';
55
+ import { AcApI18n } from '../../i18n';
58
56
  var POSITIVE_NORMAL = { x: 0, y: 0, z: 1 };
59
57
  var NEGATIVE_NORMAL = { x: 0, y: 0, z: -1 };
60
58
  /**
@@ -77,10 +75,20 @@ function normalizeAngle(angle) {
77
75
  function distance2d(p1, p2) {
78
76
  return Math.hypot(p2.x - p1.x, p2.y - p1.y);
79
77
  }
78
+ /**
79
+ * Computes the absolute direction angle from one point to another in degrees.
80
+ *
81
+ * @param from - Origin point.
82
+ * @param to - Target point.
83
+ * @returns Direction angle in degrees.
84
+ */
85
+ function directionAngleDeg(from, to) {
86
+ return (Math.atan2(to.y - from.y, to.x - from.x) * 180) / Math.PI;
87
+ }
80
88
  /**
81
89
  * Computes point angle around a center under a given arc orientation.
82
90
  *
83
- * For `normalSign = -1` (clockwise), the Y component is mirrored so that
91
+ * For `normalSign = -1` (clockwise), the X component is mirrored so that
84
92
  * angle growth still follows the selected arc direction convention.
85
93
  *
86
94
  * @param center - Arc center.
@@ -89,10 +97,11 @@ function distance2d(p1, p2) {
89
97
  * @returns Direction-aware normalized angle in radians.
90
98
  */
91
99
  function angleByNormalSign(center, point, normalSign) {
92
- // For -Z arcs, mirror Y so the angle still increases in the arc direction.
100
+ // AcDbArc stores start/end in OCS. For a -Z extrusion, data-model chooses
101
+ // OCS X = -WCS X and OCS Y = WCS Y, so mirror X rather than Y.
93
102
  var dx = point.x - center.x;
94
103
  var dy = point.y - center.y;
95
- var raw = normalSign === 1 ? Math.atan2(dy, dx) : Math.atan2(-dy, dx);
104
+ var raw = normalSign === 1 ? Math.atan2(dy, dx) : Math.atan2(dy, -dx);
96
105
  return normalizeAngle(raw);
97
106
  }
98
107
  /**
@@ -104,6 +113,9 @@ function angleByNormalSign(center, point, normalSign) {
104
113
  function toNormal(sign) {
105
114
  return sign === 1 ? POSITIVE_NORMAL : NEGATIVE_NORMAL;
106
115
  }
116
+ function normalSignOf(entity) {
117
+ return entity.normal.z >= 0 ? 1 : -1;
118
+ }
107
119
  /**
108
120
  * Creates one `AcDbArc` entity from normalized arc definition data.
109
121
  *
@@ -156,7 +168,7 @@ function projectPointToCircle(center, radius, point) {
156
168
  var dx = point.x - center.x;
157
169
  var dy = point.y - center.y;
158
170
  var distance = Math.hypot(dx, dy);
159
- if (distance <= EPSILON)
171
+ if (AcGeTol.isNonPositive(distance))
160
172
  return undefined;
161
173
  var scale = radius / distance;
162
174
  return {
@@ -230,7 +242,7 @@ function createArcFromThreePoints(start, second, end, reverseDirection) {
230
242
  var x3 = end.x;
231
243
  var y3 = end.y;
232
244
  var d = 2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
233
- if (Math.abs(d) <= EPSILON)
245
+ if (AcGeTol.equalToZero(d))
234
246
  return undefined;
235
247
  var ux = ((x1 * x1 + y1 * y1) * (y2 - y3) +
236
248
  (x2 * x2 + y2 * y2) * (y3 - y1) +
@@ -242,7 +254,7 @@ function createArcFromThreePoints(start, second, end, reverseDirection) {
242
254
  d;
243
255
  var center = { x: ux, y: uy, z: 0 };
244
256
  var radius = distance2d(center, start);
245
- if (!Number.isFinite(radius) || radius <= EPSILON)
257
+ if (!Number.isFinite(radius) || AcGeTol.isNonPositive(radius))
246
258
  return undefined;
247
259
  // By default, choose the arc that actually passes through the second point.
248
260
  // Ctrl toggle can reverse this selection to the complementary direction.
@@ -270,11 +282,11 @@ function createArcFromThreePoints(start, second, end, reverseDirection) {
270
282
  function createArcFromCenterStartEnd(center, start, end, normalSign) {
271
283
  var radiusFromStart = distance2d(center, start);
272
284
  var radiusFromEnd = distance2d(center, end);
273
- if (radiusFromStart <= EPSILON || radiusFromEnd <= EPSILON) {
285
+ if (AcGeTol.isNonPositive(radiusFromStart) || AcGeTol.isNonPositive(radiusFromEnd)) {
274
286
  return undefined;
275
287
  }
276
288
  // Start/end must lie on the same circle (small tolerance for picked input).
277
- var tolerance = Math.max(EPSILON, radiusFromStart * 1e-6);
289
+ var tolerance = Math.max(FLOAT_TOL, radiusFromStart * FLOAT_TOL);
278
290
  if (Math.abs(radiusFromStart - radiusFromEnd) > tolerance) {
279
291
  return undefined;
280
292
  }
@@ -300,7 +312,7 @@ function createArcFromCenterStartEnd(center, start, end, normalSign) {
300
312
  */
301
313
  function createArcFromCenterStartProjectedEnd(center, start, rawEnd, normalSign) {
302
314
  var radius = distance2d(center, start);
303
- if (radius <= EPSILON)
315
+ if (AcGeTol.isNonPositive(radius))
304
316
  return undefined;
305
317
  var end = projectPointToCircle(center, radius, rawEnd);
306
318
  if (!end)
@@ -320,7 +332,9 @@ function createArcFromCenterStartProjectedEnd(center, start, rawEnd, normalSign)
320
332
  function createArcFromCenterStartSweep(center, start, sweepRad) {
321
333
  var radius = distance2d(center, start);
322
334
  var sweep = Math.abs(sweepRad);
323
- if (radius <= EPSILON || sweep <= EPSILON || sweep >= TAU - EPSILON) {
335
+ if (AcGeTol.isNonPositive(radius) ||
336
+ AcGeTol.isNonPositive(sweep) ||
337
+ !AcGeTol.great(TAU - sweep, 0)) {
324
338
  return undefined;
325
339
  }
326
340
  var normalSign = sweepRad >= 0 ? 1 : -1;
@@ -347,7 +361,9 @@ function createArcFromCenterStartSweep(center, start, sweepRad) {
347
361
  function createArcFromCenterStartChord(center, start, chordLength) {
348
362
  var radius = distance2d(center, start);
349
363
  var chord = Math.abs(chordLength);
350
- if (radius <= EPSILON || chord <= EPSILON || chord > 2 * radius + EPSILON) {
364
+ if (AcGeTol.isNonPositive(radius) ||
365
+ AcGeTol.isNonPositive(chord) ||
366
+ AcGeTol.great(chord, 2 * radius)) {
351
367
  return undefined;
352
368
  }
353
369
  var ratio = Math.max(-1, Math.min(1, chord / (2 * radius)));
@@ -366,16 +382,18 @@ function createArcFromCenterStartChord(center, start, chordLength) {
366
382
  function createArcFromStartEndAngle(start, end, sweepRad) {
367
383
  var chord = distance2d(start, end);
368
384
  var sweep = Math.abs(sweepRad);
369
- if (chord <= EPSILON || sweep <= EPSILON || sweep >= TAU - EPSILON) {
385
+ if (AcGeTol.isNonPositive(chord) ||
386
+ AcGeTol.isNonPositive(sweep) ||
387
+ !AcGeTol.great(TAU - sweep, 0)) {
370
388
  return undefined;
371
389
  }
372
390
  // chord = 2 * r * sin(theta/2) -> r = chord / (2 * sin(theta/2))
373
391
  var sinHalf = Math.sin(sweep / 2);
374
- if (Math.abs(sinHalf) <= EPSILON)
392
+ if (AcGeTol.equalToZero(sinHalf))
375
393
  return undefined;
376
394
  var radius = chord / (2 * sinHalf);
377
395
  var offsetSquared = radius * radius - (chord * chord) / 4;
378
- if (offsetSquared < -EPSILON)
396
+ if (AcGeTol.less(offsetSquared, 0))
379
397
  return undefined;
380
398
  var offset = Math.sqrt(Math.max(0, offsetSquared));
381
399
  var midX = (start.x + end.x) / 2;
@@ -416,7 +434,7 @@ function createArcFromStartEndDirection(start, end, directionRad) {
416
434
  var nx = -ty;
417
435
  var ny = tx;
418
436
  var denominator = 2 * (dx * nx + dy * ny);
419
- if (Math.abs(denominator) <= EPSILON)
437
+ if (AcGeTol.equalToZero(denominator))
420
438
  return undefined;
421
439
  // Solve center = start + lambda * n so that |center-start| = |center-end|.
422
440
  var lambda = (dx * dx + dy * dy) / denominator;
@@ -430,7 +448,7 @@ function createArcFromStartEndDirection(start, end, directionRad) {
430
448
  var radiusVectorX = start.x - center.x;
431
449
  var radiusVectorY = start.y - center.y;
432
450
  var cross = radiusVectorX * ty - radiusVectorY * tx;
433
- if (Math.abs(cross) <= EPSILON)
451
+ if (AcGeTol.equalToZero(cross))
434
452
  return undefined;
435
453
  var normalSign = cross >= 0 ? 1 : -1;
436
454
  return createArcFromCenterStartEnd(center, start, end, normalSign);
@@ -448,7 +466,9 @@ function createArcFromStartEndDirection(start, end, directionRad) {
448
466
  function createArcFromStartEndRadius(start, end, radiusInput) {
449
467
  var radius = Math.abs(radiusInput);
450
468
  var chord = distance2d(start, end);
451
- if (radius <= EPSILON || chord <= EPSILON || chord > 2 * radius + EPSILON) {
469
+ if (AcGeTol.isNonPositive(radius) ||
470
+ AcGeTol.isNonPositive(chord) ||
471
+ AcGeTol.great(chord, 2 * radius)) {
452
472
  return undefined;
453
473
  }
454
474
  var midX = (start.x + end.x) / 2;
@@ -510,10 +530,113 @@ var AcApArcJig = /** @class */ (function (_super) {
510
530
  var definition = this._builder(point);
511
531
  if (!definition)
512
532
  return;
533
+ if (definition.normalSign !== normalSignOf(this._arc)) {
534
+ this.end();
535
+ this._arc = createArcEntity(definition);
536
+ return;
537
+ }
513
538
  applyArcDefinition(this._arc, definition);
514
539
  };
515
540
  return AcApArcJig;
516
541
  }(AcEdPreviewJig));
542
+ /**
543
+ * Numeric preview jig for ARC command.
544
+ *
545
+ * This jig is used by angle, chord-length, and radius prompts where the user
546
+ * is no longer selecting a point directly, but we still want the transient arc
547
+ * to update from the current numeric value.
548
+ *
549
+ * @typeParam T - Numeric prompt value type that drives the preview.
550
+ */
551
+ var AcApArcValueJig = /** @class */ (function (_super) {
552
+ __extends(AcApArcValueJig, _super);
553
+ /**
554
+ * Creates a numeric preview jig.
555
+ *
556
+ * @param view - Active editor view.
557
+ * @param builder - Prompt-value-to-arc definition resolver.
558
+ * @param fallback - Initial valid fallback definition.
559
+ */
560
+ function AcApArcValueJig(view, builder, fallback) {
561
+ var _this = _super.call(this, view) || this;
562
+ _this._builder = builder;
563
+ _this._arc = createArcEntity(fallback);
564
+ return _this;
565
+ }
566
+ Object.defineProperty(AcApArcValueJig.prototype, "entity", {
567
+ /**
568
+ * Gets transient arc entity.
569
+ */
570
+ get: function () {
571
+ return this._arc;
572
+ },
573
+ enumerable: false,
574
+ configurable: true
575
+ });
576
+ /**
577
+ * Updates transient arc for the current numeric input value.
578
+ *
579
+ * @param value - Current prompt value.
580
+ */
581
+ AcApArcValueJig.prototype.update = function (value) {
582
+ var definition = this._builder(value);
583
+ if (!definition)
584
+ return;
585
+ if (definition.normalSign !== normalSignOf(this._arc)) {
586
+ this.end();
587
+ this._arc = createArcEntity(definition);
588
+ return;
589
+ }
590
+ applyArcDefinition(this._arc, definition);
591
+ };
592
+ return AcApArcValueJig;
593
+ }(AcEdPreviewJig));
594
+ /**
595
+ * Normalized scripted ARC entry tokens mapped to an internal entry mode.
596
+ *
597
+ * Tokens are normalized by lowercasing and stripping non-alphanumeric
598
+ * characters before lookup. This lets the command accept a few equivalent
599
+ * spellings for the same branch, for example:
600
+ * - documentation-style phrases such as `Start Center End`
601
+ * - compact aliases such as `SCE`
602
+ * - historical shorthand such as `3P`
603
+ *
604
+ * The table is intentionally centralized so supported scripted spellings remain
605
+ * easy to audit and extend without touching the main execution logic.
606
+ */
607
+ var ARC_ENTRY_MODE_BY_TOKEN = {
608
+ '3p': 'threePoint',
609
+ '3point': 'threePoint',
610
+ threepoint: 'threePoint',
611
+ startcenter: 'startCenter',
612
+ sc: 'startCenter',
613
+ startcenterend: 'startCenterEnd',
614
+ sce: 'startCenterEnd',
615
+ startcenterangle: 'startCenterAngle',
616
+ sca: 'startCenterAngle',
617
+ startcenterlength: 'startCenterLength',
618
+ startcenterchordlength: 'startCenterLength',
619
+ scl: 'startCenterLength',
620
+ startend: 'startEnd',
621
+ se: 'startEnd',
622
+ startendangle: 'startEndAngle',
623
+ sea: 'startEndAngle',
624
+ startenddirection: 'startEndDirection',
625
+ sed: 'startEndDirection',
626
+ startendradius: 'startEndRadius',
627
+ ser: 'startEndRadius',
628
+ center: 'centerStart',
629
+ c: 'centerStart',
630
+ centerstart: 'centerStart',
631
+ cs: 'centerStart',
632
+ centerstartend: 'centerStartEnd',
633
+ cse: 'centerStartEnd',
634
+ centerstartangle: 'centerStartAngle',
635
+ csa: 'centerStartAngle',
636
+ centerstartlength: 'centerStartLength',
637
+ centerstartchordlength: 'centerStartLength',
638
+ csl: 'centerStartLength'
639
+ };
517
640
  /**
518
641
  * Command to create one arc.
519
642
  *
@@ -542,35 +665,162 @@ var AcApArcCmd = /** @class */ (function (_super) {
542
665
  */
543
666
  AcApArcCmd.prototype.execute = function (context) {
544
667
  return __awaiter(this, void 0, void 0, function () {
545
- var prompt, result;
668
+ var entryMode, prompt, result;
546
669
  return __generator(this, function (_a) {
547
670
  switch (_a.label) {
548
671
  case 0:
549
672
  // Keep ARC behavior deterministic for each run (same as PLINE flow).
550
673
  AcApDocManager.instance.editor.resetInputToggles();
674
+ entryMode = this.consumeEntryMode();
675
+ if (!(entryMode !== 'default')) return [3 /*break*/, 2];
676
+ return [4 /*yield*/, this.executeEntryMode(context, entryMode)];
677
+ case 1:
678
+ _a.sent();
679
+ return [2 /*return*/];
680
+ case 2:
551
681
  prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.startPointOrCenter'));
552
682
  this.addKeyword(prompt, 'center');
553
683
  return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
554
- case 1:
684
+ case 3:
555
685
  result = _a.sent();
556
- if (!(result.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 4];
557
- if (!(result.stringResult === 'Center')) return [3 /*break*/, 3];
686
+ if (!(result.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 6];
687
+ if (!(result.stringResult === 'Center')) return [3 /*break*/, 5];
558
688
  return [4 /*yield*/, this.runCenterStartFlow(context)];
559
- case 2:
560
- _a.sent();
561
- _a.label = 3;
562
- case 3: return [2 /*return*/];
563
689
  case 4:
690
+ _a.sent();
691
+ _a.label = 5;
692
+ case 5: return [2 /*return*/];
693
+ case 6:
564
694
  if (result.status !== AcEdPromptStatus.OK)
565
695
  return [2 /*return*/];
566
696
  return [4 /*yield*/, this.runStartFlow(context, result.value)];
567
- case 5:
697
+ case 7:
568
698
  _a.sent();
569
699
  return [2 /*return*/];
570
700
  }
571
701
  });
572
702
  });
573
703
  };
704
+ /**
705
+ * Executes one preselected ARC branch.
706
+ *
707
+ * This method is used only when a scripted caller queued an entry token
708
+ * before invoking `ARC`. Instead of starting at the standard root prompt, the
709
+ * command jumps directly into the requested option family so the user still
710
+ * interacts with a single `ARC` command while shortcuts can open a more
711
+ * specific workflow.
712
+ *
713
+ * @param context - Current app context.
714
+ * @param entryMode - Resolved scripted branch to execute.
715
+ */
716
+ AcApArcCmd.prototype.executeEntryMode = function (context, entryMode) {
717
+ return __awaiter(this, void 0, void 0, function () {
718
+ var _a;
719
+ return __generator(this, function (_b) {
720
+ switch (_b.label) {
721
+ case 0:
722
+ _a = entryMode;
723
+ switch (_a) {
724
+ case 'threePoint': return [3 /*break*/, 1];
725
+ case 'startCenter': return [3 /*break*/, 3];
726
+ case 'startCenterEnd': return [3 /*break*/, 5];
727
+ case 'startCenterAngle': return [3 /*break*/, 7];
728
+ case 'startCenterLength': return [3 /*break*/, 9];
729
+ case 'startEnd': return [3 /*break*/, 11];
730
+ case 'startEndAngle': return [3 /*break*/, 13];
731
+ case 'startEndDirection': return [3 /*break*/, 15];
732
+ case 'startEndRadius': return [3 /*break*/, 17];
733
+ case 'centerStart': return [3 /*break*/, 19];
734
+ case 'centerStartEnd': return [3 /*break*/, 21];
735
+ case 'centerStartAngle': return [3 /*break*/, 23];
736
+ case 'centerStartLength': return [3 /*break*/, 25];
737
+ }
738
+ return [3 /*break*/, 27];
739
+ case 1: return [4 /*yield*/, this.runExactThreePointFlow(context)];
740
+ case 2:
741
+ _b.sent();
742
+ return [2 /*return*/];
743
+ case 3: return [4 /*yield*/, this.runStartCenterFlowFromEntry(context)];
744
+ case 4:
745
+ _b.sent();
746
+ return [2 /*return*/];
747
+ case 5: return [4 /*yield*/, this.runExactStartCenterFlow(context, 'end')];
748
+ case 6:
749
+ _b.sent();
750
+ return [2 /*return*/];
751
+ case 7: return [4 /*yield*/, this.runExactStartCenterFlow(context, 'angle')];
752
+ case 8:
753
+ _b.sent();
754
+ return [2 /*return*/];
755
+ case 9: return [4 /*yield*/, this.runExactStartCenterFlow(context, 'chordLength')];
756
+ case 10:
757
+ _b.sent();
758
+ return [2 /*return*/];
759
+ case 11: return [4 /*yield*/, this.runStartEndFlowFromEntry(context)];
760
+ case 12:
761
+ _b.sent();
762
+ return [2 /*return*/];
763
+ case 13: return [4 /*yield*/, this.runExactStartEndFlow(context, 'angle')];
764
+ case 14:
765
+ _b.sent();
766
+ return [2 /*return*/];
767
+ case 15: return [4 /*yield*/, this.runExactStartEndFlow(context, 'direction')];
768
+ case 16:
769
+ _b.sent();
770
+ return [2 /*return*/];
771
+ case 17: return [4 /*yield*/, this.runExactStartEndFlow(context, 'radius')];
772
+ case 18:
773
+ _b.sent();
774
+ return [2 /*return*/];
775
+ case 19: return [4 /*yield*/, this.runCenterStartFlow(context)];
776
+ case 20:
777
+ _b.sent();
778
+ return [2 /*return*/];
779
+ case 21: return [4 /*yield*/, this.runExactCenterStartFlow(context, 'end')];
780
+ case 22:
781
+ _b.sent();
782
+ return [2 /*return*/];
783
+ case 23: return [4 /*yield*/, this.runExactCenterStartFlow(context, 'angle')];
784
+ case 24:
785
+ _b.sent();
786
+ return [2 /*return*/];
787
+ case 25: return [4 /*yield*/, this.runExactCenterStartFlow(context, 'chordLength')];
788
+ case 26:
789
+ _b.sent();
790
+ return [2 /*return*/];
791
+ case 27: return [2 /*return*/];
792
+ }
793
+ });
794
+ });
795
+ };
796
+ /**
797
+ * Consumes one optional scripted ARC entry token when present.
798
+ *
799
+ * This keeps `ARC` as a single command while still allowing ribbon shortcuts
800
+ * to preselect a specific option family or exact branch.
801
+ *
802
+ * The next queued scripted token is treated as an ARC entry selector only
803
+ * when it matches a known token in {@link ARC_ENTRY_MODE_BY_TOKEN}. Unknown
804
+ * input is left untouched so the ordinary command prompts can consume it as
805
+ * regular scripted input.
806
+ *
807
+ * @returns Resolved entry mode, or `'default'` when no special entry token is
808
+ * queued.
809
+ */
810
+ AcApArcCmd.prototype.consumeEntryMode = function () {
811
+ var token = AcApDocManager.instance.editor.peekScriptInput();
812
+ if (token == null)
813
+ return 'default';
814
+ var normalized = token
815
+ .trim()
816
+ .toLowerCase()
817
+ .replace(/[^a-z0-9]+/g, '');
818
+ var entryMode = ARC_ENTRY_MODE_BY_TOKEN[normalized];
819
+ if (!entryMode)
820
+ return 'default';
821
+ AcApDocManager.instance.editor.consumeScriptInput();
822
+ return entryMode;
823
+ };
574
824
  /**
575
825
  * Adds one localized keyword to a prompt options object.
576
826
  *
@@ -600,6 +850,557 @@ var AcApArcCmd = /** @class */ (function (_super) {
600
850
  type: 'warning'
601
851
  });
602
852
  };
853
+ /**
854
+ * Prompts one start point.
855
+ *
856
+ * This helper is shared by several scripted entry branches that need to begin
857
+ * directly at a known Start-point step instead of the normal ARC root prompt.
858
+ *
859
+ * @returns Selected start point, or `undefined` when the user cancels or the
860
+ * prompt does not complete successfully.
861
+ */
862
+ AcApArcCmd.prototype.promptStartPoint = function () {
863
+ return __awaiter(this, void 0, void 0, function () {
864
+ var prompt, result;
865
+ return __generator(this, function (_a) {
866
+ switch (_a.label) {
867
+ case 0:
868
+ prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.startPoint'));
869
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
870
+ case 1:
871
+ result = _a.sent();
872
+ return [2 /*return*/, result.status === AcEdPromptStatus.OK ? result.value : undefined];
873
+ }
874
+ });
875
+ });
876
+ };
877
+ /**
878
+ * Prompts one center point, optionally using a base point for feedback.
879
+ *
880
+ * When a base point is provided, the prompt mirrors the standard ARC UX by
881
+ * enabling dashed reference feedback from the previously chosen point.
882
+ *
883
+ * @param basePoint - Optional reference point.
884
+ * @returns Selected center point, or `undefined` when the prompt is aborted.
885
+ */
886
+ AcApArcCmd.prototype.promptCenterPoint = function (basePoint) {
887
+ return __awaiter(this, void 0, void 0, function () {
888
+ var prompt, result;
889
+ return __generator(this, function (_a) {
890
+ switch (_a.label) {
891
+ case 0:
892
+ prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.centerPoint'));
893
+ if (basePoint) {
894
+ prompt.useBasePoint = true;
895
+ prompt.useDashedLine = true;
896
+ prompt.basePoint = new AcGePoint3d(basePoint);
897
+ }
898
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
899
+ case 1:
900
+ result = _a.sent();
901
+ return [2 /*return*/, result.status === AcEdPromptStatus.OK ? result.value : undefined];
902
+ }
903
+ });
904
+ });
905
+ };
906
+ /**
907
+ * Prompts one end point, optionally using a base point for feedback.
908
+ *
909
+ * This helper is used by the scripted entry paths that need a plain End-point
910
+ * acquisition step before resuming the standard ARC family logic.
911
+ *
912
+ * @param basePoint - Optional reference point.
913
+ * @returns Selected end point, or `undefined` when the prompt is aborted.
914
+ */
915
+ AcApArcCmd.prototype.promptEndPoint = function (basePoint) {
916
+ return __awaiter(this, void 0, void 0, function () {
917
+ var prompt, result;
918
+ return __generator(this, function (_a) {
919
+ switch (_a.label) {
920
+ case 0:
921
+ prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.endPoint'));
922
+ if (basePoint) {
923
+ prompt.useBasePoint = true;
924
+ prompt.useDashedLine = true;
925
+ prompt.basePoint = new AcGePoint3d(basePoint);
926
+ }
927
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
928
+ case 1:
929
+ result = _a.sent();
930
+ return [2 /*return*/, result.status === AcEdPromptStatus.OK ? result.value : undefined];
931
+ }
932
+ });
933
+ });
934
+ };
935
+ /**
936
+ * Prompts the second point on the arc in the 3-point workflow.
937
+ *
938
+ * This is distinct from {@link promptEndPoint} because the 3-point ARC flow
939
+ * uses a different prompt message and semantic meaning: the second point lies
940
+ * somewhere on the arc, not necessarily at its final endpoint.
941
+ *
942
+ * @param start - Arc start point.
943
+ * @returns Selected second point, or `undefined` when the prompt is aborted.
944
+ */
945
+ AcApArcCmd.prototype.promptSecondPoint = function (start) {
946
+ return __awaiter(this, void 0, void 0, function () {
947
+ var prompt, result;
948
+ return __generator(this, function (_a) {
949
+ switch (_a.label) {
950
+ case 0:
951
+ prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.secondPoint'));
952
+ prompt.useBasePoint = true;
953
+ prompt.useDashedLine = true;
954
+ prompt.basePoint = new AcGePoint3d(start);
955
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
956
+ case 1:
957
+ result = _a.sent();
958
+ return [2 /*return*/, result.status === AcEdPromptStatus.OK ? result.value : undefined];
959
+ }
960
+ });
961
+ });
962
+ };
963
+ /**
964
+ * Runs the exact 3-point flow selected by a scripted entry token.
965
+ *
966
+ * This bypasses the ordinary ARC root prompt and immediately acquires the
967
+ * Start and Second points required for the 3-point construction, then reuses
968
+ * the existing shared finalization logic.
969
+ *
970
+ * @param context - Current app context.
971
+ */
972
+ AcApArcCmd.prototype.runExactThreePointFlow = function (context) {
973
+ return __awaiter(this, void 0, void 0, function () {
974
+ var start, second;
975
+ return __generator(this, function (_a) {
976
+ switch (_a.label) {
977
+ case 0: return [4 /*yield*/, this.promptStartPoint()];
978
+ case 1:
979
+ start = _a.sent();
980
+ if (!start)
981
+ return [2 /*return*/];
982
+ return [4 /*yield*/, this.promptSecondPoint(start)];
983
+ case 2:
984
+ second = _a.sent();
985
+ if (!second)
986
+ return [2 /*return*/];
987
+ return [4 /*yield*/, this.finishThreePointArc(context, start, second)];
988
+ case 3:
989
+ _a.sent();
990
+ return [2 /*return*/];
991
+ }
992
+ });
993
+ });
994
+ };
995
+ /**
996
+ * Runs the Start-Center option family from an explicit entry token.
997
+ *
998
+ * This mode corresponds to the AutoCAD-style branch where the command is
999
+ * already committed to the Start/Center family, but the final sub-option
1000
+ * (End, Angle, or Chord Length) is still chosen interactively.
1001
+ *
1002
+ * @param context - Current app context.
1003
+ */
1004
+ AcApArcCmd.prototype.runStartCenterFlowFromEntry = function (context) {
1005
+ return __awaiter(this, void 0, void 0, function () {
1006
+ var start;
1007
+ return __generator(this, function (_a) {
1008
+ switch (_a.label) {
1009
+ case 0: return [4 /*yield*/, this.promptStartPoint()];
1010
+ case 1:
1011
+ start = _a.sent();
1012
+ if (!start)
1013
+ return [2 /*return*/];
1014
+ return [4 /*yield*/, this.runStartCenterFlow(context, start)];
1015
+ case 2:
1016
+ _a.sent();
1017
+ return [2 /*return*/];
1018
+ }
1019
+ });
1020
+ });
1021
+ };
1022
+ /**
1023
+ * Runs one exact Start-Center-* flow selected by a scripted entry token.
1024
+ *
1025
+ * Unlike {@link runStartCenterFlowFromEntry}, this method locks both the
1026
+ * option family and the terminal construction variant up front. It is used by
1027
+ * ribbon dropdown items that represent a fully specified ARC recipe.
1028
+ *
1029
+ * @param context - Current app context.
1030
+ * @param variant - Terminal Start-Center variant to execute after Start and
1031
+ * Center are collected.
1032
+ */
1033
+ AcApArcCmd.prototype.runExactStartCenterFlow = function (context, variant) {
1034
+ return __awaiter(this, void 0, void 0, function () {
1035
+ var start, center, anglePrompt, angleResult, angle, arc_1, chordPrompt, chordResult, chordLength, arc;
1036
+ var _this = this;
1037
+ return __generator(this, function (_a) {
1038
+ switch (_a.label) {
1039
+ case 0: return [4 /*yield*/, this.promptStartPoint()];
1040
+ case 1:
1041
+ start = _a.sent();
1042
+ if (!start)
1043
+ return [2 /*return*/];
1044
+ return [4 /*yield*/, this.promptCenterPoint(start)];
1045
+ case 2:
1046
+ center = _a.sent();
1047
+ if (!center)
1048
+ return [2 /*return*/];
1049
+ if (!(variant === 'end')) return [3 /*break*/, 4];
1050
+ return [4 /*yield*/, this.finishExactCenterStartEnd(context, center, start)];
1051
+ case 3:
1052
+ _a.sent();
1053
+ return [2 /*return*/];
1054
+ case 4:
1055
+ if (!(variant === 'angle')) return [3 /*break*/, 6];
1056
+ anglePrompt = new AcEdPromptAngleOptions(AcApI18n.t('jig.arc.includedAngle'));
1057
+ anglePrompt.allowNegative = true;
1058
+ anglePrompt.allowZero = false;
1059
+ anglePrompt.useBasePoint = true;
1060
+ anglePrompt.useDashedLine = true;
1061
+ anglePrompt.basePoint = new AcGePoint3d(center);
1062
+ anglePrompt.baseAngle = directionAngleDeg(center, start);
1063
+ anglePrompt.jig = new AcApArcValueJig(context.view, function (degreeValue) {
1064
+ return createArcFromCenterStartSweep(center, start, _this.applyCtrlDirectionValue(_this.degToRad(degreeValue)));
1065
+ }, createFallbackArc(start));
1066
+ return [4 /*yield*/, AcApDocManager.instance.editor.getAngle(anglePrompt)];
1067
+ case 5:
1068
+ angleResult = _a.sent();
1069
+ angle = angleResult.status === AcEdPromptStatus.OK
1070
+ ? angleResult.value
1071
+ : undefined;
1072
+ if (angle == null)
1073
+ return [2 /*return*/];
1074
+ arc_1 = createArcFromCenterStartSweep(center, start, this.applyCtrlDirectionValue(this.degToRad(angle)));
1075
+ if (arc_1) {
1076
+ this.appendArc(context, arc_1);
1077
+ }
1078
+ else {
1079
+ this.warnInvalidGeometry('angle');
1080
+ }
1081
+ return [2 /*return*/];
1082
+ case 6:
1083
+ chordPrompt = new AcEdPromptDistanceOptions(AcApI18n.t('jig.arc.chordLength'));
1084
+ chordPrompt.allowNegative = true;
1085
+ chordPrompt.allowZero = false;
1086
+ chordPrompt.useBasePoint = true;
1087
+ chordPrompt.useDashedLine = true;
1088
+ chordPrompt.basePoint = new AcGePoint3d(start);
1089
+ chordPrompt.jig = new AcApArcValueJig(context.view, function (chordValue) {
1090
+ return createArcFromCenterStartChord(center, start, _this.applyCtrlDirectionValue(chordValue));
1091
+ }, createFallbackArc(start));
1092
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDistance(chordPrompt)];
1093
+ case 7:
1094
+ chordResult = _a.sent();
1095
+ chordLength = chordResult.status === AcEdPromptStatus.OK ? chordResult.value : undefined;
1096
+ if (chordLength == null)
1097
+ return [2 /*return*/];
1098
+ arc = createArcFromCenterStartChord(center, start, this.applyCtrlDirectionValue(chordLength));
1099
+ if (arc) {
1100
+ this.appendArc(context, arc);
1101
+ }
1102
+ else {
1103
+ this.warnInvalidGeometry('chordLength');
1104
+ }
1105
+ return [2 /*return*/];
1106
+ }
1107
+ });
1108
+ });
1109
+ };
1110
+ /**
1111
+ * Runs one exact Center-Start-* flow selected by a scripted entry token.
1112
+ *
1113
+ * This mirrors {@link runExactStartCenterFlow} for the Center-first ARC
1114
+ * family, allowing a shortcut to bypass the default root prompt and enter one
1115
+ * fully specified Center/Start branch directly.
1116
+ *
1117
+ * @param context - Current app context.
1118
+ * @param variant - Terminal Center-Start variant to execute after Center and
1119
+ * Start are collected.
1120
+ */
1121
+ AcApArcCmd.prototype.runExactCenterStartFlow = function (context, variant) {
1122
+ return __awaiter(this, void 0, void 0, function () {
1123
+ var center, start, anglePrompt, angleResult, angle, arc_2, chordPrompt, chordResult, chordLength, arc;
1124
+ var _this = this;
1125
+ return __generator(this, function (_a) {
1126
+ switch (_a.label) {
1127
+ case 0: return [4 /*yield*/, this.promptCenterPoint()];
1128
+ case 1:
1129
+ center = _a.sent();
1130
+ if (!center)
1131
+ return [2 /*return*/];
1132
+ return [4 /*yield*/, this.promptStartPointFromCenter(center)];
1133
+ case 2:
1134
+ start = _a.sent();
1135
+ if (!start)
1136
+ return [2 /*return*/];
1137
+ if (!(variant === 'end')) return [3 /*break*/, 4];
1138
+ return [4 /*yield*/, this.finishExactCenterStartEnd(context, center, start)];
1139
+ case 3:
1140
+ _a.sent();
1141
+ return [2 /*return*/];
1142
+ case 4:
1143
+ if (!(variant === 'angle')) return [3 /*break*/, 6];
1144
+ anglePrompt = new AcEdPromptAngleOptions(AcApI18n.t('jig.arc.includedAngle'));
1145
+ anglePrompt.allowNegative = true;
1146
+ anglePrompt.allowZero = false;
1147
+ anglePrompt.useBasePoint = true;
1148
+ anglePrompt.useDashedLine = true;
1149
+ anglePrompt.basePoint = new AcGePoint3d(center);
1150
+ anglePrompt.baseAngle = directionAngleDeg(center, start);
1151
+ anglePrompt.jig = new AcApArcValueJig(context.view, function (degreeValue) {
1152
+ return createArcFromCenterStartSweep(center, start, _this.applyCtrlDirectionValue(_this.degToRad(degreeValue)));
1153
+ }, createFallbackArc(start));
1154
+ return [4 /*yield*/, AcApDocManager.instance.editor.getAngle(anglePrompt)];
1155
+ case 5:
1156
+ angleResult = _a.sent();
1157
+ angle = angleResult.status === AcEdPromptStatus.OK
1158
+ ? angleResult.value
1159
+ : undefined;
1160
+ if (angle == null)
1161
+ return [2 /*return*/];
1162
+ arc_2 = createArcFromCenterStartSweep(center, start, this.applyCtrlDirectionValue(this.degToRad(angle)));
1163
+ if (arc_2) {
1164
+ this.appendArc(context, arc_2);
1165
+ }
1166
+ else {
1167
+ this.warnInvalidGeometry('angle');
1168
+ }
1169
+ return [2 /*return*/];
1170
+ case 6:
1171
+ chordPrompt = new AcEdPromptDistanceOptions(AcApI18n.t('jig.arc.chordLength'));
1172
+ chordPrompt.allowNegative = true;
1173
+ chordPrompt.allowZero = false;
1174
+ chordPrompt.useBasePoint = true;
1175
+ chordPrompt.useDashedLine = true;
1176
+ chordPrompt.basePoint = new AcGePoint3d(start);
1177
+ chordPrompt.jig = new AcApArcValueJig(context.view, function (chordValue) {
1178
+ return createArcFromCenterStartChord(center, start, _this.applyCtrlDirectionValue(chordValue));
1179
+ }, createFallbackArc(start));
1180
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDistance(chordPrompt)];
1181
+ case 7:
1182
+ chordResult = _a.sent();
1183
+ chordLength = chordResult.status === AcEdPromptStatus.OK ? chordResult.value : undefined;
1184
+ if (chordLength == null)
1185
+ return [2 /*return*/];
1186
+ arc = createArcFromCenterStartChord(center, start, this.applyCtrlDirectionValue(chordLength));
1187
+ if (arc) {
1188
+ this.appendArc(context, arc);
1189
+ }
1190
+ else {
1191
+ this.warnInvalidGeometry('chordLength');
1192
+ }
1193
+ return [2 /*return*/];
1194
+ }
1195
+ });
1196
+ });
1197
+ };
1198
+ /**
1199
+ * Runs one exact Start-End-* flow selected by a scripted entry token.
1200
+ *
1201
+ * This path is used when a shortcut already knows that the Start-End family
1202
+ * should be used and only needs the command to perform the exact terminal
1203
+ * construction indicated by `variant`.
1204
+ *
1205
+ * @param context - Current app context.
1206
+ * @param variant - Terminal Start-End variant to execute after Start and End
1207
+ * are collected.
1208
+ */
1209
+ AcApArcCmd.prototype.runExactStartEndFlow = function (context, variant) {
1210
+ return __awaiter(this, void 0, void 0, function () {
1211
+ var start, end, anglePrompt, angleResult, angle, arc_3, directionPrompt, directionResult, directionPoint, direction, arc_4, radiusPrompt, radiusResult, radius, arc;
1212
+ var _this = this;
1213
+ return __generator(this, function (_a) {
1214
+ switch (_a.label) {
1215
+ case 0: return [4 /*yield*/, this.promptStartPoint()];
1216
+ case 1:
1217
+ start = _a.sent();
1218
+ if (!start)
1219
+ return [2 /*return*/];
1220
+ return [4 /*yield*/, this.promptEndPoint(start)];
1221
+ case 2:
1222
+ end = _a.sent();
1223
+ if (!end)
1224
+ return [2 /*return*/];
1225
+ if (!(variant === 'angle')) return [3 /*break*/, 4];
1226
+ anglePrompt = new AcEdPromptAngleOptions(AcApI18n.t('jig.arc.includedAngle'));
1227
+ anglePrompt.allowNegative = true;
1228
+ anglePrompt.allowZero = false;
1229
+ anglePrompt.useBasePoint = true;
1230
+ anglePrompt.useDashedLine = true;
1231
+ anglePrompt.basePoint = new AcGePoint3d(start);
1232
+ anglePrompt.baseAngle = directionAngleDeg(start, end);
1233
+ anglePrompt.jig = new AcApArcValueJig(context.view, function (degreeValue) {
1234
+ return createArcFromStartEndAngle(start, end, _this.applyCtrlDirectionValue(_this.degToRad(degreeValue)));
1235
+ }, createFallbackArc(start));
1236
+ return [4 /*yield*/, AcApDocManager.instance.editor.getAngle(anglePrompt)];
1237
+ case 3:
1238
+ angleResult = _a.sent();
1239
+ angle = angleResult.status === AcEdPromptStatus.OK
1240
+ ? angleResult.value
1241
+ : undefined;
1242
+ if (angle == null)
1243
+ return [2 /*return*/];
1244
+ arc_3 = createArcFromStartEndAngle(start, end, this.applyCtrlDirectionValue(this.degToRad(angle)));
1245
+ if (arc_3) {
1246
+ this.appendArc(context, arc_3);
1247
+ }
1248
+ else {
1249
+ this.warnInvalidGeometry('angle');
1250
+ }
1251
+ return [2 /*return*/];
1252
+ case 4:
1253
+ if (!(variant === 'direction')) return [3 /*break*/, 6];
1254
+ directionPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.tangentDirection'));
1255
+ directionPrompt.useBasePoint = true;
1256
+ directionPrompt.useDashedLine = true;
1257
+ directionPrompt.basePoint = new AcGePoint3d(start);
1258
+ directionPrompt.jig = new AcApArcJig(context.view, function (point) {
1259
+ return createArcFromStartEndDirection(start, end, Math.atan2(point.y - start.y, point.x - start.x));
1260
+ }, createFallbackArc(start));
1261
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(directionPrompt)];
1262
+ case 5:
1263
+ directionResult = _a.sent();
1264
+ directionPoint = directionResult.status === AcEdPromptStatus.OK
1265
+ ? directionResult.value
1266
+ : undefined;
1267
+ if (!directionPoint)
1268
+ return [2 /*return*/];
1269
+ direction = Math.atan2(directionPoint.y - start.y, directionPoint.x - start.x);
1270
+ arc_4 = createArcFromStartEndDirection(start, end, direction);
1271
+ if (arc_4) {
1272
+ this.appendArc(context, arc_4);
1273
+ }
1274
+ else {
1275
+ this.warnInvalidGeometry('direction');
1276
+ }
1277
+ return [2 /*return*/];
1278
+ case 6:
1279
+ radiusPrompt = new AcEdPromptDistanceOptions(AcApI18n.t('jig.arc.radius'));
1280
+ radiusPrompt.allowNegative = true;
1281
+ radiusPrompt.allowZero = false;
1282
+ radiusPrompt.useBasePoint = true;
1283
+ radiusPrompt.useDashedLine = true;
1284
+ radiusPrompt.basePoint = new AcGePoint3d(start);
1285
+ radiusPrompt.jig = new AcApArcValueJig(context.view, function (radiusValue) {
1286
+ return createArcFromStartEndRadius(start, end, _this.applyCtrlDirectionValue(radiusValue));
1287
+ }, createFallbackArc(start));
1288
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDistance(radiusPrompt)];
1289
+ case 7:
1290
+ radiusResult = _a.sent();
1291
+ radius = radiusResult.status === AcEdPromptStatus.OK
1292
+ ? radiusResult.value
1293
+ : undefined;
1294
+ if (radius == null)
1295
+ return [2 /*return*/];
1296
+ arc = createArcFromStartEndRadius(start, end, this.applyCtrlDirectionValue(radius));
1297
+ if (arc) {
1298
+ this.appendArc(context, arc);
1299
+ }
1300
+ else {
1301
+ this.warnInvalidGeometry('radius');
1302
+ }
1303
+ return [2 /*return*/];
1304
+ }
1305
+ });
1306
+ });
1307
+ };
1308
+ /**
1309
+ * Runs the Start-End option family from an explicit entry token.
1310
+ *
1311
+ * This mode corresponds to the AutoCAD-style Start/End branch where the
1312
+ * family is preselected, but the final option (Center, Angle, Direction, or
1313
+ * Radius) is still chosen through the usual interactive prompts.
1314
+ *
1315
+ * @param context - Current app context.
1316
+ */
1317
+ AcApArcCmd.prototype.runStartEndFlowFromEntry = function (context) {
1318
+ return __awaiter(this, void 0, void 0, function () {
1319
+ var start;
1320
+ return __generator(this, function (_a) {
1321
+ switch (_a.label) {
1322
+ case 0: return [4 /*yield*/, this.promptStartPoint()];
1323
+ case 1:
1324
+ start = _a.sent();
1325
+ if (!start)
1326
+ return [2 /*return*/];
1327
+ return [4 /*yield*/, this.runStartEndFlow(context, start)];
1328
+ case 2:
1329
+ _a.sent();
1330
+ return [2 /*return*/];
1331
+ }
1332
+ });
1333
+ });
1334
+ };
1335
+ /**
1336
+ * Prompts one start point using the given center point as reference.
1337
+ *
1338
+ * The supplied center point is used as the base point so the visual feedback
1339
+ * matches the standard Center/Start ARC family experience.
1340
+ *
1341
+ * @param center - Arc center point.
1342
+ * @returns Selected start point, or `undefined` when the prompt is aborted.
1343
+ */
1344
+ AcApArcCmd.prototype.promptStartPointFromCenter = function (center) {
1345
+ return __awaiter(this, void 0, void 0, function () {
1346
+ var prompt, result;
1347
+ return __generator(this, function (_a) {
1348
+ switch (_a.label) {
1349
+ case 0:
1350
+ prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.startPoint'));
1351
+ prompt.useBasePoint = true;
1352
+ prompt.useDashedLine = true;
1353
+ prompt.basePoint = new AcGePoint3d(center);
1354
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt)];
1355
+ case 1:
1356
+ result = _a.sent();
1357
+ return [2 /*return*/, result.status === AcEdPromptStatus.OK ? result.value : undefined];
1358
+ }
1359
+ });
1360
+ });
1361
+ };
1362
+ /**
1363
+ * Finishes one exact Center-Start-End style flow with end-point preview.
1364
+ *
1365
+ * This helper exists because the exact scripted branch needs the same live
1366
+ * preview behavior as the interactive Center/Start/End path, but without the
1367
+ * intermediate option-selection prompt used by the generic family handler.
1368
+ *
1369
+ * @param context - Current app context.
1370
+ * @param center - Arc center point.
1371
+ * @param start - Arc start point.
1372
+ */
1373
+ AcApArcCmd.prototype.finishExactCenterStartEnd = function (context, center, start) {
1374
+ return __awaiter(this, void 0, void 0, function () {
1375
+ var endPrompt, endResult, arc;
1376
+ var _this = this;
1377
+ return __generator(this, function (_a) {
1378
+ switch (_a.label) {
1379
+ case 0:
1380
+ endPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.arc.endPoint'));
1381
+ endPrompt.useBasePoint = true;
1382
+ endPrompt.useDashedLine = true;
1383
+ endPrompt.basePoint = new AcGePoint3d(start);
1384
+ endPrompt.jig = new AcApArcJig(context.view, function (point) {
1385
+ return createArcFromCenterStartProjectedEnd(center, start, point, _this.applyCtrlDirectionSign(1));
1386
+ }, createFallbackArc(start));
1387
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(endPrompt)];
1388
+ case 1:
1389
+ endResult = _a.sent();
1390
+ if (endResult.status !== AcEdPromptStatus.OK)
1391
+ return [2 /*return*/];
1392
+ arc = createArcFromCenterStartProjectedEnd(center, start, endResult.value, this.applyCtrlDirectionSign(1));
1393
+ if (arc) {
1394
+ this.appendArc(context, arc);
1395
+ }
1396
+ else {
1397
+ this.warnInvalidGeometry('center');
1398
+ }
1399
+ return [2 /*return*/];
1400
+ }
1401
+ });
1402
+ });
1403
+ };
603
1404
  /**
604
1405
  * Gets direction factor from Ctrl-toggle state.
605
1406
  *
@@ -861,6 +1662,9 @@ var AcApArcCmd = /** @class */ (function (_super) {
861
1662
  chordPrompt = new AcEdPromptDistanceOptions(AcApI18n.t('jig.arc.chordLength'));
862
1663
  chordPrompt.allowZero = false;
863
1664
  chordPrompt.allowNegative = true;
1665
+ chordPrompt.useBasePoint = true;
1666
+ chordPrompt.useDashedLine = true;
1667
+ chordPrompt.basePoint = new AcGePoint3d(start);
864
1668
  return [4 /*yield*/, AcApDocManager.instance.editor.getDistance(chordPrompt)];
865
1669
  case 4:
866
1670
  chordResult = _a.sent();
@@ -976,6 +1780,9 @@ var AcApArcCmd = /** @class */ (function (_super) {
976
1780
  radiusPrompt = new AcEdPromptDistanceOptions(AcApI18n.t('jig.arc.radius'));
977
1781
  radiusPrompt.allowZero = false;
978
1782
  radiusPrompt.allowNegative = true;
1783
+ radiusPrompt.useBasePoint = true;
1784
+ radiusPrompt.useDashedLine = true;
1785
+ radiusPrompt.basePoint = new AcGePoint3d(start);
979
1786
  return [4 /*yield*/, AcApDocManager.instance.editor.getDistance(radiusPrompt)];
980
1787
  case 7:
981
1788
  radiusResult = _a.sent();