draftwright 0.1.12__tar.gz → 0.2.0__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 (73) hide show
  1. {draftwright-0.1.12 → draftwright-0.2.0}/CHANGELOG.md +96 -0
  2. {draftwright-0.1.12 → draftwright-0.2.0}/PKG-INFO +23 -11
  3. {draftwright-0.1.12 → draftwright-0.2.0}/README.md +18 -7
  4. {draftwright-0.1.12 → draftwright-0.2.0}/pyproject.toml +26 -10
  5. draftwright-0.2.0/src/draftwright/__init__.py +62 -0
  6. {draftwright-0.1.12 → draftwright-0.2.0}/src/draftwright/_core.py +228 -15
  7. draftwright-0.2.0/src/draftwright/analysis.py +486 -0
  8. draftwright-0.2.0/src/draftwright/annotate.py +13 -0
  9. draftwright-0.2.0/src/draftwright/annotations/__init__.py +6 -0
  10. draftwright-0.2.0/src/draftwright/annotations/_common.py +51 -0
  11. draftwright-0.2.0/src/draftwright/annotations/from_model.py +1296 -0
  12. draftwright-0.2.0/src/draftwright/annotations/holes.py +700 -0
  13. draftwright-0.2.0/src/draftwright/annotations/orchestrator.py +379 -0
  14. draftwright-0.2.0/src/draftwright/annotations/sections.py +452 -0
  15. draftwright-0.2.0/src/draftwright/builder.py +630 -0
  16. draftwright-0.2.0/src/draftwright/cli.py +172 -0
  17. draftwright-0.2.0/src/draftwright/drawing.py +1202 -0
  18. draftwright-0.2.0/src/draftwright/export.py +252 -0
  19. draftwright-0.2.0/src/draftwright/features.py +23 -0
  20. draftwright-0.2.0/src/draftwright/fonts/IBMPlexMono-Regular.ttf +0 -0
  21. draftwright-0.2.0/src/draftwright/fonts/IBMPlexSansCondensed-Regular.ttf +0 -0
  22. draftwright-0.2.0/src/draftwright/fonts/LICENSE-IBMPlexMono-OFL.txt +93 -0
  23. draftwright-0.2.0/src/draftwright/fonts/LICENSE-IBMPlexSansCondensed-OFL.txt +93 -0
  24. draftwright-0.2.0/src/draftwright/fonts/__init__.py +20 -0
  25. draftwright-0.2.0/src/draftwright/linting/__init__.py +37 -0
  26. draftwright-0.2.0/src/draftwright/linting/coverage.py +394 -0
  27. draftwright-0.2.0/src/draftwright/linting/issues.py +21 -0
  28. draftwright-0.2.0/src/draftwright/linting/structural.py +635 -0
  29. draftwright-0.2.0/src/draftwright/linting/suggest.py +100 -0
  30. draftwright-0.2.0/src/draftwright/make_drawing.py +20 -0
  31. draftwright-0.2.0/src/draftwright/model/__init__.py +72 -0
  32. draftwright-0.2.0/src/draftwright/model/detect.py +301 -0
  33. draftwright-0.2.0/src/draftwright/model/ir.py +337 -0
  34. draftwright-0.2.0/src/draftwright/model/planner.py +259 -0
  35. {draftwright-0.1.12 → draftwright-0.2.0}/src/draftwright/pmi.py +3 -2
  36. draftwright-0.2.0/src/draftwright/projection.py +291 -0
  37. draftwright-0.2.0/src/draftwright/recognition/__init__.py +54 -0
  38. draftwright-0.2.0/src/draftwright/recognition/_features.py +1038 -0
  39. draftwright-0.2.0/src/draftwright/recognition/levels.py +51 -0
  40. draftwright-0.2.0/src/draftwright/recognition/slots.py +317 -0
  41. draftwright-0.2.0/src/draftwright/recognition/turned.py +165 -0
  42. draftwright-0.2.0/src/draftwright/registry.py +147 -0
  43. draftwright-0.2.0/src/draftwright/repair.py +108 -0
  44. draftwright-0.2.0/src/draftwright/sheet.py +892 -0
  45. draftwright-0.2.0/tests/test_e2e_slice.py +72 -0
  46. {draftwright-0.1.12 → draftwright-0.2.0}/tests/test_e2e_standards.py +2 -1
  47. {draftwright-0.1.12 → draftwright-0.2.0}/tests/test_layout.py +6 -2
  48. draftwright-0.2.0/tests/test_lint_structural.py +419 -0
  49. draftwright-0.2.0/tests/test_linting.py +40 -0
  50. {draftwright-0.1.12 → draftwright-0.2.0}/tests/test_make_drawing.py +864 -220
  51. draftwright-0.2.0/tests/test_part_model.py +326 -0
  52. draftwright-0.2.0/tests/test_recognition.py +847 -0
  53. draftwright-0.2.0/tests/test_registry.py +105 -0
  54. draftwright-0.2.0/tests/test_render_seam.py +63 -0
  55. draftwright-0.2.0/tests/test_turned_steps.py +87 -0
  56. draftwright-0.1.12/src/draftwright/__init__.py +0 -41
  57. draftwright-0.1.12/src/draftwright/annotate.py +0 -2193
  58. draftwright-0.1.12/src/draftwright/make_drawing.py +0 -3907
  59. {draftwright-0.1.12 → draftwright-0.2.0}/.gitignore +0 -0
  60. {draftwright-0.1.12 → draftwright-0.2.0}/LICENSE +0 -0
  61. {draftwright-0.1.12 → draftwright-0.2.0}/skills/SKILL.md +0 -0
  62. {draftwright-0.1.12 → draftwright-0.2.0}/src/draftwright/layout.py +0 -0
  63. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_01_asme1_ap203.stp +0 -0
  64. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_01_asme1_ap242.stp +0 -0
  65. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_02_asme1_ap203.stp +0 -0
  66. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_02_asme1_ap242.stp +0 -0
  67. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_03_asme1_ap203.stp +0 -0
  68. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_03_asme1_ap242.stp +0 -0
  69. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_04_asme1_ap203.stp +0 -0
  70. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_04_asme1_ap242.stp +0 -0
  71. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_05_asme1_ap203.stp +0 -0
  72. {draftwright-0.1.12 → draftwright-0.2.0}/tests/fixtures/nist_ctc_05_asme1_ap242.stp +0 -0
  73. {draftwright-0.1.12 → draftwright-0.2.0}/tests/test_pmi.py +0 -0
