@linkiez/dxf-renew 7.0.0 → 7.2.0

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 (252) hide show
  1. package/.eslintrc.json +1 -16
  2. package/.github/instructions/code-patterns.instructions.md +1 -1
  3. package/.github/instructions/exdxf.instruction.md +161 -0
  4. package/.github/instructions/tdd.instructions.md +271 -0
  5. package/.yarn/install-state.gz +0 -0
  6. package/ARCHITECTURE.md +163 -0
  7. package/CHANGELOG.md +39 -0
  8. package/CONTRIBUTING.md +16 -14
  9. package/README.md +113 -16
  10. package/{PLAN.md → ROADMAP.md} +244 -102
  11. package/dist/dxf.js +2212 -454
  12. package/docs/EZDXF_REFERENCE_SITEMAP.md +55 -0
  13. package/docs/FIXTURE_VALIDATION_EZDXF.md +62 -0
  14. package/lib/Helper.cjs +6 -2
  15. package/lib/Helper.cjs.map +3 -3
  16. package/lib/Helper.js +6 -2
  17. package/lib/Helper.js.map +2 -2
  18. package/lib/denormalise.cjs +131 -91
  19. package/lib/denormalise.cjs.map +2 -2
  20. package/lib/denormalise.js +131 -91
  21. package/lib/denormalise.js.map +2 -2
  22. package/lib/dimensionToSVG.cjs +318 -53
  23. package/lib/dimensionToSVG.cjs.map +3 -3
  24. package/lib/dimensionToSVG.js +316 -52
  25. package/lib/dimensionToSVG.js.map +2 -2
  26. package/lib/entityToPolyline.cjs +95 -0
  27. package/lib/entityToPolyline.cjs.map +3 -3
  28. package/lib/entityToPolyline.js +95 -0
  29. package/lib/entityToPolyline.js.map +2 -2
  30. package/lib/handlers/entities.cjs +111 -27
  31. package/lib/handlers/entities.cjs.map +3 -3
  32. package/lib/handlers/entities.js +111 -27
  33. package/lib/handlers/entities.js.map +3 -3
  34. package/lib/handlers/entity/dgnUnderlay.cjs +106 -0
  35. package/lib/handlers/entity/dgnUnderlay.cjs.map +7 -0
  36. package/lib/handlers/entity/dgnUnderlay.js +71 -0
  37. package/lib/handlers/entity/dgnUnderlay.js.map +7 -0
  38. package/lib/handlers/entity/dimension.cjs +24 -0
  39. package/lib/handlers/entity/dimension.cjs.map +2 -2
  40. package/lib/handlers/entity/dimension.js +24 -0
  41. package/lib/handlers/entity/dimension.js.map +2 -2
  42. package/lib/handlers/entity/dwfUnderlay.cjs +106 -0
  43. package/lib/handlers/entity/dwfUnderlay.cjs.map +7 -0
  44. package/lib/handlers/entity/dwfUnderlay.js +71 -0
  45. package/lib/handlers/entity/dwfUnderlay.js.map +7 -0
  46. package/lib/handlers/entity/image.cjs +123 -0
  47. package/lib/handlers/entity/image.cjs.map +7 -0
  48. package/lib/handlers/entity/image.js +88 -0
  49. package/lib/handlers/entity/image.js.map +7 -0
  50. package/lib/handlers/entity/leader.cjs +148 -0
  51. package/lib/handlers/entity/leader.cjs.map +7 -0
  52. package/lib/handlers/entity/leader.js +113 -0
  53. package/lib/handlers/entity/leader.js.map +7 -0
  54. package/lib/handlers/entity/mleader.cjs +69 -0
  55. package/lib/handlers/entity/mleader.cjs.map +7 -0
  56. package/lib/handlers/entity/mleader.js +34 -0
  57. package/lib/handlers/entity/mleader.js.map +7 -0
  58. package/lib/handlers/entity/mline.cjs +91 -0
  59. package/lib/handlers/entity/mline.cjs.map +7 -0
  60. package/lib/handlers/entity/mline.js +56 -0
  61. package/lib/handlers/entity/mline.js.map +7 -0
  62. package/lib/handlers/entity/oleframe.cjs +98 -0
  63. package/lib/handlers/entity/oleframe.cjs.map +7 -0
  64. package/lib/handlers/entity/oleframe.js +63 -0
  65. package/lib/handlers/entity/oleframe.js.map +7 -0
  66. package/lib/handlers/entity/pdfUnderlay.cjs +106 -0
  67. package/lib/handlers/entity/pdfUnderlay.cjs.map +7 -0
  68. package/lib/handlers/entity/pdfUnderlay.js +71 -0
  69. package/lib/handlers/entity/pdfUnderlay.js.map +7 -0
  70. package/lib/handlers/entity/ray.cjs +81 -0
  71. package/lib/handlers/entity/ray.cjs.map +7 -0
  72. package/lib/handlers/entity/ray.js +46 -0
  73. package/lib/handlers/entity/ray.js.map +7 -0
  74. package/lib/handlers/entity/region.cjs +67 -0
  75. package/lib/handlers/entity/region.cjs.map +7 -0
  76. package/lib/handlers/entity/region.js +32 -0
  77. package/lib/handlers/entity/region.js.map +7 -0
  78. package/lib/handlers/entity/shape.cjs +95 -0
  79. package/lib/handlers/entity/shape.cjs.map +7 -0
  80. package/lib/handlers/entity/shape.js +60 -0
  81. package/lib/handlers/entity/shape.js.map +7 -0
  82. package/lib/handlers/entity/table.cjs +71 -0
  83. package/lib/handlers/entity/table.cjs.map +7 -0
  84. package/lib/handlers/entity/table.js +36 -0
  85. package/lib/handlers/entity/table.js.map +7 -0
  86. package/lib/handlers/entity/tolerance.cjs +90 -0
  87. package/lib/handlers/entity/tolerance.cjs.map +7 -0
  88. package/lib/handlers/entity/tolerance.js +55 -0
  89. package/lib/handlers/entity/tolerance.js.map +7 -0
  90. package/lib/handlers/entity/trace.cjs +101 -0
  91. package/lib/handlers/entity/trace.cjs.map +7 -0
  92. package/lib/handlers/entity/trace.js +66 -0
  93. package/lib/handlers/entity/trace.js.map +7 -0
  94. package/lib/handlers/entity/wipeout.cjs +122 -0
  95. package/lib/handlers/entity/wipeout.cjs.map +7 -0
  96. package/lib/handlers/entity/wipeout.js +87 -0
  97. package/lib/handlers/entity/wipeout.js.map +7 -0
  98. package/lib/handlers/entity/xline.cjs +81 -0
  99. package/lib/handlers/entity/xline.cjs.map +7 -0
  100. package/lib/handlers/entity/xline.js +46 -0
  101. package/lib/handlers/entity/xline.js.map +7 -0
  102. package/lib/handlers/objects.cjs +299 -136
  103. package/lib/handlers/objects.cjs.map +2 -2
  104. package/lib/handlers/objects.js +299 -136
  105. package/lib/handlers/objects.js.map +2 -2
  106. package/lib/handlers/tables.cjs +96 -17
  107. package/lib/handlers/tables.cjs.map +2 -2
  108. package/lib/handlers/tables.js +96 -17
  109. package/lib/handlers/tables.js.map +2 -2
  110. package/lib/index.cjs +5 -2
  111. package/lib/index.cjs.map +3 -3
  112. package/lib/index.js +18 -16
  113. package/lib/index.js.map +3 -3
  114. package/lib/toJson.cjs +29 -0
  115. package/lib/toJson.cjs.map +7 -0
  116. package/lib/toJson.js +9 -0
  117. package/lib/toJson.js.map +7 -0
  118. package/lib/toSVG.cjs +105 -11
  119. package/lib/toSVG.cjs.map +3 -3
  120. package/lib/toSVG.js +106 -12
  121. package/lib/toSVG.js.map +2 -2
  122. package/lib/types/dimension-entity.cjs.map +1 -1
  123. package/lib/types/entity.cjs.map +1 -1
  124. package/lib/types/helper.cjs.map +1 -1
  125. package/lib/types/image-entity.cjs +17 -0
  126. package/lib/types/image-entity.cjs.map +7 -0
  127. package/lib/types/image-entity.js +1 -0
  128. package/lib/types/image-entity.js.map +7 -0
  129. package/lib/types/index.cjs +28 -0
  130. package/lib/types/index.cjs.map +2 -2
  131. package/lib/types/index.js +14 -0
  132. package/lib/types/index.js.map +2 -2
  133. package/lib/types/leader-entity.cjs +17 -0
  134. package/lib/types/leader-entity.cjs.map +7 -0
  135. package/lib/types/leader-entity.js +1 -0
  136. package/lib/types/leader-entity.js.map +7 -0
  137. package/lib/types/mleader-entity.cjs +17 -0
  138. package/lib/types/mleader-entity.cjs.map +7 -0
  139. package/lib/types/mleader-entity.js +1 -0
  140. package/lib/types/mleader-entity.js.map +7 -0
  141. package/lib/types/mline-entity.cjs +17 -0
  142. package/lib/types/mline-entity.cjs.map +7 -0
  143. package/lib/types/mline-entity.js +1 -0
  144. package/lib/types/mline-entity.js.map +7 -0
  145. package/lib/types/oleframe-entity.cjs +17 -0
  146. package/lib/types/oleframe-entity.cjs.map +7 -0
  147. package/lib/types/oleframe-entity.js +1 -0
  148. package/lib/types/oleframe-entity.js.map +7 -0
  149. package/lib/types/options.cjs.map +1 -1
  150. package/lib/types/ray-entity.cjs +17 -0
  151. package/lib/types/ray-entity.cjs.map +7 -0
  152. package/lib/types/ray-entity.js +1 -0
  153. package/lib/types/ray-entity.js.map +7 -0
  154. package/lib/types/region-entity.cjs +17 -0
  155. package/lib/types/region-entity.cjs.map +7 -0
  156. package/lib/types/region-entity.js +1 -0
  157. package/lib/types/region-entity.js.map +7 -0
  158. package/lib/types/shape-entity.cjs +17 -0
  159. package/lib/types/shape-entity.cjs.map +7 -0
  160. package/lib/types/shape-entity.js +1 -0
  161. package/lib/types/shape-entity.js.map +7 -0
  162. package/lib/types/table-entity.cjs +17 -0
  163. package/lib/types/table-entity.cjs.map +7 -0
  164. package/lib/types/table-entity.js +1 -0
  165. package/lib/types/table-entity.js.map +7 -0
  166. package/lib/types/tables.cjs.map +1 -1
  167. package/lib/types/tolerance-entity.cjs +17 -0
  168. package/lib/types/tolerance-entity.cjs.map +7 -0
  169. package/lib/types/tolerance-entity.js +1 -0
  170. package/lib/types/tolerance-entity.js.map +7 -0
  171. package/lib/types/trace-entity.cjs +17 -0
  172. package/lib/types/trace-entity.cjs.map +7 -0
  173. package/lib/types/trace-entity.js +1 -0
  174. package/lib/types/trace-entity.js.map +7 -0
  175. package/lib/types/underlay-entity.cjs +17 -0
  176. package/lib/types/underlay-entity.cjs.map +7 -0
  177. package/lib/types/underlay-entity.js +1 -0
  178. package/lib/types/underlay-entity.js.map +7 -0
  179. package/lib/types/wipeout-entity.cjs +17 -0
  180. package/lib/types/wipeout-entity.cjs.map +7 -0
  181. package/lib/types/wipeout-entity.js +1 -0
  182. package/lib/types/wipeout-entity.js.map +7 -0
  183. package/lib/types/xline-entity.cjs +17 -0
  184. package/lib/types/xline-entity.cjs.map +7 -0
  185. package/lib/types/xline-entity.js +1 -0
  186. package/lib/types/xline-entity.js.map +7 -0
  187. package/lib/util/escapeXmlText.cjs +27 -0
  188. package/lib/util/escapeXmlText.cjs.map +7 -0
  189. package/lib/util/escapeXmlText.js +7 -0
  190. package/lib/util/escapeXmlText.js.map +7 -0
  191. package/package.json +9 -18
  192. package/playwright.config.cjs +20 -0
  193. package/src/Helper.ts +8 -3
  194. package/src/denormalise.ts +182 -116
  195. package/src/dimensionToSVG.ts +466 -54
  196. package/src/entityToPolyline.ts +124 -2
  197. package/src/handlers/entities.ts +129 -34
  198. package/src/handlers/entity/dgnUnderlay.ts +94 -0
  199. package/src/handlers/entity/dimension.ts +27 -1
  200. package/src/handlers/entity/dwfUnderlay.ts +94 -0
  201. package/src/handlers/entity/image.ts +118 -0
  202. package/src/handlers/entity/leader.ts +153 -0
  203. package/src/handlers/entity/mleader.ts +46 -0
  204. package/src/handlers/entity/mline.ts +74 -0
  205. package/src/handlers/entity/oleframe.ts +62 -0
  206. package/src/handlers/entity/pdfUnderlay.ts +94 -0
  207. package/src/handlers/entity/ray.ts +52 -0
  208. package/src/handlers/entity/region.ts +42 -0
  209. package/src/handlers/entity/shape.ts +73 -0
  210. package/src/handlers/entity/table.ts +49 -0
  211. package/src/handlers/entity/tolerance.ts +75 -0
  212. package/src/handlers/entity/trace.ts +72 -0
  213. package/src/handlers/entity/wipeout.ts +114 -0
  214. package/src/handlers/entity/xline.ts +52 -0
  215. package/src/handlers/objects.ts +379 -139
  216. package/src/handlers/tables.ts +134 -21
  217. package/src/index.ts +9 -18
  218. package/src/toJson.ts +8 -0
  219. package/src/toSVG.ts +143 -10
  220. package/src/types/dimension-entity.ts +11 -0
  221. package/src/types/entity.ts +30 -0
  222. package/src/types/helper.ts +2 -1
  223. package/src/types/image-entity.ts +35 -0
  224. package/src/types/index.ts +14 -0
  225. package/src/types/leader-entity.ts +40 -0
  226. package/src/types/mleader-entity.ts +8 -0
  227. package/src/types/mline-entity.ts +12 -0
  228. package/src/types/oleframe-entity.ts +40 -0
  229. package/src/types/options.ts +48 -0
  230. package/src/types/ray-entity.ts +12 -0
  231. package/src/types/region-entity.ts +11 -0
  232. package/src/types/shape-entity.ts +19 -0
  233. package/src/types/table-entity.ts +14 -0
  234. package/src/types/tables.ts +160 -0
  235. package/src/types/tolerance-entity.ts +20 -0
  236. package/src/types/trace-entity.ts +14 -0
  237. package/src/types/underlay-entity.ts +35 -0
  238. package/src/types/wipeout-entity.ts +20 -0
  239. package/src/types/xline-entity.ts +12 -0
  240. package/src/util/escapeXmlText.ts +10 -0
  241. package/tools/browser_test_server.cjs +87 -0
  242. package/tools/ezdxf_generate_dimensions_all_types.py +246 -0
  243. package/tools/ezdxf_generate_dimensions_angular_3p.py +59 -0
  244. package/tools/ezdxf_generate_dimensions_large_scale.py +87 -0
  245. package/tools/ezdxf_regenerate_problem_fixtures.py +184 -0
  246. package/tools/ezdxf_validate_fixtures.py +165 -0
  247. package/docs/DIMENSION_SUMMARY.md +0 -248
  248. package/docs/DIMENSION_SUMMARY.pt-BR.md +0 -248
  249. package/docs/IMPLEMENTED-2D-ENTITIES.md +0 -54
  250. package/docs/IMPLEMENTED-2D-ENTITIES.pt-BR.md +0 -54
  251. package/docs/TEXT-MTEXT-DIMENSION-SUPPORT.md +0 -241
  252. package/docs/TEXT-MTEXT-DIMENSION-SUPPORT.pt-BR.md +0 -169
