draftwright 0.1.11__tar.gz → 0.1.12__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.
- {draftwright-0.1.11 → draftwright-0.1.12}/CHANGELOG.md +42 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/PKG-INFO +3 -3
- {draftwright-0.1.11 → draftwright-0.1.12}/pyproject.toml +3 -3
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/_core.py +31 -2
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/annotate.py +210 -56
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/make_drawing.py +1146 -173
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/test_e2e_standards.py +40 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/test_make_drawing.py +596 -23
- {draftwright-0.1.11 → draftwright-0.1.12}/.gitignore +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/LICENSE +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/README.md +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/skills/SKILL.md +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/__init__.py +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/layout.py +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/src/draftwright/pmi.py +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_01_asme1_ap203.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_01_asme1_ap242.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_02_asme1_ap203.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_02_asme1_ap242.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_03_asme1_ap203.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_03_asme1_ap242.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_04_asme1_ap203.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_04_asme1_ap242.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_05_asme1_ap203.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/fixtures/nist_ctc_05_asme1_ap242.stp +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/test_layout.py +0 -0
- {draftwright-0.1.11 → draftwright-0.1.12}/tests/test_pmi.py +0 -0
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.1.12 — 2026-06-21
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Requires `build123d-drafting-helpers>=0.12.0`** (#92, #122). draftwright now
|
|
10
|
+
consumes the new sub-clustered hole-pattern recognition, the
|
|
11
|
+
`feature_diameters()` coverage inventory, the persistent `view_edge_cache`,
|
|
12
|
+
and the `ViewCoordinates.from_viewport()` ISO projection basis.
|
|
13
|
+
- **Grouped hole-pattern callouts** (#92, #111, #114). A recognised perimeter,
|
|
14
|
+
grid, or bolt circle collapses to a single `n× ⌀ …` callout plus its pattern
|
|
15
|
+
dimensions instead of a balloon on every hole. A spec group now sub-clusters
|
|
16
|
+
into multiple patterns (a perimeter → its edge `LinearArray` rows, a filled
|
|
17
|
+
lattice → one `RectGrid` with a `(rows×cols)` callout and both pitch
|
|
18
|
+
dimensions); only genuinely unpatterned holes fall back to the per-hole table.
|
|
19
|
+
On NIST CTC-02 the table shrinks from 61 rows to the unpatterned remainder.
|
|
20
|
+
- **Layout overhaul — compose-then-pack** (#121, #112, ADR 0004). Each view owns
|
|
21
|
+
the annotations created against it, and the resulting view blocks are packed
|
|
22
|
+
disjoint with automatic page/scale escalation. This eliminates cross-view
|
|
23
|
+
overlap — most visibly, plan-view balloons landing on front-view dimensions.
|
|
24
|
+
- **Drawing attribution** (#120). The title block records the author, the SVG
|
|
25
|
+
and PDF carry a clickable draftwright hyperlink, and a "generated by
|
|
26
|
+
draftwright" note is written to the SVG/DXF/PDF file metadata.
|
|
27
|
+
- **Gap between wrapped hole-table column blocks** (#123) so a chart that wraps
|
|
28
|
+
into several blocks reads as distinct columns.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **Plan-view top balloon ring no longer floats over a phantom corridor** (#125).
|
|
33
|
+
The hole-table escalation deletes the X-location dimensions but left their
|
|
34
|
+
stale depth in the strip cursor, so the top balloons were parked far above the
|
|
35
|
+
view. The ring is now sized to the real dimension stack, so the top-side
|
|
36
|
+
leaders are short like the other three sides.
|
|
37
|
+
- **No more phantom `feature_not_dimensioned` warnings** on slot-ends and shallow
|
|
38
|
+
recesses, via the helpers 0.12.0 `feature_diameters()` coverage inventory
|
|
39
|
+
(#92).
|
|
40
|
+
|
|
41
|
+
### Internal
|
|
42
|
+
|
|
43
|
+
- `AnnoBox` box-model footprint foundation and the four-side balloon ring placed
|
|
44
|
+
in a reserved view halo (#111, #112); the title block is pinned as a
|
|
45
|
+
first-class layout block (#112).
|
|
46
|
+
|
|
5
47
|
## v0.1.11 — 2026-06-19
|
|
6
48
|
|
|
7
49
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: draftwright
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
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
|
|
@@ -679,8 +679,8 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
679
679
|
Classifier: Programming Language :: Python :: 3.11
|
|
680
680
|
Classifier: Programming Language :: Python :: 3.12
|
|
681
681
|
Classifier: Topic :: Scientific/Engineering
|
|
682
|
-
Requires-Python:
|
|
683
|
-
Requires-Dist: build123d-drafting-helpers>=0.
|
|
682
|
+
Requires-Python: <3.15,>=3.10
|
|
683
|
+
Requires-Dist: build123d-drafting-helpers>=0.12.0
|
|
684
684
|
Requires-Dist: build123d>=0.9.0
|
|
685
685
|
Requires-Dist: kiwisolver<2,>=1.4
|
|
686
686
|
Requires-Dist: numpy>=1.24
|
|
@@ -4,15 +4,15 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "draftwright"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.12"
|
|
8
8
|
description = "Automated technical-drawing generation for build123d"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
11
11
|
authors = [{ name = "Paul Fremantle", email = "pzfreo@gmail.com" }]
|
|
12
|
-
requires-python = ">=3.10"
|
|
12
|
+
requires-python = ">=3.10,<3.15"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"build123d>=0.9.0",
|
|
15
|
-
"build123d-drafting-helpers>=0.
|
|
15
|
+
"build123d-drafting-helpers>=0.12.0",
|
|
16
16
|
"kiwisolver>=1.4,<2",
|
|
17
17
|
"numpy>=1.24",
|
|
18
18
|
]
|
|
@@ -18,6 +18,7 @@ from types import SimpleNamespace
|
|
|
18
18
|
|
|
19
19
|
from build123d import BoundBox, Location, Shape
|
|
20
20
|
from build123d_drafting.helpers import (
|
|
21
|
+
_TB_COL_FRACTIONS, # private: title-block column widths — tight coupling, see CLAUDE.md
|
|
21
22
|
Dimension,
|
|
22
23
|
TitleBlock,
|
|
23
24
|
draft_preset,
|
|
@@ -411,6 +412,16 @@ _greedy_strip_ys = _greedy_strip_1d
|
|
|
411
412
|
_solve_strip_ys = _solve_strip_1d
|
|
412
413
|
|
|
413
414
|
|
|
415
|
+
_DRAFTWRIGHT_URL = "https://github.com/pzfreo/draftwright"
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
def _attribution_author(drawn_by: str | None) -> str:
|
|
419
|
+
"""ISO 7200 "drawn by" value: the human author and draftwright, or just
|
|
420
|
+
draftwright when no author was supplied."""
|
|
421
|
+
author = (drawn_by or "").strip()
|
|
422
|
+
return f"{author} / draftwright" if author else "draftwright"
|
|
423
|
+
|
|
424
|
+
|
|
414
425
|
def _add_title_block(dwg, a: Analysis):
|
|
415
426
|
"""Add the title block annotation."""
|
|
416
427
|
tb = TitleBlock(
|
|
@@ -418,14 +429,32 @@ def _add_title_block(dwg, a: Analysis):
|
|
|
418
429
|
a.number,
|
|
419
430
|
scale=format_drawing_scale(a.SCALE),
|
|
420
431
|
general_tolerance=a.tolerance,
|
|
421
|
-
designed_by=a.drawn_by,
|
|
432
|
+
designed_by=_attribution_author(a.drawn_by),
|
|
422
433
|
revision="A",
|
|
423
434
|
legal_owner="",
|
|
424
435
|
width=a.TB_W,
|
|
425
436
|
draft=dwg.draft,
|
|
426
|
-
)
|
|
437
|
+
)
|
|
438
|
+
# Drawn-by cell geometry, taken from the block itself rather than hardcoded,
|
|
439
|
+
# so the hyperlink rect tracks any upstream TitleBlock layout change: the
|
|
440
|
+
# two-row block's bottom row is half the block height, and the cell spans
|
|
441
|
+
# from the first column divider (_TB_COL_FRACTIONS[0]) to the right edge.
|
|
442
|
+
cell_h = tb.block_bbox["height"] / 2.0
|
|
443
|
+
tb = tb.locate(Location((a.PAGE_W - a.TB_W - _TB_CLEAR, _TB_CLEAR, 0)))
|
|
427
444
|
dwg.add(tb, "title_block")
|
|
428
445
|
|
|
446
|
+
# Record that cell's page-space rectangle so export() can place a clickable
|
|
447
|
+
# draftwright hyperlink over the "… / draftwright" author text. Keeps the
|
|
448
|
+
# block at its standard two rows — no extra height, no layout impact (a
|
|
449
|
+
# third row would squeeze the dense-part hole table).
|
|
450
|
+
bx = a.PAGE_W - a.TB_W - _TB_CLEAR
|
|
451
|
+
dwg._draftwright_link_rect = (
|
|
452
|
+
bx + _TB_COL_FRACTIONS[0] * a.TB_W,
|
|
453
|
+
_TB_CLEAR,
|
|
454
|
+
bx + a.TB_W,
|
|
455
|
+
_TB_CLEAR + cell_h,
|
|
456
|
+
)
|
|
457
|
+
|
|
429
458
|
|
|
430
459
|
def _iso_bbox(dwg):
|
|
431
460
|
"""(min_x, min_y, max_x, max_y) of the placed iso view, hidden lines included."""
|