@@ -2,6 +2,102 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v0.2.0 — 2026-06-30
6
+
7
+ A major release. draftwright took ownership of feature recognition and linting
8
+ (ADR 0007) and was re-architected onto a feature-IR + dimensioning-planner
9
+ "compiler" (ADR 0008), gaining a Typer CLI and a portable, pure-Python PDF path
10
+ along the way. **Generated drawings change** versus v0.1.13: the new pipeline
11
+ dimensions parts more completely and consistently, so placement and the set of
12
+ dimensions can differ — output is not byte-compatible with prior releases.
13
+
14
+ ### Changed
15
+
16
+ - **Re-architected onto a feature-IR + dimensioning planner** (ADR 0008). The
17
+ engine is now a compiler: detectors build one feature inventory → a typed IR /
18
+ `PartModel` → a dimensioning planner emits render-intents → shared
19
+ layout/projection/export. Orientation and feature-kind are *data in the IR*,
20
+ not code branches, and every feature class (holes, patterns, counterbores,
21
+ slots, turned diameters/steps, centre marks, location dims, envelope/OD,
22
+ section A–A, PMI/GD&T) was migrated onto this one path; the old parallel
23
+ recognisers and placement passes were deleted as each was replaced. Net effect
24
+ for users: more complete, more consistent drawings — but output differs from
25
+ v0.1.13.
26
+ - **draftwright owns feature recognition and linting** (ADR 0007). The hole/
27
+ boss/cylinder/pattern recognisers, the slot/turned-step recognisers, and the
28
+ feature-coverage lint engine are vendored into `recognition/` and `linting.py`;
29
+ `build123d-drafting-helpers` is now purely the rendering library.
30
+ - **The CLI writes a PDF by default** and takes a `--format` selector (#288).
31
+ Previously `draftwright part.step` emitted SVG + DXF; it now emits a single PDF.
32
+ Choose outputs with `--format` (a comma-list, with an `all` alias) —
33
+ `--format pdf,dxf`, `--format svg`, `--format all`. The library API is
34
+ unchanged: `make_drawing(...)` / `Drawing.export()` still write SVG + DXF.
35
+ - **PDF export is now pure-Python and a core capability** (#288). The renderer
36
+ moved from `cairosvg` (which `dlopen`s the native `libcairo` system library —
37
+ absent on stock macOS/Windows, so PDF-by-default would have crashed there) to
38
+ `svglib` + `reportlab`, both pip-installable wheels with no system dependency.
39
+ PDF therefore works out of the box on every platform; output is visually
40
+ identical to the cairo renderer.
41
+
42
+ ### Added
43
+
44
+ - **A Typer command-line interface** (#289/#291): shell completion
45
+ (`--install-completion` / `--show-completion`), rich `--help`, and `--version`
46
+ (reports the installed distribution version). All existing flags are preserved.
47
+ - **`--format` output selector** (#288) — `pdf` (default), `svg`, `dxf`, or `all`,
48
+ as a comma-list.
49
+ - **Turned-part dimensioning**: axial step-length recognition and chains
50
+ (#188/#189/#231), step-diameter callouts, collapse of a uniform step
51
+ staircase to an "N× length" note (#290), and OD of a horizontal (X/Y) round
52
+ body dimensioned on the profile view (#292).
53
+ - **Slot recognition and dimensioning** converged onto the IR as `SlotFeature`
54
+ (#242), and **section A–A** is now triggered by the planner (#271).
55
+ - **A Contributor License Agreement** (#183).
56
+
57
+ ### Removed
58
+
59
+ - **The `--pdf` flag** (use `--format pdf`, the new default), the **`[pdf]`
60
+ install extra**, and the **`cairosvg` dependency** (#288).
61
+ - The byte-exact golden-output test harness (#190) — regression coverage rests on
62
+ the geometry-level and standards suites (ADR 0005 §3 / ADR 0007).
63
+
64
+ ### Fixed
65
+
66
+ - Locate **every** side-drilled (off-axis) hole, not just the first (#225/#286).
67
+ - Don't mis-detect a prismatic part with incidental cylinders as a turned part
68
+ (#293/#294); drop phantom zero-diameter turned steps (#279/#284); skip an
69
+ illegibly-dense step-length chain rather than cram it (#293/#296).
70
+ - Degraded hole-pattern callout consistency (#262/#274).
71
+ - Windows `python -m draftwright.make_drawing` CLI smoke / entrypoint (#181/#182).
72
+
73
+ ## v0.1.13 — 2026-06-27
74
+
75
+ ### Changed
76
+
77
+ - **Requires `build123d-drafting-helpers>=0.13.0`; text pinned to bundled fonts**
78
+ (#149, ADR 0006). draftwright now vendors IBM Plex (OFL-1.1) and renders and
79
+ measures all text via `font_path` — IBM Plex Mono for dimensions/callouts/notes,
80
+ IBM Plex Sans Condensed for the title block — instead of resolving the system
81
+ font name `"Arial"`. Resolving a name substitutes a different font on Linux,
82
+ which shifted the whole sheet ~1 mm; pinning a bundled font file makes generated
83
+ layout **deterministic across Linux/macOS/Windows** and gives a consistent
84
+ typeface. **Drawing output changes**: positions shift slightly from prior
85
+ releases and labels render in IBM Plex (helpers #172).
86
+
87
+ ### Internal
88
+
89
+ - **Compiler-pipeline module split** (#138, ADR 0005). The two large modules
90
+ `make_drawing.py` (3,907 lines) and `annotate.py` (2,587) were decomposed into a
91
+ DAG of focused stage modules — `projection`, `sheet`, `analysis`, `drawing`,
92
+ `builder`, the `annotations/` subpackage (sections/turned/pmi/holes/orchestrator),
93
+ alongside the existing `registry`/`linting`/`repair`/`export`/`fonts`. Annotation
94
+ identity, the lint coverage signal, and the deterministic repair loop each gained a
95
+ single owner; `make_drawing.py` / `annotate.py` are now thin compat facades, so all
96
+ existing imports and the `draftwright` CLI entry point keep working. A golden-output
97
+ regression gate verified every step is behaviour-preserving (output byte-identical),
98
+ and mypy was tightened on the settled contracts. No public API or drawing-output
99
+ change. (Phases #160–#166.)
100
+
5
101
  ## v0.1.12 — 2026-06-21
6
102
 
7
103
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: draftwright
3
- Version: 0.1.12
3
+ Version: 0.2.0
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
@@ -680,12 +680,13 @@ Classifier: Programming Language :: Python :: 3.11
680
680
  Classifier: Programming Language :: Python :: 3.12
681
681
  Classifier: Topic :: Scientific/Engineering
682
682
  Requires-Python: <3.15,>=3.10
683
- Requires-Dist: build123d-drafting-helpers>=0.12.0
683
+ Requires-Dist: build123d-drafting-helpers>=0.13.0
684
684
  Requires-Dist: build123d>=0.9.0
685
685
  Requires-Dist: kiwisolver<2,>=1.4
686
686
  Requires-Dist: numpy>=1.24
687
- Provides-Extra: pdf
688
- Requires-Dist: cairosvg>=2.7; extra == 'pdf'
687
+ Requires-Dist: reportlab>=4.0
688
+ Requires-Dist: svglib>=1.5
689
+ Requires-Dist: typer>=0.12
689
690
  Description-Content-Type: text/markdown
690
691
 
691
692
  # draftwright
@@ -714,6 +715,9 @@ Or from the command line:
714
715
 
715
716
  ```
716
717
  draftwright my_part.step --title "Mounting Block" --number DWG-001
718
+ # writes my_part.pdf (the default); add --format to choose:
719
+ draftwright my_part.step --format pdf,dxf # PDF + DXF
720
+ draftwright my_part.step --format all # PDF + SVG + DXF
717
721
  ```
718
722
 
719
723
  ## What it produces
@@ -756,8 +760,7 @@ make_drawing(part, out="drawing", title="My Part", number="DWG-001")
756
760
  # Composable: get a Drawing object to inspect or extend
757
761
  dwg = build_drawing(part, title="My Part")
758
762
  issues = dwg.lint() # list[LintIssue]
759
- dwg.export_svg("drawing.svg")
760
- dwg.export_dxf("drawing.dxf")
763
+ svg_path, dxf_path = dwg.export("drawing")
761
764
  ```
762
765
 
763
766
  ### From a STEP file
@@ -809,7 +812,10 @@ generation, the lint→repair loop, and the constraint-based layout engine).
809
812
 
810
813
  ## Architecture
811
814
 
812
- draftwright is a single module (`make_drawing.py`) on top of two libraries:
815
+ draftwright is structured as a **part-drawing compiler** (ADR 0008): feature
816
+ detectors → a `PartModel` IR (`Feature`s exposing `DimParameter`s) → a dimensioning
817
+ planner → renderers, feeding a shared layout/projection/export stack. It builds on
818
+ two libraries:
813
819
 
814
820
  ```
815
821
  draftwright
@@ -817,7 +823,13 @@ draftwright
817
823
  └── build123d — CAD kernel
818
824
  ```
819
825
 
820
- The engine handles view layout (strip/zone model), scale selection, feature recognition
821
- (holes, bosses, bolt circles), annotation placement, and section view generation.
822
- Annotation primitives (`Dimension`, `Leader`, `lint_drawing`, etc.) live in
823
- `build123d-drafting-helpers` and can be used independently.
826
+ It owns feature recognition (`recognition/`) and linting (`linting/`); annotation
827
+ primitives (`Dimension`, `Leader`, etc.) live in `build123d-drafting-helpers` and can
828
+ be used independently. The compiler is largely converged in production — turned
829
+ dims/lengths, centre marks, envelope, slots, holes (callouts/locations/grouping),
830
+ the section A–A trigger, the prismatic step-ladder + rotational furniture, and PMI/GD&T
831
+ are all on the IR — the migration is complete (one path; the orchestrator is
832
+ build → plan → render). See
833
+ [`docs/target-architecture.md`](docs/target-architecture.md) and
834
+ [`docs/adr/`](docs/adr/). The engine handles view layout (strip/zone model), scale
835
+ selection, annotation placement, and section rendering.
@@ -24,6 +24,9 @@ Or from the command line:
24
24
 
25
25
  ```
26
26
  draftwright my_part.step --title "Mounting Block" --number DWG-001
27
+ # writes my_part.pdf (the default); add --format to choose:
28
+ draftwright my_part.step --format pdf,dxf # PDF + DXF
29
+ draftwright my_part.step --format all # PDF + SVG + DXF
27
30
  ```
28
31
 
29
32
  ## What it produces
@@ -66,8 +69,7 @@ make_drawing(part, out="drawing", title="My Part", number="DWG-001")
66
69
  # Composable: get a Drawing object to inspect or extend
67
70
  dwg = build_drawing(part, title="My Part")
68
71
  issues = dwg.lint() # list[LintIssue]
69
- dwg.export_svg("drawing.svg")
70
- dwg.export_dxf("drawing.dxf")
72
+ svg_path, dxf_path = dwg.export("drawing")
71
73
  ```
72
74
 
73
75
  ### From a STEP file
@@ -119,7 +121,10 @@ generation, the lint→repair loop, and the constraint-based layout engine).
119
121
 
120
122
  ## Architecture
121
123
 
122
- draftwright is a single module (`make_drawing.py`) on top of two libraries:
124
+ draftwright is structured as a **part-drawing compiler** (ADR 0008): feature
125
+ detectors → a `PartModel` IR (`Feature`s exposing `DimParameter`s) → a dimensioning
126
+ planner → renderers, feeding a shared layout/projection/export stack. It builds on
127
+ two libraries:
123
128
 
124
129
  ```
125
130
  draftwright
@@ -127,7 +132,13 @@ draftwright
127
132
  └── build123d — CAD kernel
128
133
  ```
129
134
 
130
- The engine handles view layout (strip/zone model), scale selection, feature recognition
131
- (holes, bosses, bolt circles), annotation placement, and section view generation.
132
- Annotation primitives (`Dimension`, `Leader`, `lint_drawing`, etc.) live in
133
- `build123d-drafting-helpers` and can be used independently.
135
+ It owns feature recognition (`recognition/`) and linting (`linting/`); annotation
136
+ primitives (`Dimension`, `Leader`, etc.) live in `build123d-drafting-helpers` and can
137
+ be used independently. The compiler is largely converged in production — turned
138
+ dims/lengths, centre marks, envelope, slots, holes (callouts/locations/grouping),
139
+ the section A–A trigger, the prismatic step-ladder + rotational furniture, and PMI/GD&T
140
+ are all on the IR — the migration is complete (one path; the orchestrator is
141
+ build → plan → render). See
142
+ [`docs/target-architecture.md`](docs/target-architecture.md) and
143
+ [`docs/adr/`](docs/adr/). The engine handles view layout (strip/zone model), scale
144
+ selection, annotation placement, and section rendering.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "draftwright"
7
- version = "0.1.12"
7
+ version = "0.2.0"
8
8
  description = "Automated technical-drawing generation for build123d"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -12,9 +12,12 @@ authors = [{ name = "Paul Fremantle", email = "pzfreo@gmail.com" }]
12
12
  requires-python = ">=3.10,<3.15"
13
13
  dependencies = [
14
14
  "build123d>=0.9.0",
15
- "build123d-drafting-helpers>=0.12.0",
15
+ "build123d-drafting-helpers>=0.13.0",
16
16
  "kiwisolver>=1.4,<2",
17
17
  "numpy>=1.24",
18
+ "reportlab>=4.0",
19
+ "svglib>=1.5",
20
+ "typer>=0.12",
18
21
  ]
19
22
  keywords = ["build123d", "cad", "drafting", "engineering-drawing", "technical-drawing", "automation"]
20
23
  classifiers = [
@@ -29,11 +32,8 @@ classifiers = [
29
32
  "Programming Language :: Python :: 3.12",
30
33
  ]
31
34
 
32
- [project.optional-dependencies]
33
- pdf = ["cairosvg>=2.7"]
34
-
35
35
  [project.scripts]
36
- draftwright = "draftwright.make_drawing:_cli"
36
+ draftwright = "draftwright.cli:app"
37
37
 
38
38
  [project.urls]
39
39
  Homepage = "https://github.com/pzfreo/draftwright"
@@ -59,10 +59,17 @@ include = [
59
59
  testpaths = ["tests"]
60
60
  timeout = 300
61
61
  # `slow` covers the heavy end-to-end builds over the large NIST CTC fixtures
62
- # (minutes each). They are deselected by default for a fast normal run; run the
63
- # full suite with `-m ""` or just the slow tier with `-m slow` (CI runs both).
64
- markers = ["slow: heavy end-to-end CTC fixture builds (deselected by default)"]
65
- addopts = "--tb=short --cov=src/draftwright --cov-report=term-missing --cov-report=xml -m 'not slow'"
62
+ # (minutes each), deselected by default. `smoke` is a curated, build-light subset
63
+ # (~30 s) for a quick local "did I break something obvious" check run it with
64
+ # `uv run pytest -m smoke`. The default run is the full fast tier (`-m 'not slow'`,
65
+ # ~8 min); CI owns that plus the slow tier across the OS/Python matrix.
66
+ markers = [
67
+ "slow: heavy end-to-end CTC fixture builds (deselected by default)",
68
+ "smoke: curated build-light subset for a fast local check (~30 s)",
69
+ ]
70
+ # Coverage is a CI concern (it adds ~13% locally and instruments every line); the
71
+ # CI workflow passes the --cov flags explicitly. Keep the local default lean.
72
+ addopts = "--tb=short -m 'not slow'"
66
73
 
67
74
  [tool.coverage.run]
68
75
  source = ["src/draftwright"]
@@ -79,6 +86,14 @@ python_version = "3.10"
79
86
  ignore_missing_imports = true
80
87
  check_untyped_defs = true
81
88
  warn_unused_ignores = true
89
+ # Tightened on the settled module contracts (#138 / ADR 0005 P7). disallow_untyped_defs
90
+ # stays off (geometry helpers lean on untyped build123d returns); these flags catch
91
+ # real gaps without demanding annotations everywhere.
92
+ no_implicit_optional = true
93
+ warn_redundant_casts = true
94
+ strict_equality = true
95
+ warn_return_any = true
96
+ extra_checks = true
82
97
 
83
98
  [tool.ruff]
84
99
  line-length = 99
@@ -94,5 +109,6 @@ dev = [
94
109
  "pytest>=8",
95
110
  "pytest-cov>=5",
96
111
  "pytest-timeout>=2",
112
+ "pytest-xdist>=3",
97
113
  "ruff>=0.4",
98
114
  ]
@@ -0,0 +1,62 @@
1
+ """draftwright — automated technical-drawing generation for build123d.
2
+
3
+ Takes a build123d solid and produces a fully-annotated multi-view technical
4
+ drawing (orthographic views, dimensions, section A–A, title block) ready for
5
+ DXF/SVG export::
6
+
7
+ from draftwright import make_drawing
8
+ make_drawing(my_part, out="drawing")
9
+
10
+ Requires build123d-drafting-helpers for annotation primitives.
11
+ Licensed under the GNU Affero General Public License v3 (AGPL-3.0).
12
+ """
13
+
14
+ import sys as _sys
15
+ import types as _types
16
+
17
+ from draftwright.analysis import analyse_face_levels, dedup_diams
18
+ from draftwright.builder import (
19
+ build_drawing,
20
+ generate_script,
21
+ make_drawing,
22
+ )
23
+ from draftwright.drawing import Drawing, FeatureInfo
24
+ from draftwright.export import fix_svg_page_size
25
+ from draftwright.linting import lint_feature_coverage
26
+ from draftwright.pmi import PmiRecord, extract_pmi
27
+ from draftwright.sheet import choose_scale
28
+
29
+ _make_drawing_function = make_drawing
30
+
31
+
32
+ class _DraftwrightModule(_types.ModuleType):
33
+ def __getattribute__(self, name):
34
+ if name == "make_drawing":
35
+ namespace = _types.ModuleType.__getattribute__(self, "__dict__")
36
+ value = namespace.get(name)
37
+ if (
38
+ isinstance(value, _types.ModuleType)
39
+ and value.__name__ == "draftwright.make_drawing"
40
+ ):
41
+ public = namespace["_make_drawing_function"]
42
+ _types.ModuleType.__setattr__(self, name, public)
43
+ return public
44
+ return _types.ModuleType.__getattribute__(self, name)
45
+
46
+
47
+ _sys.modules[__name__].__class__ = _DraftwrightModule
48
+
49
+ __all__ = [
50
+ "Drawing",
51
+ "FeatureInfo",
52
+ "PmiRecord",
53
+ "analyse_face_levels",
54
+ "build_drawing",
55
+ "choose_scale",
56
+ "dedup_diams",
57
+ "extract_pmi",
58
+ "fix_svg_page_size",
59
+ "generate_script",
60
+ "lint_feature_coverage",
61
+ "make_drawing",
62
+ ]