@linkiez/dxf-renew 7.1.0 → 7.2.3

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 (398) hide show
  1. package/.eslintrc.json +1 -16
  2. package/.yarn/install-state.gz +0 -0
  3. package/ARCHITECTURE.md +163 -0
  4. package/CHANGELOG.md +34 -0
  5. package/README.md +72 -10
  6. package/{PLAN.md → ROADMAP.md} +227 -35
  7. package/build.mjs +28 -0
  8. package/dist/dxf.js +1090 -344
  9. package/docs/FIXTURE_VALIDATION_EZDXF.md +1 -1
  10. package/lib/Helper.cjs +4 -0
  11. package/lib/Helper.cjs.map +3 -3
  12. package/lib/Helper.d.ts +19 -0
  13. package/lib/Helper.d.ts.map +1 -0
  14. package/lib/Helper.js +4 -0
  15. package/lib/Helper.js.map +2 -2
  16. package/lib/applyTransforms.d.ts +12 -0
  17. package/lib/applyTransforms.d.ts.map +1 -0
  18. package/lib/cli.cjs +1 -2
  19. package/lib/cli.cjs.map +1 -1
  20. package/lib/cli.d.ts +3 -0
  21. package/lib/cli.d.ts.map +1 -0
  22. package/lib/config.d.ts +4 -0
  23. package/lib/config.d.ts.map +1 -0
  24. package/lib/constants.d.ts +3 -0
  25. package/lib/constants.d.ts.map +1 -0
  26. package/lib/denormalise.d.ts +3 -0
  27. package/lib/denormalise.d.ts.map +1 -0
  28. package/lib/dimensionToSVG.d.ts +18 -0
  29. package/lib/dimensionToSVG.d.ts.map +1 -0
  30. package/lib/entityToPolyline.cjs +95 -0
  31. package/lib/entityToPolyline.cjs.map +3 -3
  32. package/lib/entityToPolyline.d.ts +48 -0
  33. package/lib/entityToPolyline.d.ts.map +1 -0
  34. package/lib/entityToPolyline.js +95 -0
  35. package/lib/entityToPolyline.js.map +2 -2
  36. package/lib/getRGBForEntity.d.ts +5 -0
  37. package/lib/getRGBForEntity.d.ts.map +1 -0
  38. package/lib/groupEntitiesByLayer.d.ts +3 -0
  39. package/lib/groupEntitiesByLayer.d.ts.map +1 -0
  40. package/lib/handlers/blocks.d.ts +3 -0
  41. package/lib/handlers/blocks.d.ts.map +1 -0
  42. package/lib/handlers/entities.cjs +22 -2
  43. package/lib/handlers/entities.cjs.map +3 -3
  44. package/lib/handlers/entities.d.ts +4 -0
  45. package/lib/handlers/entities.d.ts.map +1 -0
  46. package/lib/handlers/entities.js +22 -2
  47. package/lib/handlers/entities.js.map +2 -2
  48. package/lib/handlers/entity/arc.d.ts +20 -0
  49. package/lib/handlers/entity/arc.d.ts.map +1 -0
  50. package/lib/handlers/entity/attdef.d.ts +11 -0
  51. package/lib/handlers/entity/attdef.d.ts.map +1 -0
  52. package/lib/handlers/entity/attrib.d.ts +9 -0
  53. package/lib/handlers/entity/attrib.d.ts.map +1 -0
  54. package/lib/handlers/entity/circle.d.ts +17 -0
  55. package/lib/handlers/entity/circle.d.ts.map +1 -0
  56. package/lib/handlers/entity/common.d.ts +3 -0
  57. package/lib/handlers/entity/common.d.ts.map +1 -0
  58. package/lib/handlers/entity/dgnUnderlay.d.ts +33 -0
  59. package/lib/handlers/entity/dgnUnderlay.d.ts.map +1 -0
  60. package/lib/handlers/entity/dimension.d.ts +35 -0
  61. package/lib/handlers/entity/dimension.d.ts.map +1 -0
  62. package/lib/handlers/entity/dwfUnderlay.d.ts +33 -0
  63. package/lib/handlers/entity/dwfUnderlay.d.ts.map +1 -0
  64. package/lib/handlers/entity/ellipse.d.ts +10 -0
  65. package/lib/handlers/entity/ellipse.d.ts.map +1 -0
  66. package/lib/handlers/entity/hatch.d.ts +9 -0
  67. package/lib/handlers/entity/hatch.d.ts.map +1 -0
  68. package/lib/handlers/entity/image.d.ts +26 -0
  69. package/lib/handlers/entity/image.d.ts.map +1 -0
  70. package/lib/handlers/entity/insert.d.ts +10 -0
  71. package/lib/handlers/entity/insert.d.ts.map +1 -0
  72. package/lib/handlers/entity/leader.d.ts +48 -0
  73. package/lib/handlers/entity/leader.d.ts.map +1 -0
  74. package/lib/handlers/entity/line.d.ts +16 -0
  75. package/lib/handlers/entity/line.d.ts.map +1 -0
  76. package/lib/handlers/entity/lwpolyline.d.ts +10 -0
  77. package/lib/handlers/entity/lwpolyline.d.ts.map +1 -0
  78. package/lib/handlers/entity/mleader.cjs +69 -0
  79. package/lib/handlers/entity/mleader.cjs.map +7 -0
  80. package/lib/handlers/entity/mleader.d.ts +15 -0
  81. package/lib/handlers/entity/mleader.d.ts.map +1 -0
  82. package/lib/handlers/entity/mleader.js +34 -0
  83. package/lib/handlers/entity/mleader.js.map +7 -0
  84. package/lib/handlers/entity/mline.cjs +91 -0
  85. package/lib/handlers/entity/mline.cjs.map +7 -0
  86. package/lib/handlers/entity/mline.d.ts +17 -0
  87. package/lib/handlers/entity/mline.d.ts.map +1 -0
  88. package/lib/handlers/entity/mline.js +56 -0
  89. package/lib/handlers/entity/mline.js.map +7 -0
  90. package/lib/handlers/entity/mtext.d.ts +62 -0
  91. package/lib/handlers/entity/mtext.d.ts.map +1 -0
  92. package/lib/handlers/entity/ole2Frame.d.ts +9 -0
  93. package/lib/handlers/entity/ole2Frame.d.ts.map +1 -0
  94. package/lib/handlers/entity/oleframe.cjs +98 -0
  95. package/lib/handlers/entity/oleframe.cjs.map +7 -0
  96. package/lib/handlers/entity/oleframe.d.ts +9 -0
  97. package/lib/handlers/entity/oleframe.d.ts.map +1 -0
  98. package/lib/handlers/entity/oleframe.js +63 -0
  99. package/lib/handlers/entity/oleframe.js.map +7 -0
  100. package/lib/handlers/entity/pdfUnderlay.d.ts +33 -0
  101. package/lib/handlers/entity/pdfUnderlay.d.ts.map +1 -0
  102. package/lib/handlers/entity/point.d.ts +17 -0
  103. package/lib/handlers/entity/point.d.ts.map +1 -0
  104. package/lib/handlers/entity/polyline.d.ts +21 -0
  105. package/lib/handlers/entity/polyline.d.ts.map +1 -0
  106. package/lib/handlers/entity/ray.cjs +81 -0
  107. package/lib/handlers/entity/ray.cjs.map +7 -0
  108. package/lib/handlers/entity/ray.d.ts +15 -0
  109. package/lib/handlers/entity/ray.d.ts.map +1 -0
  110. package/lib/handlers/entity/ray.js +46 -0
  111. package/lib/handlers/entity/ray.js.map +7 -0
  112. package/lib/handlers/entity/region.cjs +67 -0
  113. package/lib/handlers/entity/region.cjs.map +7 -0
  114. package/lib/handlers/entity/region.d.ts +14 -0
  115. package/lib/handlers/entity/region.d.ts.map +1 -0
  116. package/lib/handlers/entity/region.js +32 -0
  117. package/lib/handlers/entity/region.js.map +7 -0
  118. package/lib/handlers/entity/shape.cjs +95 -0
  119. package/lib/handlers/entity/shape.cjs.map +7 -0
  120. package/lib/handlers/entity/shape.d.ts +22 -0
  121. package/lib/handlers/entity/shape.d.ts.map +1 -0
  122. package/lib/handlers/entity/shape.js +60 -0
  123. package/lib/handlers/entity/shape.js.map +7 -0
  124. package/lib/handlers/entity/solid.d.ts +15 -0
  125. package/lib/handlers/entity/solid.d.ts.map +1 -0
  126. package/lib/handlers/entity/spline.d.ts +30 -0
  127. package/lib/handlers/entity/spline.d.ts.map +1 -0
  128. package/lib/handlers/entity/table.cjs +71 -0
  129. package/lib/handlers/entity/table.cjs.map +7 -0
  130. package/lib/handlers/entity/table.d.ts +16 -0
  131. package/lib/handlers/entity/table.d.ts.map +1 -0
  132. package/lib/handlers/entity/table.js +36 -0
  133. package/lib/handlers/entity/table.js.map +7 -0
  134. package/lib/handlers/entity/text.d.ts +31 -0
  135. package/lib/handlers/entity/text.d.ts.map +1 -0
  136. package/lib/handlers/entity/threeDFace.d.ts +14 -0
  137. package/lib/handlers/entity/threeDFace.d.ts.map +1 -0
  138. package/lib/handlers/entity/tolerance.d.ts +25 -0
  139. package/lib/handlers/entity/tolerance.d.ts.map +1 -0
  140. package/lib/handlers/entity/trace.cjs +101 -0
  141. package/lib/handlers/entity/trace.cjs.map +7 -0
  142. package/lib/handlers/entity/trace.d.ts +15 -0
  143. package/lib/handlers/entity/trace.d.ts.map +1 -0
  144. package/lib/handlers/entity/trace.js +66 -0
  145. package/lib/handlers/entity/trace.js.map +7 -0
  146. package/lib/handlers/entity/vertex.d.ts +10 -0
  147. package/lib/handlers/entity/vertex.d.ts.map +1 -0
  148. package/lib/handlers/entity/viewport.d.ts +9 -0
  149. package/lib/handlers/entity/viewport.d.ts.map +1 -0
  150. package/lib/handlers/entity/wipeout.cjs +122 -0
  151. package/lib/handlers/entity/wipeout.cjs.map +7 -0
  152. package/lib/handlers/entity/wipeout.d.ts +28 -0
  153. package/lib/handlers/entity/wipeout.d.ts.map +1 -0
  154. package/lib/handlers/entity/wipeout.js +87 -0
  155. package/lib/handlers/entity/wipeout.js.map +7 -0
  156. package/lib/handlers/entity/xline.cjs +81 -0
  157. package/lib/handlers/entity/xline.cjs.map +7 -0
  158. package/lib/handlers/entity/xline.d.ts +15 -0
  159. package/lib/handlers/entity/xline.d.ts.map +1 -0
  160. package/lib/handlers/entity/xline.js +46 -0
  161. package/lib/handlers/entity/xline.js.map +7 -0
  162. package/lib/handlers/header.d.ts +3 -0
  163. package/lib/handlers/header.d.ts.map +1 -0
  164. package/lib/handlers/objects.cjs +43 -1
  165. package/lib/handlers/objects.cjs.map +2 -2
  166. package/lib/handlers/objects.d.ts +3 -0
  167. package/lib/handlers/objects.d.ts.map +1 -0
  168. package/lib/handlers/objects.js +43 -1
  169. package/lib/handlers/objects.js.map +2 -2
  170. package/lib/handlers/tables.cjs +96 -17
  171. package/lib/handlers/tables.cjs.map +2 -2
  172. package/lib/handlers/tables.d.ts +13 -0
  173. package/lib/handlers/tables.d.ts.map +1 -0
  174. package/lib/handlers/tables.js +96 -17
  175. package/lib/handlers/tables.js.map +2 -2
  176. package/lib/index.cjs +5 -2
  177. package/lib/index.cjs.map +3 -3
  178. package/lib/index.d.ts +10 -0
  179. package/lib/index.d.ts.map +1 -0
  180. package/lib/index.js +18 -16
  181. package/lib/index.js.map +3 -3
  182. package/lib/parseString.d.ts +3 -0
  183. package/lib/parseString.d.ts.map +1 -0
  184. package/lib/toJson.cjs +29 -0
  185. package/lib/toJson.cjs.map +7 -0
  186. package/lib/toJson.d.ts +3 -0
  187. package/lib/toJson.d.ts.map +1 -0
  188. package/lib/toJson.js +9 -0
  189. package/lib/toJson.js.map +7 -0
  190. package/lib/toPolylines.d.ts +4 -0
  191. package/lib/toPolylines.d.ts.map +1 -0
  192. package/lib/toSVG.cjs +34 -3
  193. package/lib/toSVG.cjs.map +2 -2
  194. package/lib/toSVG.d.ts +7 -0
  195. package/lib/toSVG.d.ts.map +1 -0
  196. package/lib/toSVG.js +34 -3
  197. package/lib/toSVG.js.map +2 -2
  198. package/lib/types/arc-entity.d.ts +8 -0
  199. package/lib/types/arc-entity.d.ts.map +1 -0
  200. package/lib/types/base-entity.d.ts +22 -0
  201. package/lib/types/base-entity.d.ts.map +1 -0
  202. package/lib/types/circle-entity.d.ts +6 -0
  203. package/lib/types/circle-entity.d.ts.map +1 -0
  204. package/lib/types/common.d.ts +30 -0
  205. package/lib/types/common.d.ts.map +1 -0
  206. package/lib/types/dimension-entity.d.ts +31 -0
  207. package/lib/types/dimension-entity.d.ts.map +1 -0
  208. package/lib/types/dxf.d.ts +55 -0
  209. package/lib/types/dxf.d.ts.map +1 -0
  210. package/lib/types/ellipse-entity.d.ts +11 -0
  211. package/lib/types/ellipse-entity.d.ts.map +1 -0
  212. package/lib/types/entity.cjs.map +1 -1
  213. package/lib/types/entity.d.ts +30 -0
  214. package/lib/types/entity.d.ts.map +1 -0
  215. package/lib/types/handler-internal.d.ts +44 -0
  216. package/lib/types/handler-internal.d.ts.map +1 -0
  217. package/lib/types/handler.d.ts +8 -0
  218. package/lib/types/handler.d.ts.map +1 -0
  219. package/lib/types/hatch-entity.d.ts +116 -0
  220. package/lib/types/hatch-entity.d.ts.map +1 -0
  221. package/lib/types/helper.cjs.map +1 -1
  222. package/lib/types/helper.d.ts +11 -0
  223. package/lib/types/helper.d.ts.map +1 -0
  224. package/lib/types/image-entity.d.ts +25 -0
  225. package/lib/types/image-entity.d.ts.map +1 -0
  226. package/lib/types/index.cjs +20 -0
  227. package/lib/types/index.cjs.map +2 -2
  228. package/lib/types/index.d.ts +43 -0
  229. package/lib/types/index.d.ts.map +1 -0
  230. package/lib/types/index.js +10 -0
  231. package/lib/types/index.js.map +2 -2
  232. package/lib/types/insert-entity.d.ts +16 -0
  233. package/lib/types/insert-entity.d.ts.map +1 -0
  234. package/lib/types/layer-groups.d.ts +6 -0
  235. package/lib/types/layer-groups.d.ts.map +1 -0
  236. package/lib/types/leader-entity.d.ts +28 -0
  237. package/lib/types/leader-entity.d.ts.map +1 -0
  238. package/lib/types/line-entity.d.ts +8 -0
  239. package/lib/types/line-entity.d.ts.map +1 -0
  240. package/lib/types/mleader-entity.cjs +17 -0
  241. package/lib/types/mleader-entity.cjs.map +7 -0
  242. package/lib/types/mleader-entity.d.ts +7 -0
  243. package/lib/types/mleader-entity.d.ts.map +1 -0
  244. package/lib/types/mleader-entity.js +1 -0
  245. package/lib/types/mleader-entity.js.map +7 -0
  246. package/lib/types/mline-entity.cjs +17 -0
  247. package/lib/types/mline-entity.cjs.map +7 -0
  248. package/lib/types/mline-entity.d.ts +10 -0
  249. package/lib/types/mline-entity.d.ts.map +1 -0
  250. package/lib/types/mline-entity.js +1 -0
  251. package/lib/types/mline-entity.js.map +7 -0
  252. package/lib/types/mtext-entity.d.ts +33 -0
  253. package/lib/types/mtext-entity.d.ts.map +1 -0
  254. package/lib/types/ole2frame-entity.d.ts +33 -0
  255. package/lib/types/ole2frame-entity.d.ts.map +1 -0
  256. package/lib/types/oleframe-entity.cjs +17 -0
  257. package/lib/types/oleframe-entity.cjs.map +7 -0
  258. package/lib/types/oleframe-entity.d.ts +33 -0
  259. package/lib/types/oleframe-entity.d.ts.map +1 -0
  260. package/lib/types/oleframe-entity.js +1 -0
  261. package/lib/types/oleframe-entity.js.map +7 -0
  262. package/lib/types/options.cjs.map +1 -1
  263. package/lib/types/options.d.ts +57 -0
  264. package/lib/types/options.d.ts.map +1 -0
  265. package/lib/types/point-entity.d.ts +5 -0
  266. package/lib/types/point-entity.d.ts.map +1 -0
  267. package/lib/types/polyline-entity.d.ts +17 -0
  268. package/lib/types/polyline-entity.d.ts.map +1 -0
  269. package/lib/types/polylines.d.ts +18 -0
  270. package/lib/types/polylines.d.ts.map +1 -0
  271. package/lib/types/ray-entity.cjs +17 -0
  272. package/lib/types/ray-entity.cjs.map +7 -0
  273. package/lib/types/ray-entity.d.ts +10 -0
  274. package/lib/types/ray-entity.d.ts.map +1 -0
  275. package/lib/types/ray-entity.js +1 -0
  276. package/lib/types/ray-entity.js.map +7 -0
  277. package/lib/types/region-entity.cjs +17 -0
  278. package/lib/types/region-entity.cjs.map +7 -0
  279. package/lib/types/region-entity.d.ts +10 -0
  280. package/lib/types/region-entity.d.ts.map +1 -0
  281. package/lib/types/region-entity.js +1 -0
  282. package/lib/types/region-entity.js.map +7 -0
  283. package/lib/types/shape-entity.cjs +17 -0
  284. package/lib/types/shape-entity.cjs.map +7 -0
  285. package/lib/types/shape-entity.d.ts +17 -0
  286. package/lib/types/shape-entity.d.ts.map +1 -0
  287. package/lib/types/shape-entity.js +1 -0
  288. package/lib/types/shape-entity.js.map +7 -0
  289. package/lib/types/solid-entity.d.ts +7 -0
  290. package/lib/types/solid-entity.d.ts.map +1 -0
  291. package/lib/types/spline-entity.d.ts +10 -0
  292. package/lib/types/spline-entity.d.ts.map +1 -0
  293. package/lib/types/svg.d.ts +27 -0
  294. package/lib/types/svg.d.ts.map +1 -0
  295. package/lib/types/table-entity.cjs +17 -0
  296. package/lib/types/table-entity.cjs.map +7 -0
  297. package/lib/types/table-entity.d.ts +12 -0
  298. package/lib/types/table-entity.d.ts.map +1 -0
  299. package/lib/types/table-entity.js +1 -0
  300. package/lib/types/table-entity.js.map +7 -0
  301. package/lib/types/tables.cjs.map +1 -1
  302. package/lib/types/tables.d.ts +549 -0
  303. package/lib/types/tables.d.ts.map +1 -0
  304. package/lib/types/text-entity.d.ts +21 -0
  305. package/lib/types/text-entity.d.ts.map +1 -0
  306. package/lib/types/tolerance-entity.d.ts +14 -0
  307. package/lib/types/tolerance-entity.d.ts.map +1 -0
  308. package/lib/types/trace-entity.cjs +17 -0
  309. package/lib/types/trace-entity.cjs.map +7 -0
  310. package/lib/types/trace-entity.d.ts +10 -0
  311. package/lib/types/trace-entity.d.ts.map +1 -0
  312. package/lib/types/trace-entity.js +1 -0
  313. package/lib/types/trace-entity.js.map +7 -0
  314. package/lib/types/underlay-entity.d.ts +26 -0
  315. package/lib/types/underlay-entity.d.ts.map +1 -0
  316. package/lib/types/util-types.d.ts +22 -0
  317. package/lib/types/util-types.d.ts.map +1 -0
  318. package/lib/types/viewport-entity.d.ts +79 -0
  319. package/lib/types/viewport-entity.d.ts.map +1 -0
  320. package/lib/types/wipeout-entity.cjs +17 -0
  321. package/lib/types/wipeout-entity.cjs.map +7 -0
  322. package/lib/types/wipeout-entity.d.ts +18 -0
  323. package/lib/types/wipeout-entity.d.ts.map +1 -0
  324. package/lib/types/wipeout-entity.js +1 -0
  325. package/lib/types/wipeout-entity.js.map +7 -0
  326. package/lib/types/xline-entity.cjs +17 -0
  327. package/lib/types/xline-entity.cjs.map +7 -0
  328. package/lib/types/xline-entity.d.ts +10 -0
  329. package/lib/types/xline-entity.d.ts.map +1 -0
  330. package/lib/types/xline-entity.js +1 -0
  331. package/lib/types/xline-entity.js.map +7 -0
  332. package/lib/types.d.ts +2 -0
  333. package/lib/types.d.ts.map +1 -0
  334. package/lib/util/bSpline.d.ts +8 -0
  335. package/lib/util/bSpline.d.ts.map +1 -0
  336. package/lib/util/colors.d.ts +5 -0
  337. package/lib/util/colors.d.ts.map +1 -0
  338. package/lib/util/createArcForLWPolyline.d.ts +9 -0
  339. package/lib/util/createArcForLWPolyline.d.ts.map +1 -0
  340. package/lib/util/dxfColorToRGB.d.ts +22 -0
  341. package/lib/util/dxfColorToRGB.d.ts.map +1 -0
  342. package/lib/util/escapeXmlText.d.ts +2 -0
  343. package/lib/util/escapeXmlText.d.ts.map +1 -0
  344. package/lib/util/insertKnot.d.ts +9 -0
  345. package/lib/util/insertKnot.d.ts.map +1 -0
  346. package/lib/util/logger.d.ts +10 -0
  347. package/lib/util/logger.d.ts.map +1 -0
  348. package/lib/util/rgbToColorAttribute.d.ts +7 -0
  349. package/lib/util/rgbToColorAttribute.d.ts.map +1 -0
  350. package/lib/util/rotate.d.ts +9 -0
  351. package/lib/util/rotate.d.ts.map +1 -0
  352. package/lib/util/round10.d.ts +2 -0
  353. package/lib/util/round10.d.ts.map +1 -0
  354. package/lib/util/toPiecewiseBezier.d.ts +18 -0
  355. package/lib/util/toPiecewiseBezier.d.ts.map +1 -0
  356. package/lib/util/transformBoundingBoxAndElement.d.ts +9 -0
  357. package/lib/util/transformBoundingBoxAndElement.d.ts.map +1 -0
  358. package/package.json +5 -19
  359. package/src/Helper.ts +6 -1
  360. package/src/entityToPolyline.ts +124 -2
  361. package/src/handlers/entities.ts +21 -1
  362. package/src/handlers/entity/mleader.ts +46 -0
  363. package/src/handlers/entity/mline.ts +74 -0
  364. package/src/handlers/entity/oleframe.ts +62 -0
  365. package/src/handlers/entity/ray.ts +52 -0
  366. package/src/handlers/entity/region.ts +42 -0
  367. package/src/handlers/entity/shape.ts +73 -0
  368. package/src/handlers/entity/table.ts +49 -0
  369. package/src/handlers/entity/trace.ts +72 -0
  370. package/src/handlers/entity/wipeout.ts +114 -0
  371. package/src/handlers/entity/xline.ts +52 -0
  372. package/src/handlers/objects.ts +64 -8
  373. package/src/handlers/tables.ts +134 -21
  374. package/src/index.ts +9 -18
  375. package/src/toJson.ts +8 -0
  376. package/src/toSVG.ts +45 -3
  377. package/src/types/entity.ts +20 -0
  378. package/src/types/helper.ts +2 -1
  379. package/src/types/index.ts +10 -0
  380. package/src/types/mleader-entity.ts +8 -0
  381. package/src/types/mline-entity.ts +12 -0
  382. package/src/types/oleframe-entity.ts +40 -0
  383. package/src/types/options.ts +7 -0
  384. package/src/types/ray-entity.ts +12 -0
  385. package/src/types/region-entity.ts +11 -0
  386. package/src/types/shape-entity.ts +19 -0
  387. package/src/types/table-entity.ts +14 -0
  388. package/src/types/tables.ts +76 -0
  389. package/src/types/trace-entity.ts +14 -0
  390. package/src/types/wipeout-entity.ts +20 -0
  391. package/src/types/xline-entity.ts +12 -0
  392. package/docs/DIMENSION_SUMMARY.md +0 -254
  393. package/docs/DXF_VERSION_SUPPORT.md +0 -45
  394. package/docs/ENTITY_SVG_ROADMAP.md +0 -96
  395. package/docs/IMPLEMENTED-2D-ENTITIES.md +0 -54
  396. package/docs/README.md +0 -22
  397. package/docs/SVG_RENDERING_INTEGRATION_TESTS.md +0 -119
  398. package/docs/TEXT-MTEXT-DIMENSION-SUPPORT.md +0 -241
@@ -0,0 +1,26 @@
1
+ import type { BaseEntity } from './base-entity';
2
+ import type { Point3D } from './common';
3
+ export interface UnderlayReferenceEntityBase extends BaseEntity {
4
+ insertionPoint: Point3D;
5
+ scale: Point3D;
6
+ rotation?: number;
7
+ normal?: Point3D;
8
+ /** Hard reference to UNDERLAYDEFINITION object. */
9
+ underlayDefinitionHandle?: string;
10
+ /** Display properties bitmask. */
11
+ flags?: number;
12
+ /** Contrast in range [0, 100]. */
13
+ contrast?: number;
14
+ /** Fade in range [0, 100]. */
15
+ fade?: number;
16
+ }
17
+ export interface DwfUnderlayEntity extends UnderlayReferenceEntityBase {
18
+ type: 'DWFUNDERLAY';
19
+ }
20
+ export interface DgnUnderlayEntity extends UnderlayReferenceEntityBase {
21
+ type: 'DGNUNDERLAY';
22
+ }
23
+ export interface PdfUnderlayEntity extends UnderlayReferenceEntityBase {
24
+ type: 'PDFUNDERLAY';
25
+ }
26
+ //# sourceMappingURL=underlay-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"underlay-entity.d.ts","sourceRoot":"","sources":["../../src/types/underlay-entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,2BAA4B,SAAQ,UAAU;IAC7D,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,mDAAmD;IACnD,wBAAwB,CAAC,EAAE,MAAM,CAAA;IAEjC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE,IAAI,EAAE,aAAa,CAAA;CACpB;AAED,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE,IAAI,EAAE,aAAa,CAAA;CACpB;AAED,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE,IAAI,EAAE,aAAa,CAAA;CACpB"}
@@ -0,0 +1,22 @@
1
+ import type { Box2 } from 'vecks';
2
+ import type { Point2D } from './common';
3
+ /** Point for utility functions - extends Point2D with optional z */
4
+ export interface UtilPoint extends Point2D {
5
+ z?: number;
6
+ }
7
+ /** Result of knot insertion operation */
8
+ export interface InsertKnotResult {
9
+ knots: number[];
10
+ controlPoints: UtilPoint[];
11
+ }
12
+ /** Result of bezier conversion */
13
+ export interface BezierResult {
14
+ controlPoints: UtilPoint[];
15
+ knots: number[];
16
+ }
17
+ /** Transform result with bounding box */
18
+ export interface TransformResult {
19
+ element: string;
20
+ bbox: Box2;
21
+ }
22
+ //# sourceMappingURL=util-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util-types.d.ts","sourceRoot":"","sources":["../../src/types/util-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,oEAAoE;AACpE,MAAM,WAAW,SAAU,SAAQ,OAAO;IACxC,CAAC,CAAC,EAAE,MAAM,CAAA;CACX;AAED,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,aAAa,EAAE,SAAS,EAAE,CAAA;CAC3B;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,SAAS,EAAE,CAAA;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;CACX"}
@@ -0,0 +1,79 @@
1
+ import type { BaseEntity } from './base-entity';
2
+ /**
3
+ * Viewport entity
4
+ * Represents a viewport in model space or paper space
5
+ */
6
+ export interface ViewportEntity extends BaseEntity {
7
+ type: 'VIEWPORT';
8
+ /** Layout reference */
9
+ layout?: number;
10
+ /** Viewport width */
11
+ width?: number;
12
+ /** Viewport height */
13
+ height?: number;
14
+ /** Snap rotation angle */
15
+ snapAngle?: number;
16
+ /** View twist angle */
17
+ angle?: number;
18
+ /** Viewport status field */
19
+ status?: string | number;
20
+ /** Viewport ID */
21
+ id?: string | number;
22
+ /** Viewport flags */
23
+ flags?: string | number;
24
+ /** UCS origin X coordinate */
25
+ x?: number;
26
+ /** UCS origin Y coordinate */
27
+ y?: number;
28
+ /** UCS origin Z coordinate */
29
+ z?: number;
30
+ /** UCS X-axis X component */
31
+ xAxisX?: number;
32
+ /** UCS X-axis Y component */
33
+ xAxisY?: number;
34
+ /** UCS X-axis Z component */
35
+ xAxisZ?: number;
36
+ /** View elevation */
37
+ elevation?: number;
38
+ /** Render mode */
39
+ render?: string | number;
40
+ /** Center point in WCS */
41
+ center?: {
42
+ x?: number;
43
+ y?: number;
44
+ z?: number;
45
+ };
46
+ /** Center point in DCS */
47
+ centerDCS?: {
48
+ x?: number;
49
+ y?: number;
50
+ };
51
+ /** Snap base point */
52
+ snap?: {
53
+ x?: number;
54
+ y?: number;
55
+ };
56
+ /** Snap spacing */
57
+ snapSpacing?: {
58
+ x?: number;
59
+ y?: number;
60
+ };
61
+ /** Grid spacing */
62
+ gridSpacing?: {
63
+ x?: number;
64
+ y?: number;
65
+ };
66
+ /** View direction from target */
67
+ direction?: {
68
+ x?: number;
69
+ y?: number;
70
+ z?: number;
71
+ };
72
+ /** View target point */
73
+ target?: {
74
+ x?: number;
75
+ y?: number;
76
+ z?: number;
77
+ };
78
+ }
79
+ //# sourceMappingURL=viewport-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport-entity.d.ts","sourceRoot":"","sources":["../../src/types/viewport-entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,UAAU,CAAA;IAChB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,kBAAkB;IAClB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,8BAA8B;IAC9B,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,8BAA8B;IAC9B,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,8BAA8B;IAC9B,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,0BAA0B;IAC1B,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,0BAA0B;IAC1B,SAAS,CAAC,EAAE;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,sBAAsB;IACtB,IAAI,CAAC,EAAE;QACL,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,mBAAmB;IACnB,WAAW,CAAC,EAAE;QACZ,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,mBAAmB;IACnB,WAAW,CAAC,EAAE;QACZ,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,iCAAiC;IACjC,SAAS,CAAC,EAAE;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,wBAAwB;IACxB,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;CACF"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var wipeout_entity_exports = {};
16
+ module.exports = __toCommonJS(wipeout_entity_exports);
17
+ //# sourceMappingURL=wipeout-entity.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types/wipeout-entity.ts"],
4
+ "sourcesContent": ["// WIPEOUT entity type\n\nimport type { BaseEntity } from './base-entity'\nimport type { Point2D, Point3D } from './common'\n\nexport interface WipeoutEntity extends BaseEntity {\n type: 'WIPEOUT'\n\n insertionPoint: Point3D\n uVector: Point3D\n vVector: Point3D\n\n clipBoundaryType?: 1 | 2\n clipBoundaryVertices?: Point2D[]\n\n displayProperties?: number\n clippingState?: 0 | 1\n classVersion?: number\n imageSizePixels?: { u: number; v: number }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import type { BaseEntity } from './base-entity';
2
+ import type { Point2D, Point3D } from './common';
3
+ export interface WipeoutEntity extends BaseEntity {
4
+ type: 'WIPEOUT';
5
+ insertionPoint: Point3D;
6
+ uVector: Point3D;
7
+ vVector: Point3D;
8
+ clipBoundaryType?: 1 | 2;
9
+ clipBoundaryVertices?: Point2D[];
10
+ displayProperties?: number;
11
+ clippingState?: 0 | 1;
12
+ classVersion?: number;
13
+ imageSizePixels?: {
14
+ u: number;
15
+ v: number;
16
+ };
17
+ }
18
+ //# sourceMappingURL=wipeout-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipeout-entity.d.ts","sourceRoot":"","sources":["../../src/types/wipeout-entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,SAAS,CAAA;IAEf,cAAc,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAEhB,gBAAgB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACxB,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAA;IAEhC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=wipeout-entity.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var xline_entity_exports = {};
16
+ module.exports = __toCommonJS(xline_entity_exports);
17
+ //# sourceMappingURL=xline-entity.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types/xline-entity.ts"],
4
+ "sourcesContent": ["// XLINE entity type\n\nimport type { BaseEntity } from './base-entity'\nimport type { Point3D } from './common'\n\nexport interface XLineEntity extends BaseEntity {\n type: 'XLINE'\n /** Base point for the infinite line. */\n basePoint: Point3D\n /** Unit direction vector. */\n direction: Point3D\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { BaseEntity } from './base-entity';
2
+ import type { Point3D } from './common';
3
+ export interface XLineEntity extends BaseEntity {
4
+ type: 'XLINE';
5
+ /** Base point for the infinite line. */
6
+ basePoint: Point3D;
7
+ /** Unit direction vector. */
8
+ direction: Point3D;
9
+ }
10
+ //# sourceMappingURL=xline-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xline-entity.d.ts","sourceRoot":"","sources":["../../src/types/xline-entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,IAAI,EAAE,OAAO,CAAA;IACb,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,6BAA6B;IAC7B,SAAS,EAAE,OAAO,CAAA;CACnB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=xline-entity.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/lib/types.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './types/index';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copied and ported to code standard as the b-spline library is not maintained any longer.
3
+ * Source:
4
+ * https://github.com/thibauts/b-spline
5
+ * Copyright (c) 2015 Thibaut Séguy <thibaut.seguy@gmail.com>
6
+ */
7
+ export default function bSpline(t: number, degree: number, points: number[][], knots?: number[], weights?: number[]): number[];
8
+ //# sourceMappingURL=bSpline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bSpline.d.ts","sourceRoot":"","sources":["../../src/util/bSpline.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,MAAM,EAAE,CAkFV"}
@@ -0,0 +1,5 @@
1
+ import type { ColorRGB } from '../types/common';
2
+ export type { ColorRGB } from '../types/common';
3
+ declare const colors: ColorRGB[];
4
+ export default colors;
5
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/util/colors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAG/C,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,QAAA,MAAM,MAAM,EAAE,QAAQ,EAiQrB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ type Point = [number, number];
2
+ /**
3
+ * Create the arcs point for a LWPOLYLINE. The start and end are excluded
4
+ *
5
+ * See diagram.png in this directory for description of points and angles used.
6
+ */
7
+ export default function createArcForLWPolyline(from: Point, to: Point, bulge: number, resolution?: number): Point[];
8
+ export {};
9
+ //# sourceMappingURL=createArcForLWPolyline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createArcForLWPolyline.d.ts","sourceRoot":"","sources":["../../src/util/createArcForLWPolyline.ts"],"names":[],"mappings":"AAEA,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE7B;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,IAAI,EAAE,KAAK,EACX,EAAE,EAAE,KAAK,EACT,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,EAAE,CA8ET"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Convert DXF ACI (AutoCAD Color Index) to RGB color
3
+ * Based on AutoCAD's standard 256 color palette
4
+ */
5
+ export default function dxfColorToRGB(colorNumber: number): {
6
+ r: number;
7
+ g: number;
8
+ b: number;
9
+ };
10
+ /**
11
+ * Convert RGB object to SVG color string
12
+ */
13
+ export declare function rgbToSVGColor(rgb: {
14
+ r: number;
15
+ g: number;
16
+ b: number;
17
+ }): string;
18
+ /**
19
+ * Convert DXF color number directly to SVG color string
20
+ */
21
+ export declare function dxfColorToSVG(colorNumber: number | undefined): string;
22
+ //# sourceMappingURL=dxfColorToRGB.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dxfColorToRGB.d.ts","sourceRoot":"","sources":["../../src/util/dxfColorToRGB.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAmF9F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE9E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMrE"}
@@ -0,0 +1,2 @@
1
+ export default function escapeXmlText(value: string): string;
2
+ //# sourceMappingURL=escapeXmlText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeXmlText.d.ts","sourceRoot":"","sources":["../../src/util/escapeXmlText.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS3D"}
@@ -0,0 +1,9 @@
1
+ import type { InsertKnotResult, UtilPoint } from '../types/util-types';
2
+ /**
3
+ * Knot insertion is known as "Boehm's algorithm"
4
+ *
5
+ * https://math.stackexchange.com/questions/417859/convert-a-b-spline-into-bezier-curves
6
+ * code adapted from http://preserve.mactech.com/articles/develop/issue_25/schneider.html
7
+ */
8
+ export default function insertKnot(k: number, controlPoints: UtilPoint[], knots: number[], newKnot: number): InsertKnotResult;
9
+ //# sourceMappingURL=insertKnot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertKnot.d.ts","sourceRoot":"","sources":["../../src/util/insertKnot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,CAAC,EAAE,MAAM,EACT,aAAa,EAAE,SAAS,EAAE,EAC1B,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,MAAM,GACd,gBAAgB,CAuDlB"}
@@ -0,0 +1,10 @@
1
+ declare function info(...args: any[]): void;
2
+ declare function warn(...args: any[]): void;
3
+ declare function error(...args: any[]): void;
4
+ declare const _default: {
5
+ info: typeof info;
6
+ warn: typeof warn;
7
+ error: typeof error;
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/util/logger.ts"],"names":[],"mappings":"AAEA,iBAAS,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAIlC;AAED,iBAAS,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAIlC;AAED,iBAAS,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAEnC;;;;;;AAED,wBAIC"}
@@ -0,0 +1,7 @@
1
+ import type { ColorRGB } from './colors';
2
+ /**
3
+ * Convert a ColorRGB tuple to a CSS string definition.
4
+ * Converts white lines to black as the default.
5
+ */
6
+ export default function rgbToColorAttribute(rgb: ColorRGB): string;
7
+ //# sourceMappingURL=rgbToColorAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rgbToColorAttribute.d.ts","sourceRoot":"","sources":["../../src/util/rgbToColorAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAOjE"}
@@ -0,0 +1,9 @@
1
+ import { Point2D } from '../types';
2
+ /**
3
+ * Rotate a point by the given angle.
4
+ *
5
+ * @param p the point
6
+ * @param angle the rotation angle in radians
7
+ */
8
+ export default function rotate(p: Point2D, angle: number): Point2D;
9
+ //# sourceMappingURL=rotate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/util/rotate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKjE"}
@@ -0,0 +1,2 @@
1
+ export default function round10(value: number, exp?: number): number;
2
+ //# sourceMappingURL=round10.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"round10.d.ts","sourceRoot":"","sources":["../../src/util/round10.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAiBnE"}
@@ -0,0 +1,18 @@
1
+ import type { BezierResult, UtilPoint } from '../types/util-types';
2
+ /**
3
+ * For a pinned spline, the knots have to be repeated k times
4
+ * (where k is the order), at both the beginning and the end
5
+ */
6
+ export declare const checkPinned: (k: number, knots: number[]) => void;
7
+ export declare const multiplicity: (knots: number[], index: number) => number;
8
+ /**
9
+ * https://saccade.com/writing/graphics/KnotVectors.pdf
10
+ * A quadratic piecewise Bézier knot vector with seven control points
11
+ * will look like this [0 0 0 1 1 2 2 3 3 3]. In general, in a
12
+ * piecewise Bézier knot vector the first k knots are the same,
13
+ * then each subsequent group of k-1 knots is the same,
14
+ * until you get to the end.
15
+ */
16
+ export declare const computeInsertions: (k: number, knots: number[]) => number[];
17
+ export default function toPiecewiseBezier(k: number, controlPoints: UtilPoint[], knots: number[]): BezierResult;
18
+ //# sourceMappingURL=toPiecewiseBezier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toPiecewiseBezier.d.ts","sourceRoot":"","sources":["../../src/util/toPiecewiseBezier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGlE;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,EAAE,OAAO,MAAM,EAAE,KAAG,IAaxD,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,EAAE,EAAE,OAAO,MAAM,KAAG,MAU7D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,OAAO,MAAM,EAAE,KAAG,MAAM,EAYpE,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,CAAC,EAAE,MAAM,EACT,aAAa,EAAE,SAAS,EAAE,EAC1B,KAAK,EAAE,MAAM,EAAE,GACd,YAAY,CASd"}
@@ -0,0 +1,9 @@
1
+ import { Box2 } from 'vecks';
2
+ import type { Transform, TransformResult } from '../types';
3
+ /**
4
+ * Transform the bounding box and the SVG element by the given
5
+ * transforms. The <g> element are created in reverse transform
6
+ * order and the bounding box in the given order.
7
+ */
8
+ export default function transformBoundingBoxAndElement(bbox: Box2, element: string, transforms: Transform[]): TransformResult;
9
+ //# sourceMappingURL=transformBoundingBoxAndElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformBoundingBoxAndElement.d.ts","sourceRoot":"","sources":["../../src/util/transformBoundingBoxAndElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,EAAE,GACtB,eAAe,CA6DjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkiez/dxf-renew",
3
- "version": "7.1.0",
3
+ "version": "7.2.3",
4
4
  "description": "DXF parser for node/browser",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -32,10 +32,10 @@
32
32
  "prepublishOnly": "npm run lint && npm run type-check && npm run test && npm run clean && npm run build && npm run dist",
33
33
  "prettier": "prettier --write .",
34
34
  "test": "npm run test:unit",
35
- "test:functional": "cd test/functional && webpack-dev-server",
36
- "test:unit": "mocha --require tsx --recursive test/unit/** --extensions .ts,.js",
35
+ "test:functional": "cd test/functional && vite --port 8030 --open /toSVG.html",
36
+ "test:unit": "mocha --require tsx --recursive test/unit/** --extensions .ts",
37
37
  "test:integration": "yarn test:integration:browser",
38
- "test:integration:node": "mocha --require tsx --recursive test/integration/** --extensions .ts,.js",
38
+ "test:integration:node": "mocha --require tsx --recursive test/integration/** --extensions .ts",
39
39
  "test:integration:browser": "yarn dist && playwright test -c playwright.config.cjs",
40
40
  "test:unit:watch": "npm run test:unit -- --watch",
41
41
  "validate:fixtures": "bash -lc 'if [ -x ./.venv-ezdxf/bin/python ]; then ./.venv-ezdxf/bin/python tools/ezdxf_validate_fixtures.py --fail-on-audit-errors; else python3 tools/ezdxf_validate_fixtures.py --fail-on-audit-errors; fi'",
@@ -63,16 +63,12 @@
63
63
  },
64
64
  "homepage": "https://github.com/linkiez/DXF-Renewed",
65
65
  "devDependencies": {
66
- "@babel/core": "^7.28.5",
67
- "@babel/eslint-parser": "^7.25.1",
68
- "@babel/preset-react": "^7.28.5",
69
66
  "@commitlint/cli": "^20.1.0",
70
67
  "@commitlint/config-conventional": "^20.0.0",
71
68
  "@playwright/test": "^1.57.0",
72
69
  "@semantic-release/changelog": "^6.0.3",
73
70
  "@semantic-release/git": "^10.0.1",
74
71
  "@semantic-release/github": "^12.0.2",
75
- "@types/babel__core": "^7",
76
72
  "@types/lodash": "^4.17.20",
77
73
  "@types/node": "^24.10.1",
78
74
  "@typescript-eslint/eslint-plugin": "^8.46.4",
@@ -84,30 +80,20 @@
84
80
  "eslint": "^8.57.0",
85
81
  "eslint-config-prettier": "^8.10.0",
86
82
  "eslint-config-standard": "^17.1.0",
87
- "eslint-config-standard-react": "^13.0.0",
88
83
  "eslint-plugin-import": "^2.29.1",
89
84
  "eslint-plugin-n": "^16.6.2",
90
85
  "eslint-plugin-promise": "^6.6.0",
91
- "eslint-plugin-react": "^7.35.0",
92
- "eslint-plugin-react-hooks": "^4.6.2",
93
86
  "expect": "^29.7.0",
94
87
  "husky": "^9.1.7",
95
88
  "mocha": "^10.7.3",
96
89
  "prettier": "^3.3.3",
97
- "prop-types": "^15.8.1",
98
- "raw-loader": "^4.0.2",
99
- "react": "^16.14.0",
100
- "react-dom": "^16.14.0",
101
- "react-router-dom": "^5.3.4",
102
90
  "rimraf": "^6.0.1",
103
91
  "semantic-release": "^25.0.2",
104
92
  "standard-version": "^9.5.0",
105
93
  "ts-node": "^10.9.2",
106
94
  "tsx": "^4.20.6",
107
95
  "typescript": "^5.9.3",
108
- "webpack": "^5.94.0",
109
- "webpack-cli": "^5.1.4",
110
- "webpack-dev-server": "^4.15.2",
96
+ "vite": "^6.0.6",
111
97
  "xml2js": "^0.6.2"
112
98
  },
113
99
  "dependencies": {
package/src/Helper.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import denormalise from './denormalise'
2
2
  import groupEntitiesByLayer from './groupEntitiesByLayer'
3
3
  import parseString from './parseString'
4
+ import toJson from './toJson'
4
5
  import toPolylines from './toPolylines'
5
6
  import toSVG from './toSVG'
6
7
  import logger from './util/logger'
7
8
 
8
- import type { Entity, LayerGroups, ParsedDXF, ToSVGOptions } from './types'
9
+ import type { Entity, LayerGroups, ParsedDXF, ToJsonOptions, ToSVGOptions } from './types'
9
10
 
10
11
  export default class Helper {
11
12
  private readonly _contents: string
@@ -65,6 +66,10 @@ export default class Helper {
65
66
  return toSVG(this.parsed, options)
66
67
  }
67
68
 
69
+ toJson(options?: ToJsonOptions): string {
70
+ return toJson(this.parsed, options)
71
+ }
72
+
68
73
  toPolylines(): ReturnType<typeof toPolylines> {
69
74
  return toPolylines(this.parsed)
70
75
  }