package/CONTRIBUTING.md CHANGED
@@ -36,18 +36,20 @@ Antes de reportar um bug, verifique se já existe uma issue aberta sobre o probl
36
36
  ### Pull Requests
37
37
 
38
38
  1. Fork o repositório
39
- 2. Crie uma branch a partir de `develop`:
39
+ 2. Crie uma branch a partir de `main`:
40
+
40
41
  ```bash
41
- git checkout develop
42
+ git checkout main
42
43
  git checkout -b feature/sua-feature
43
44
  ```
45
+
44
46
  3. Faça suas mudanças seguindo o [Padrão de Commits](#padrão-de-commits)
45
47
  4. Execute os testes: `yarn test`
46
48
  5. Execute o linter: `yarn lint`
47
49
  6. Execute a build: `yarn build`
48
50
  7. Commit suas mudanças (o commitlint validará automaticamente)
49
51
  8. Push para sua branch
50
- 9. Abra um Pull Request para `develop`
52
+ 9. Abra um Pull Request para `main`
51
53
 
52
54
  ## Padrão de Commits
53
55
 
@@ -55,7 +57,7 @@ Este projeto utiliza [Conventional Commits](https://www.conventionalcommits.org/
55
57
 
56
58
  ### Formato
57
59
 
58
- ```
60
+ ```text
59
61
  <type>(<scope>): <subject>
60
62
 
61
63
  [optional body]
@@ -81,7 +83,7 @@ Este projeto utiliza [Conventional Commits](https://www.conventionalcommits.org/
81
83
 
82
84
  To indicate a breaking change (generates MAJOR release):
83
85
 
84
- ```
86
+ ```text
85
87
  feat: allow provided config object to extend other configs
86
88
 
87
89
  BREAKING CHANGE: `extends` key in config file is now used
@@ -90,7 +92,7 @@ to extend other config files
90
92
 
91
93
  Or use `!` after the type:
92
94
 
93
- ```
95
+ ```text
94
96
  feat!: remove support for Node 6
95
97
  ```
96
98
 
@@ -139,7 +141,7 @@ This will open an interactive prompt to create the commit in the correct format.
139
141
  O projeto usa [semantic-release](https://semantic-release.gitbook.io/) para releases automáticos:
140
142
 
141
143
  1. Faça commits seguindo o padrão Conventional Commits
142
- 2. Faça merge do PR para `main`, `develop` ou `beta`
144
+ 2. Faça merge do PR para `main`
143
145
  3. O GitHub Actions automaticamente:
144
146
  * Analisa os commits desde o último release
145
147
  * Determina o novo número de versão (MAJOR.MINOR.PATCH)
@@ -151,8 +153,6 @@ O projeto usa [semantic-release](https://semantic-release.gitbook.io/) para rele
151
153
  ### Branches
152
154
 
153
155
  * **main**: Releases estáveis de produção
154
- * **develop**: Pre-releases (versões beta)
155
- * **beta**: Pre-releases específicas para testes
156
156
 
157
157
  ### Versionamento
158
158
 
@@ -220,7 +220,7 @@ yarn semantic-release # Executar semantic-release
220
220
 
221
221
  ### Estrutura do Projeto
222
222
 
223
- ```
223
+ ```text
224
224
  dxf/
225
225
  ├── src/ # Código-fonte TypeScript
226
226
  │ ├── handlers/ # Parsers de entidades e tabelas
@@ -238,15 +238,17 @@ dxf/
238
238
  ### Workflow de Desenvolvimento
239
239
 
240
240
  1. **Crie uma issue** descrevendo o que você vai fazer
241
- 2. **Crie uma branch** a partir de `develop`:
241
+ 2. **Crie uma branch** a partir de `main`:
242
+
242
243
  ```bash
243
- git checkout develop
244
- git pull origin develop
244
+ git checkout main
245
+ git pull origin main
245
246
  git checkout -b feat/minha-feature
246
247
  ```
248
+
247
249
  3. **Faça suas mudanças** com commits seguindo o padrão
248
250
  4. **Execute os testes** localmente
249
- 5. **Push e crie um PR** para `develop`
251
+ 5. **Push e crie um PR** para `main`
250
252
  6. **Aguarde a revisão** e responda aos comentários
251
253
  7. **Após merge**, o release será feito automaticamente
252
254
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
+ # DXF-Renewed
2
+
1
3
  [![Build Status](https://travis-ci.org/bjnortier/dxf.svg?branch=master)](https://travis-ci.org/bjnortier/dxf)
2
4
  [![semantic-release: conventionalcommits](https://img.shields.io/badge/semantic--release-conventionalcommits-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
3
5
 
4
- # DXF-Renewed
5
-
6
6
  > **⚠️ WARNING: This repository is currently under development and has not been fully tested in production. Use at your own risk.**
7
7
 
8
8
  DXF parser for node/browser.
@@ -11,6 +11,39 @@ Written in **TypeScript** with full type definitions included. Uses modern ES201
11
11
 
12
12
  > **Note:** This is a renewed and modernized fork of the original [dxf](https://github.com/skymakerolof/dxf) library, with complete TypeScript migration, enhanced performance, and additional features.
13
13
 
14
+ ## TL;DR
15
+
16
+ - Parse: `parseString(dxfText)` → typed `ParsedDXF`
17
+ - Expand blocks: `denormalise(parsed)` → flat `Entity[]` with transforms
18
+ - Render/export:
19
+ - `toSVG(parsed)` → SVG string
20
+ - `toPolylines(parsed)` → numeric polyline arrays
21
+ - `toJson(parsed)` → JSON string
22
+
23
+ ## Features
24
+
25
+ - TypeScript-first public API (strict typing)
26
+ - Deterministic parsing + regression coverage via real DXF fixtures
27
+ - INSERT/BLOCK expansion (denormalisation) with transform stacking
28
+ - SVG rendering for common 2D geometry + annotation entities
29
+ - Polyline output for custom renderers (Canvas/WebGL/etc.)
30
+ - Framework-agnostic (no React/Webpack required)
31
+
32
+ ## Documentation
33
+
34
+ - Project roadmap and progress: [ROADMAP.md](./ROADMAP.md)
35
+ - Architecture overview: [ARCHITECTURE.md](./ARCHITECTURE.md)
36
+
37
+ ## Table of Contents
38
+
39
+ - [Version History](#version-history)
40
+ - [Supported Entities](#supported-entities)
41
+ - [Getting started](#getting-started)
42
+ - [API](#api)
43
+ - [Running the Examples](#running-the-examples)
44
+ - [Tests](#tests)
45
+ - [Build System](#build-system)
46
+
14
47
  ## Version History
15
48
 
16
49
  **Version 2.0** - Complete rewrite from SAX-style parsing to handle nested references properly (inserts, blocks, etc.)
@@ -24,15 +57,15 @@ Written in **TypeScript** with full type definitions included. Uses modern ES201
24
57
  - 🎯 Full TypeScript codebase with strict type checking
25
58
  - ⚡ Built with esbuild (96% faster than Babel - 18ms vs 447ms)
26
59
  - 📦 Modular type system with 22+ separate type files
27
- - ✅ 100% test coverage maintained (85 tests passing)
60
+ - ✅ Extensive unit tests and browser integration tests
28
61
  - 🎨 Enhanced SVG rendering with TEXT, MTEXT, and DIMENSION support
29
62
  - 📚 Comprehensive type definitions for all DXF entities
30
63
 
31
64
  ## Supported Entities
32
65
 
33
- All major geometric entities are **parsed and rendered to SVG**:
66
+ Many common DXF entities are **parsed and rendered to SVG**. Some entities are parsed but currently skipped during SVG rendering.
34
67
 
35
- ### Fully Supported
68
+ ### Rendered to SVG
36
69
 
37
70
  - ✅ **LINE** - Straight line segments
38
71
  - ✅ **CIRCLE** - Native SVG `<circle />` element
@@ -44,16 +77,23 @@ All major geometric entities are **parsed and rendered to SVG**:
44
77
  - ✅ **TEXT** - Single-line text with rotation
45
78
  - ✅ **MTEXT** - Multi-line text with formatting
46
79
  - ✅ **DIMENSION** - Linear, aligned, radial, diameter, and ordinate dimensions
47
- - ✅ **INSERT** - Block references with transformations
48
- - ✅ **POINT** - Point entities
49
80
  - ✅ **SOLID** - Solid-filled triangles and quadrilaterals
50
- - ✅ **3DFACE** - 3D face entities
81
+ - ✅ **TRACE** - Rendered as a filled path outline
82
+ - ✅ **RAY/XLINE** - Rendered as polylines
83
+ - ✅ **WIPEOUT** - Rendered as outline fallback
84
+ - ✅ **LEADER** - Rendered as an SVG path (basic)
85
+ - ✅ **TOLERANCE** - Rendered with SVG text fallback
86
+ - ✅ **SHAPE** - Rendered with SVG text fallback
87
+
88
+ > **INSERT note:** INSERT is supported via denormalisation. The library expands INSERT entities into their referenced BLOCK contents and then renders the resulting entities with transforms applied.
51
89
 
52
90
  ### Parsed (Not Rendered)
53
91
 
54
- - ⚠️ **HATCH** - Parsed but not rendered to SVG
55
- - ⚠️ **STYLE** - Text styles parsed (colors supported, fonts not applied)
92
+ - ⚠️ **POINT** - Parsed but currently not rendered to SVG
93
+ - ⚠️ **3DFACE** - Parsed but currently not rendered to SVG
94
+ - ⚠️ **HATCH** - Parsed but currently not rendered to SVG
56
95
  - ⚠️ **ATTDEF/ATTRIB** - Block attributes parsed
96
+ - ⚠️ **Text styles (STYLE table)** - Parsed (colors supported; fonts are not applied to SVG)
57
97
 
58
98
  ## Getting started
59
99
 
@@ -75,6 +115,9 @@ console.log('svg:', helper.toSVG())
75
115
 
76
116
  // Create polylines (e.g. to render in WebGL)
77
117
  console.log('polylines:', helper.toPolylines())
118
+
119
+ // Create a JSON representation (1-to-1 with the parsed model)
120
+ console.log('json:', helper.toJson({ pretty: true }))
78
121
  ```
79
122
 
80
123
  JavaScript example:
@@ -95,8 +138,28 @@ console.log('svg:', helper.toSVG())
95
138
 
96
139
  // Create polylines (e.g. to render in WebGL)
97
140
  console.log('polylines:', helper.toPolylines())
141
+
142
+ // Create a JSON representation (1-to-1 with the parsed model)
143
+ console.log('json:', helper.toJson({ pretty: true }))
98
144
  ```
99
145
 
146
+ ## API
147
+
148
+ The public API is exported from `src/index.ts`.
149
+
150
+ - `parseString(dxfText: string): ParsedDXF`
151
+ - Parse DXF text into a typed model.
152
+ - `denormalise(parsed: ParsedDXF): Entity[]`
153
+ - Expand `INSERT` entities into their referenced `BLOCK` contents.
154
+ - `toSVG(parsed: ParsedDXF, options?): string`
155
+ - Render the drawing to an SVG string.
156
+ - `toPolylines(parsed: ParsedDXF, options?): any[]`
157
+ - Convert supported entities to polyline arrays.
158
+ - `toJson(parsed: ParsedDXF, options?): string`
159
+ - Serialize the parsed model as JSON.
160
+ - `Helper`
161
+ - Convenience wrapper that exposes `parsed`, `denormalised`, plus `toSVG()`, `toPolylines()`, and `toJson()`.
162
+
100
163
  ## Running the Examples
101
164
 
102
165
  There are examples in the `examples/` directory.
@@ -148,6 +211,34 @@ Here's an example you will find in the functional test output:
148
211
 
149
212
  ![svg example image](https://cloud.githubusercontent.com/assets/57994/17583566/e00f5d78-5fb1-11e6-9030-55686f980e6f.png)
150
213
 
214
+ ### DIMENSION auto-scaling
215
+
216
+ DIMENSION rendering supports viewport-based auto-scaling so that arrows and text remain readable across different coordinate scales.
217
+
218
+ ```ts
219
+ import { Helper } from '@linkiez/dxf-renew'
220
+
221
+ const helper = new Helper(dxfString)
222
+
223
+ const svg = helper.toSVG({
224
+ dimension: {
225
+ autoScale: true,
226
+ // Reference used when percentages are not provided.
227
+ autoScaleViewportReference: 40,
228
+ // Optional per-element overrides as a percentage (0..100)
229
+ // of min(viewBoxWidth, viewBoxHeight).
230
+ autoScaleViewportPercentages: {
231
+ arrowSize: 1.5,
232
+ textHeight: 1
233
+ }
234
+ }
235
+ })
236
+ ```
237
+
238
+ When `autoScaleViewportPercentages` is provided (and `autoScale` is enabled), the final size for each configured element is computed as:
239
+
240
+ `size = min(viewBoxWidth, viewBoxHeight) * (percent / 100)`
241
+
151
242
  ## Interpolation
152
243
 
153
244
  The library supports outputting DXFs as interpolated polylines for custom rendering (e.g. WebGL) or other applications:
@@ -189,17 +280,25 @@ Running the unit tests:
189
280
  yarn test
190
281
  ```
191
282
 
283
+ Running the browser integration tests (Playwright):
284
+
285
+ ```bash
286
+ yarn test:integration:browser
287
+ ```
288
+
289
+ These tests render fixtures in a real browser and write deterministic PNG screenshots under `test/rendered/` (overwritten on each run).
290
+
192
291
  Running the functional tests in a browser:
193
292
 
194
293
  ```bash
195
294
  yarn test:functional
196
295
  ```
197
296
 
198
- Please open `toSVG.html` when the file listing loads in the browser (or open `http://localhost:8030/toSVG.html#/`).
297
+ This starts a Vite dev server and opens `http://localhost:8030/toSVG.html`.
199
298
 
200
299
  ## Development Guidelines
201
300
 
202
- - Code patterns and best practices: `docs/CODE_PATTERNS.md`
301
+ Project documentation index: `ROADMAP.md` (see “Documentation (Consolidated)”).
203
302
 
204
303
  ## TypeScript Support
205
304
 
@@ -251,8 +350,6 @@ This project uses [semantic-release](https://semantic-release.gitbook.io/) for a
251
350
  **Releases are automatically created** when commits following [Conventional Commits](https://www.conventionalcommits.org/en/) are pushed to:
252
351
 
253
352
  - `main` - Stable production releases (`1.0.0`, `1.1.0`, `2.0.0`)
254
- - `develop` - Pre-releases for testing (`1.1.0-dev.1`, `1.1.0-dev.2`)
255
- - `beta` - Beta pre-releases (`1.1.0-beta.1`, `1.1.0-beta.2`)
256
353
 
257
354
  ### Commit Format
258
355
 
@@ -276,9 +373,9 @@ To contribute:
276
373
  1. Fork the repository
277
374
  2. Make commits using `yarn commit` (interactive) or following Conventional Commits
278
375
  3. Push to your fork
279
- 4. Open a Pull Request to `develop`
376
+ 4. Open a Pull Request to `main`
280
377
 
281
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines and [docs/SEMANTIC_RELEASE.md](./docs/SEMANTIC_RELEASE.md) for release documentation.
378
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
282
379
 
283
380
  ## Contributors
284
381