draftwright 0.1.6__tar.gz → 0.1.8__tar.gz

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 (24) hide show
  1. draftwright-0.1.8/CHANGELOG.md +205 -0
  2. {draftwright-0.1.6 → draftwright-0.1.8}/PKG-INFO +1 -1
  3. {draftwright-0.1.6 → draftwright-0.1.8}/pyproject.toml +1 -1
  4. {draftwright-0.1.6 → draftwright-0.1.8}/src/draftwright/make_drawing.py +669 -186
  5. {draftwright-0.1.6 → draftwright-0.1.8}/tests/test_e2e_standards.py +6 -6
  6. {draftwright-0.1.6 → draftwright-0.1.8}/tests/test_make_drawing.py +516 -12
  7. draftwright-0.1.6/CHANGELOG.md +0 -77
  8. {draftwright-0.1.6 → draftwright-0.1.8}/.gitignore +0 -0
  9. {draftwright-0.1.6 → draftwright-0.1.8}/LICENSE +0 -0
  10. {draftwright-0.1.6 → draftwright-0.1.8}/README.md +0 -0
  11. {draftwright-0.1.6 → draftwright-0.1.8}/skills/SKILL.md +0 -0
  12. {draftwright-0.1.6 → draftwright-0.1.8}/src/draftwright/__init__.py +0 -0
  13. {draftwright-0.1.6 → draftwright-0.1.8}/src/draftwright/pmi.py +0 -0
  14. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_01_asme1_ap203.stp +0 -0
  15. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_01_asme1_ap242.stp +0 -0
  16. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_02_asme1_ap203.stp +0 -0
  17. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_02_asme1_ap242.stp +0 -0
  18. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_03_asme1_ap203.stp +0 -0
  19. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_03_asme1_ap242.stp +0 -0
  20. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_04_asme1_ap203.stp +0 -0
  21. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_04_asme1_ap242.stp +0 -0
  22. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_05_asme1_ap203.stp +0 -0
  23. {draftwright-0.1.6 → draftwright-0.1.8}/tests/fixtures/nist_ctc_05_asme1_ap242.stp +0 -0
  24. {draftwright-0.1.6 → draftwright-0.1.8}/tests/test_pmi.py +0 -0
@@ -0,0 +1,205 @@
1
+ # Changelog
2
+
3
+ ## v0.1.8 — 2026-06-16
4
+
5
+ ### Changed
6
+
7
+ - **Automatic scale selection now minimises the sheet size.** The preference
8
+ ladder is page-major: every standard scale on the smallest sheet is tried
9
+ before the next sheet up, so a part lands on the smallest sheet it fits at the
10
+ largest scale that sheet allows. A 20 × 15 × 10 mm part is now drawn 2:1 on A4
11
+ instead of 5:1 on A3 — a smaller sheet is preferred over a larger enlargement
12
+ scale. Reductions keep their legibility-first balance, so a too-big part is
13
+ not over-reduced onto a small sheet.
14
+ - **A specified page now enlarges to the best fitting scale.** When the caller
15
+ fixes the page (`--page A3`) or scale, scale selection packs the isometric
16
+ view into the largest empty rectangle the placement engine actually uses (it
17
+ may sit in vertical headroom above the views), instead of charging it a column
18
+ in the view row. A long, short part — e.g. a 100 × 10 × 11 mm staircase — now
19
+ fills a requested A3 at 2:1 where it was previously under-scaled to 1:1.
20
+ Automatic selection (no page/scale given) keeps the conservative row model,
21
+ which reserves enough room to place every annotation rather than dropping some
22
+ onto a tighter sheet (staircase review).
23
+ - **Isometric view growth is capped.** The iso is fitted to fill its zone but no
24
+ longer grows past 1.3× sheet scale; on an oversized sheet it could previously
25
+ balloon to ~8× and dwarf the dimensioned orthographic views. Shrinking to fit
26
+ a small zone is unchanged.
27
+ - **Step heights are dimensioned only where legibly separable.** After the
28
+ adaptive cap (#36), a part with many closely-spaced shoulders (e.g. NIST
29
+ CTC-02 at 1:5) tried to dimension faces only ~1 mm apart on the page. A step
30
+ is now dimensioned only if it is both tall enough from the base *and* at least
31
+ one legible step-height above the previously dimensioned one; the rest surface
32
+ as `step_dim_dropped` (use a detail view). "Fits" is not the same as
33
+ "legible" (#41).
34
+ - **Hole-location dimensions are gated for legibility.** A hole-dense part (e.g.
35
+ NIST CTC-02, ~38 distinct hole locations) previously stacked every location
36
+ reference into a tall, busy tower above the views — "fits" is not "legible".
37
+ Each axis's references are now gated by inter-dimension page spacing
38
+ (`_legible_locations`, analogous to the step-height gate #41): only locations
39
+ at least one value-label footprint apart on the page are dimensioned; the rest
40
+ surface as `location_ref_dropped` (full fidelity belongs in a detail view,
41
+ #42). Sparse parts are unchanged (#43).
42
+ - **Tighter location-dimension tier pitch.** The vertical pitch between stacked
43
+ X/Y location dimensions is now derived from the label footprint
44
+ (`font_size + 2·pad_around_text`, ≈7 mm) instead of a looser `font_size·3`,
45
+ so location stacks pack closer (#41).
46
+
47
+ ### Fixed
48
+
49
+ - **Phantom step corridor no longer blocks a larger scale.** Page/scale
50
+ selection reserved a step-ladder corridor sized for *every* candidate
51
+ horizontal face, including ones the legibility gate would never dimension. A
52
+ part with many sub-legible faces (e.g. a staircase with 15 tiny treads) was
53
+ forced onto an oversized sheet at 1:1. Scale selection now iterates so the
54
+ reserved corridor matches the step count actually placed, freeing the part to
55
+ pick a tighter sheet (staircase.step review).
56
+ - **Engraved-text faces are no longer dimensioned as steps.** `analyse_face_levels`
57
+ gained a `min_area_frac` filter; a horizontal face counts as a step only if
58
+ its area is at least 1% of the part's plan footprint. This drops sub-feature
59
+ faces (fragments of engraved numbers/text) that were surfacing as phantom
60
+ shoulders — e.g. a 0.57 mm² digit face dimensioned as z=6.4 on staircase.step.
61
+ - **Overall-height dimension nests outside the step dims.** The overall height
62
+ is now placed last on the front view's right ladder so it sits outermost, with
63
+ the step-height dims inside it; extension lines nest instead of leapfrogging
64
+ (staircase.step review).
65
+
66
+ ## v0.1.7 — 2026-06-15
67
+
68
+ ### Added
69
+
70
+ - `Drawing.lint_summary()` — a JSON-friendly aggregate of `lint()` for
71
+ non-interactive callers (scripts, or an LLM via the API): severity counts,
72
+ per-code counts, a `geometry_issues` tally (standards/geometry checks vs pure
73
+ layout), a `passed` flag, a coarse 0–1 `score`, and the full issue list. Gives
74
+ a single signal to gate and optimise on without rendering the SVG (#32).
75
+
76
+ ### Changed
77
+
78
+ - **Adaptive annotation placement.** The three hard-coded cardinality caps —
79
+ four hole callouts per view, four hole location references per part, and three
80
+ step-height dimensions — are removed. The engine now places as many as the
81
+ available strip/corridor space allows (callouts largest-first, locations
82
+ nearest-datum-first, every legible step), so a part with room is dimensioned
83
+ completely instead of dropped to an arbitrary count. An annotation that
84
+ genuinely doesn't fit is never force-placed; it surfaces via lint
85
+ (`callout_dropped` / `location_ref_dropped`, warning severity). On the NIST
86
+ CTC parts this raises coverage substantially (e.g. CTC-02: 4 → 36 location
87
+ dimensions, 4 → 9 callouts) with no error-severity lint (#36).
88
+ - **No silent annotation drops.** Every place the layout has to drop an
89
+ annotation now records a machine-readable lint issue, surfaced by `lint()`,
90
+ so a short drawing always carries a reason. A dropped callout names its
91
+ diameter and is excluded from `feature_not_dimensioned` (no double-report).
92
+ `placement_unsatisfiable` (error severity) is reserved for the degenerate
93
+ case where space was reserved but an annotation still could not be placed
94
+ (#32).
95
+ - **Layout constants derived from first principles.** Bare, fixture-tuned
96
+ constants (strip slot widths, callout label widths, isometric fit factor) are
97
+ now computed from text metrics and page size rather than hard-coded, so the
98
+ layout generalises to unseen geometry instead of fitting the test cases (#31).
99
+ - `_auto_annotate` clears its build-time lint records on re-entry, and repeated
100
+ `lint()` calls are stable (#32).
101
+
102
+ ### Fixed
103
+
104
+ - AP242 / PMI STEP import segfault: STEP geometry is now read directly via
105
+ `STEPControl_Reader`, avoiding the XCAF/PMI read that crashed (SIGSEGV) on
106
+ with-PMI files such as NIST CTC-02 (#20).
107
+
108
+ ### Tests
109
+
110
+ - Overfitting guards pin the general layout behaviour on turned/hybrid parts
111
+ (flange OD + bolt circle), multi-bore parts, and the step-legibility boundary
112
+ (#13).
113
+ - The full NIST CTC set (AP203 and AP242) builds and is covered by the slow
114
+ end-to-end tier.
115
+
116
+ ## v0.1.6 — 2026-06-15
117
+
118
+ ### Fixed
119
+
120
+ - Section-view boolean cut on cast geometry: the exact `body - Box(...)` boolean
121
+ raised an uncatchable `Standard_DomainError` (C++ abort, SIGABRT) on some parts
122
+ (NIST CTC-04), crashing the whole drawing. `_fuzzy_cut()` now runs
123
+ `BRepAlgoAPI_Cut` with a small fuzzy tolerance and keeps solids-only, making
124
+ the section cut robust (#20, #22).
125
+
126
+ ### Tests
127
+
128
+ - NIST CTC-04 (both AP203 and AP242) now build with a clean section view and are
129
+ covered by the CTC build tests.
130
+ - Known: CTC-02 AP242 still segfaults inside OCCT's AP242/PMI STEP read (#20),
131
+ excluded from build tests.
132
+
133
+ ## v0.1.5 — 2026-06-15
134
+
135
+ ### Fixed
136
+
137
+ - CTC-02 spurious full-page line: build123d's `ExportSVG` projected
138
+ circle-edge-on edges (hole/fillet rims seen edge-on) as elliptical arcs with
139
+ a near-zero minor radius, which renderers blow up into full-page lines.
140
+ `sanitize_svg_arcs()` rewrites any arc with a sub-1e-3 mm radius into the
141
+ straight line it actually is, leaving real arcs untouched (#19). Not a PMI
142
+ issue — the file is AP203 geometry-only.
143
+
144
+ ### Tests
145
+
146
+ - Added the full NIST CTC set (01–05) as fixtures, both AP203 geometry-only and
147
+ AP242 (with-PMI) variants.
148
+ - Heavy end-to-end CTC fixture builds are marked `slow` and deselected from the
149
+ default `pytest` run (fast normal run, ~4.5 min); CI runs the fast tier across
150
+ the OS/Python matrix and the slow tier once.
151
+ - Known: AP242 CTC-02 and both CTC-04 variants crash OCCT on import (#20); their
152
+ fixtures are excluded from build tests.
153
+
154
+ ## v0.1.4 — 2026-06-15
155
+
156
+ ### Changed
157
+
158
+ - Feature annotations (hole callouts, location dimensions, section view) now
159
+ fire on feature presence independent of the turned/prismatic classification,
160
+ so turned-and-drilled parts (e.g. flanges) get both the OD/centreline base
161
+ set and per-hole callouts plus bolt-circle furniture (#10).
162
+ - Isometric view placement now uses a general largest-empty-rectangle search in
163
+ place of the wide/flat-on-A3 special case (#11).
164
+ - Concentric bore-leader stacking is generalised beyond three, and the
165
+ step-height dimension gate is now a single derived constant (#10, #12).
166
+
167
+ ### Internal
168
+
169
+ - Single-sourced duplicated geometry constants from the draft preset (#12).
170
+ - Minor comment and logging cleanups.
171
+
172
+ ## v0.1.0 — 2026-06-14
173
+
174
+ Initial release — spun out of `build123d-drafting-helpers` v0.9.1.
175
+
176
+ The automated drawing engine (`make_drawing`, `build_drawing`, `Drawing`)
177
+ was previously part of `build123d-drafting-helpers`. It is now a separate
178
+ AGPL-licensed package that depends on `build123d-drafting-helpers>=0.9.1`
179
+ for annotation primitives.
180
+
181
+ ### Migration from build123d-drafting-helpers
182
+
183
+ ```python
184
+ # Before
185
+ from build123d_drafting import make_drawing, Drawing, build_drawing
186
+
187
+ # After
188
+ from draftwright import make_drawing, Drawing, build_drawing
189
+ ```
190
+
191
+ ### Features (carried over from build123d-drafting-helpers)
192
+
193
+ - **`make_drawing`** / **`build_drawing`** — automatic multi-view technical
194
+ drawing from a build123d solid: view layout, scale selection, orthographic
195
+ projection, dimension placement, title block.
196
+ - **`Drawing`** — composable drawing object with `.lint()`, `.add()`,
197
+ `.export_svg()`, `.export_dxf()`.
198
+ - **`choose_scale`** — ISO/ASME standard scale selection.
199
+ - **`lint_feature_coverage`** — checks annotation coverage against detected
200
+ part features (holes, bosses, bolt circles).
201
+ - **Section A–A views** — automatic section view for blind/stepped holes,
202
+ with ISO 128-44 solid filled cutting-plane arrows and ISO 128-50 45°
203
+ hatching on the cut face.
204
+ - **`generate_script`** — generates a standalone drawing script from a STEP
205
+ file.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: draftwright
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Automated technical-drawing generation for build123d
5
5
  Project-URL: Homepage, https://github.com/pzfreo/draftwright
6
6
  Project-URL: Repository, https://github.com/pzfreo/draftwright
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "draftwright"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  description = "Automated technical-drawing generation for build123d"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }