draftwright 0.4.10__tar.gz → 0.4.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.4.10 → draftwright-0.4.12}/CHANGELOG.md +30 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/PKG-INFO +2 -2
- {draftwright-0.4.10 → draftwright-0.4.12}/docs/reference/recogniser-capabilities.md +5 -7
- {draftwright-0.4.10 → draftwright-0.4.12}/pyproject.toml +2 -2
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/_core.py +58 -11
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/_pmi_part21.py +234 -2
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/_common.py +31 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/from_model.py +365 -61
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/holes.py +67 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/builder.py +447 -32
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/drawing.py +8 -4
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/coverage.py +81 -14
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/hole_coverage.py +6 -7
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/pmi_coverage.py +128 -31
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/quality.py +4 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/__init__.py +8 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/callout.py +8 -1
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/compiled.py +10 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/declare.py +69 -5
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/detect.py +7 -2
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/ir.py +328 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/model/planner.py +9 -2
- draftwright-0.4.12/src/draftwright/model/pmi_lowering.py +839 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/pmi.py +482 -35
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/recogniser_contract.py +16 -50
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/sheet.py +86 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/sheet_emit.py +283 -41
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/view_plan.py +20 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/conftest.py +0 -2
- draftwright-0.4.12/tests/fixtures/ap242_single_cylinder_diameter.step +163 -0
- draftwright-0.4.12/tests/fixtures/grm04_drive_plate.step +1001 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_add_dimension.py +27 -1
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_adr0018_arrangement_gate.py +6 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_external_recognition_boundary.py +5 -11
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1143_hole_completeness.py +5 -2
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1146_scale_completeness.py +29 -1
- draftwright-0.4.12/tests/test_issue_1155_grm04_sheet_use.py +44 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1177_angular_dimensions.py +3 -3
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1187_unroutable_leaders.py +38 -1
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1202_observed_drawing_consumer.py +10 -6
- draftwright-0.4.12/tests/test_issue_1209_linear_pmi_witnesses.py +181 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1217_the_facility_is_shared.py +3 -35
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1219_location_claims_its_own_axis.py +7 -10
- draftwright-0.4.12/tests/test_issue_1296_cylindrical_diameter_pmi.py +839 -0
- draftwright-0.4.12/tests/test_issue_1298_manufacturing_requirements.py +1178 -0
- draftwright-0.4.12/tests/test_issue_1299_page_escalation.py +465 -0
- draftwright-0.4.12/tests/test_issue_443_grm03_axial_coverage.py +59 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_740_leader_assignment.py +2 -1
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_make_drawing.py +49 -6
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_note_verb.py +12 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_part_model.py +15 -23
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pmi.py +92 -1
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pmi_part21.py +161 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_private_test_imports.py +6 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recogniser_adoption.py +3 -7
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recogniser_capabilities.py +15 -50
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_emit.py +41 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_notes.py +28 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_tables.py +28 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_solve_trace.py +31 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_workflows.py +39 -0
- draftwright-0.4.10/src/draftwright/model/pmi_lowering.py +0 -276
- draftwright-0.4.10/tests/test_cross_repository_delivery_protocol.py +0 -27
- draftwright-0.4.10/tests/test_two_repository_workflow.py +0 -343
- {draftwright-0.4.10 → draftwright-0.4.12}/.gitignore +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/LICENSE +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/README.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/docs/adr/README.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/docs/reference/sheet.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/docs/research/1062-repeating-radial-profile-evidence.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/skills/SKILL.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/_geometry.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/_warnings.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/analysis.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotate.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/balloons.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/gears.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/leaders.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/orchestrator.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/annotations/sections.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/audit.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/cli.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/compose.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/evaluation/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/evaluation/step_analysis.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/export.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fits.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fonts/IBMPlexMono-Regular.ttf +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fonts/IBMPlexSansCondensed-Regular.ttf +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fonts/LICENSE-IBMPlexMono-OFL.txt +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fonts/LICENSE-IBMPlexSansCondensed-OFL.txt +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/fonts/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/intents.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/layout.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/channel_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/evidence.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/flat_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/gear_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/issues.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/polygonal_stock_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/profiled_bore_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/slot_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/structural.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/linting/suggest.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/make_drawing.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/projection.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/py.typed +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/recognition/__init__.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/recognition_cache.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/registry.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/repair.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/src/draftwright/score.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/_kernel.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/_layout_sig.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/README.md +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/ambiguous-open-semicircle.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/blind-hole.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/corpus-v1.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/plain-block.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/topology-a.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/evaluation/topology-b.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/grm03_thumbwheel_drive_screw.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/if_step_flat_across_cylinder.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/issue_1058_wheel_rh.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/issue_909_basic_part_design_017_body.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/issue_915_case_study_2.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_01_asme1_ap203.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_01_asme1_ap242.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_02_asme1_ap203.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_02_asme1_ap242.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_03_asme1_ap203.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_03_asme1_ap242.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_04_asme1_ap203.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_04_asme1_ap242.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_05_asme1_ap203.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/nist_ctc_05_asme1_ap242.stp +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/fixtures/tuner_jig_blind_obround_pockets.step +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/bracket_section.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/centered_rebate.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/chamfered.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/filleted.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/flange_dense.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/grid_plate.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/grooved_shaft.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/hex_bar.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/holed_slot.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/pocketed.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/prismatic_ladder.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/scattered_plate.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/side_drilled.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/refactor_golden/turned_stepped.json +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_adr0018_view_routing.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_adr0018_view_selection.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_agents_guide.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_api_docs.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_architecture_docs.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_audit_differential.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_balloon_ring_standoff.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_carve_free_position_callers.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_compiled_plan_boundary.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_counting_calls.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_declare.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_declared_recognition_gate.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_dense_sheet_canary.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_deprecation_dates.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_detect_once.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_detect_registry.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_dimension_role_vocabulary.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_drawing_encapsulation.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_e2e_slice.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_e2e_standards.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_export_dxf_curves.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_export_dxf_zoom.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_fillets_adjacency.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_fits.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_flat_completeness.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_flat_stock_identity.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_flat_stock_opposition.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_gdt_placement.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_grid_lattice_convention.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_import_boundaries.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_iso_nts_caption_placement.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1000_envelope_reuse.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1058_wheel_profile.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1073_cross_body_patterns.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1082_polygonal_stock.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1086_declared_gears.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1116_ap242_hole_tolerance_lowering.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1130_view_planning_evidence.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1142_hole_leader_labels.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1144_transactional_hole_table.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1147_legibility_pair_aggregation.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1153_contradictory_dimensions.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1154_one_owner_per_measurement.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1166_cross_pass_feature_leaders.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1176_quality_fidelity.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1188_per_view_assignment.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1190_section_decision.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1196_deterministic_view_names.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1204_multiscale_view_issues.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1215_envelope_tolerance.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1215_no_approved_tolerance_is_dropped.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1216_callout_reservation_measures_ink.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1216_pairwise_across_scale_groups.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1217_claimed_representations.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1229_ledger_member_keying.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1240_iso_above_strip_visibility.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1254_turned_chamfers.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1260_view_constraints.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1276_turned_leader_targets.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_1281_turned_fillets.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_367_leader_ink.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_676_polygonal_boss.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_676_polygonal_boss_declare.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_798_floor_cardinality.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_798_material_field.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_798_silhouette_lint.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_885_prismatic_coverage.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_909_sloped_profile.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_915_dense_case.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_916_pocket_leader.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_917_open_channel.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_924_zero_length_shoulders.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_955_height_contingency.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_issue_958_cross_solid_recognition.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_label_provenance.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_layout.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_layout_cleanliness.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_layout_hypothesis.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_layout_property.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_leader_footprint.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_lint_box_cache.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_lint_reconciliation.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_lint_structural.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_linting.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_location_vocabulary.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_object_aspects.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_occupancy_boxes.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_parameter_id.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pitch_dim_footprint.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pmi_datum_lowering.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pmi_gtol_lowering.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pocket_pattern.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_pocket_pattern_recognition.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_principal_profile_classifier.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_private_test_attr_reads.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_quality_components.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recogniser_contract.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recognition.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recognition_manifest.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_recognition_result.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_refactor_golden.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_registry.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_render_seam.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_repack_geometry_seam.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_score.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_script_detail_parity.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_shared_box_memo.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_gdt.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_identity_invariant.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_of.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_sheet_section.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_slanted_blind_step.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_slot_completeness.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_slot_pattern.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_slot_pattern_recognition.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_soft_deprecation.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_step_analysis_evaluation.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_strip_layout.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_suppression_ledger.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_suppression_marks.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_tolerances.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_turned_steps.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_view_plan.py +0 -0
- {draftwright-0.4.10 → draftwright-0.4.12}/tests/test_witness_label_reconciliation.py +0 -0
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Recogniser integration now uses only the exact `b123d-recognisers` dependency in
|
|
8
|
+
`pyproject.toml` and `uv.lock`. The separate release-evidence record, dependency-bump workflow,
|
|
9
|
+
candidate-checkout harness, and release-time capability-version rewrites have been removed;
|
|
10
|
+
ordinary compatibility tests validate the installed pinned package.
|
|
11
|
+
- Automatic composition now measures the next larger preferred scale when a conservative
|
|
12
|
+
crowded-detail reservation leaves a sparse sheet. A candidate wins only on the same paper
|
|
13
|
+
size, without the recovery detail, structural errors, or required-placement loss. GRM-04 now
|
|
14
|
+
uses A4 at 5:1 instead of 2:1, re-homes its shared side-hole Y location into the plan-view
|
|
15
|
+
corridor, and retains both the Ø2.4 diameter and location requirements (#1155).
|
|
16
|
+
- Closed the remaining dense-sheet leader cases as deliberate Policy-B behavior: exhaustive
|
|
17
|
+
route sweeps prove there is no route clear of both material and committed sheet ink, so the
|
|
18
|
+
required callout remains with an explicit crossing diagnostic instead of being dropped. A
|
|
19
|
+
fast synthetic release gate complements the retained exhaustive corpus characterization
|
|
20
|
+
(#1187).
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Notes and generic table cells now render U+2300 `⌀` with the established supported drafting
|
|
25
|
+
glyph instead of IBM Plex Mono's missing-glyph square. The substitution happens at the one
|
|
26
|
+
shared measurement/render seam, so source rows remain unchanged and table sizing stays exact
|
|
27
|
+
(#1275).
|
|
28
|
+
- Automatic turned-part composition now gives true shoulder coverage priority over optional
|
|
29
|
+
pictorial content. GRM-03 replans to 5:1 and renders its 0.5, 2, 3, and 18 mm axial lengths;
|
|
30
|
+
`axial_length_missing` disappears because the dimensions are present, not because the
|
|
31
|
+
diagnostic was suppressed (#443).
|
|
32
|
+
|
|
3
33
|
## v0.4.10 — 2026-08-22
|
|
4
34
|
|
|
5
35
|
**A view-set-aware planning and turned-edge-treatment patch.** Authored view constraints now
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: draftwright
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.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
|
|
@@ -684,7 +684,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
684
684
|
Classifier: Topic :: Scientific/Engineering
|
|
685
685
|
Requires-Python: <3.15,>=3.10
|
|
686
686
|
Requires-Dist: antlr4-python3-runtime<4.10
|
|
687
|
-
Requires-Dist: b123d-recognisers==0.3.
|
|
687
|
+
Requires-Dist: b123d-recognisers==0.3.1
|
|
688
688
|
Requires-Dist: build123d-drafting-helpers>=0.14.1
|
|
689
689
|
Requires-Dist: build123d<0.11,>=0.9.0; python_full_version < '3.13'
|
|
690
690
|
Requires-Dist: build123d<0.12,>=0.11; python_full_version >= '3.13'
|
|
@@ -49,13 +49,11 @@ Validation fails closed and names the family and boundary whenever possible:
|
|
|
49
49
|
|
|
50
50
|
## Adding or changing a recogniser
|
|
51
51
|
|
|
52
|
-
For an additive field that increments an existing record schema,
|
|
53
|
-
declaration
|
|
54
|
-
|
|
55
|
-
only
|
|
56
|
-
|
|
57
|
-
Draftwright dependency/behavior PR locks the immutable artifact, adopts the field, and narrows the
|
|
58
|
-
declaration to the new schema.
|
|
52
|
+
For an additive field that increments an existing record schema, update the relevant Draftwright
|
|
53
|
+
adapter and declaration when advancing the exact `b123d-recognisers` dependency pin. Tests must
|
|
54
|
+
prove the installed schema is accepted while later schemas still fail. The package version belongs
|
|
55
|
+
only in `pyproject.toml` and `uv.lock`; the capability declaration derives runtime identities from
|
|
56
|
+
installed package metadata.
|
|
59
57
|
|
|
60
58
|
For each applicable stage, add the adapter, declaration, emitted-Sheet round trip, drawing behavior,
|
|
61
59
|
and completeness evidence; for an inapplicable or deferred stage, state why and link its tracking
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "draftwright"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.12"
|
|
8
8
|
description = "Automated technical-drawing generation for build123d"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -18,7 +18,7 @@ dependencies = [
|
|
|
18
18
|
"build123d>=0.9.0,<0.11 ; python_full_version < '3.13'",
|
|
19
19
|
"build123d>=0.11,<0.12 ; python_full_version >= '3.13'",
|
|
20
20
|
"build123d-drafting-helpers>=0.14.1",
|
|
21
|
-
"b123d-recognisers==0.3.
|
|
21
|
+
"b123d-recognisers==0.3.1",
|
|
22
22
|
"numpy>=1.24",
|
|
23
23
|
# PNG raster export (SVG→PDF→PNG). Both permissively licensed (Pillow HPND; pypdfium2
|
|
24
24
|
# Apache-2.0 wrapping Google PDFium BSD-3) and ship pre-built wheels with NO native system
|
|
@@ -57,6 +57,35 @@ from draftwright.layout import _greedy_strip_1d, _solve_strip_1d
|
|
|
57
57
|
_log = logging.getLogger(__name__)
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
def _decode_hole_location_fact(fact):
|
|
61
|
+
"""Decode a current or legacy ``covers_hole_locations`` fact.
|
|
62
|
+
|
|
63
|
+
Current facts carry ``(feature, parameter, point)``. Legacy/external facts
|
|
64
|
+
carry ``(measurement, point)`` and derive ownership from the measurement.
|
|
65
|
+
Invalid or incomplete riders return ``None`` so consumers can retain their
|
|
66
|
+
geometric fallback instead of treating malformed metadata as authoritative.
|
|
67
|
+
"""
|
|
68
|
+
try:
|
|
69
|
+
size = len(fact)
|
|
70
|
+
except TypeError:
|
|
71
|
+
return None
|
|
72
|
+
if size == 3:
|
|
73
|
+
feature, parameter, point = fact
|
|
74
|
+
elif size == 2:
|
|
75
|
+
measurement, point = fact
|
|
76
|
+
feature = getattr(measurement, "feature", None)
|
|
77
|
+
parameter = getattr(measurement, "parameter", None)
|
|
78
|
+
else:
|
|
79
|
+
return None
|
|
80
|
+
if feature is None or not isinstance(parameter, str):
|
|
81
|
+
return None
|
|
82
|
+
try:
|
|
83
|
+
HoleRef.of(point)
|
|
84
|
+
except (AttributeError, TypeError, ValueError):
|
|
85
|
+
return None
|
|
86
|
+
return feature, parameter, point
|
|
87
|
+
|
|
88
|
+
|
|
60
89
|
def place_annotation(registry, items, obj, name=None, view=None, feature=None, measurement=None):
|
|
61
90
|
"""The annotation-placement primitive (#817): register *obj* under *name* — replacing any
|
|
62
91
|
prior object of that name (dropped from the render list *items*) so a name maps to one
|
|
@@ -168,6 +197,19 @@ def _wrap_rows(header, data, ncols):
|
|
|
168
197
|
return wide
|
|
169
198
|
|
|
170
199
|
|
|
200
|
+
def _font_safe_text(value) -> str:
|
|
201
|
+
"""Return the font-safe spelling used to measure and draw user text.
|
|
202
|
+
|
|
203
|
+
IBM Plex Mono does not contain U+2300 DIAMETER SIGN, so FreeType substitutes
|
|
204
|
+
its missing-glyph box. The drafting surface already uses U+00F8 LATIN SMALL
|
|
205
|
+
LETTER O WITH STROKE for diameter labels; use that established glyph at the
|
|
206
|
+
shared render seams as well. Keeping the substitution here makes free notes,
|
|
207
|
+
declared notes, title blocks, BOMs, revision tables, and hole tables measure
|
|
208
|
+
exactly the text they render while preserving the caller's semantic source data.
|
|
209
|
+
"""
|
|
210
|
+
return str(value).replace("⌀", "ø")
|
|
211
|
+
|
|
212
|
+
|
|
171
213
|
def _table_metrics(rows, font_size, pad_around_text, block_cols=None):
|
|
172
214
|
"""The sizing model of a data table: per-column left/right edges (page-mm,
|
|
173
215
|
block gaps inserted), total width/height, row height and effective block
|
|
@@ -186,7 +228,11 @@ def _table_metrics(rows, font_size, pad_around_text, block_cols=None):
|
|
|
186
228
|
bc = block_cols if (block_cols and ncol % block_cols == 0 and block_cols < ncol) else ncol
|
|
187
229
|
block_gap = 3 * pad # whitespace between side-by-side blocks
|
|
188
230
|
col_w = [
|
|
189
|
-
max(
|
|
231
|
+
max(
|
|
232
|
+
max(_text_width(_font_safe_text(r[c]), fs) for r in rows) + 2 * pad,
|
|
233
|
+
fs * 2.5,
|
|
234
|
+
)
|
|
235
|
+
for c in range(ncol)
|
|
190
236
|
]
|
|
191
237
|
# Per-column left/right edges, inserting block_gap before each new block.
|
|
192
238
|
lefts, rights, cursor = [], [], 0.0
|
|
@@ -232,11 +278,12 @@ def _build_table(rows, draft, block_cols=None):
|
|
|
232
278
|
for ri, row in enumerate(rows): # rows[0] (header) sits at the top
|
|
233
279
|
cy = total_h - (ri + 0.5) * row_h
|
|
234
280
|
for ci, cell in enumerate(row):
|
|
235
|
-
|
|
281
|
+
display = _font_safe_text(cell)
|
|
282
|
+
if not display:
|
|
236
283
|
continue
|
|
237
284
|
cx = (lefts[ci] + rights[ci]) / 2
|
|
238
285
|
text = Text(
|
|
239
|
-
txt=
|
|
286
|
+
txt=display,
|
|
240
287
|
font_size=fs,
|
|
241
288
|
font_path=PLEX_MONO,
|
|
242
289
|
align=(Align.CENTER, Align.CENTER),
|
|
@@ -1158,15 +1205,15 @@ def _make_title_block(dwg, a: Analysis):
|
|
|
1158
1205
|
it, last) and :func:`_title_block_box` (which measures its footprint for GD&T avoidance, #481)
|
|
1159
1206
|
so the two never drift."""
|
|
1160
1207
|
tb = TitleBlock(
|
|
1161
|
-
a.title,
|
|
1162
|
-
a.number,
|
|
1208
|
+
_font_safe_text(a.title),
|
|
1209
|
+
_font_safe_text(a.number),
|
|
1163
1210
|
scale=format_drawing_scale(a.SCALE),
|
|
1164
|
-
general_tolerance=a.tolerance,
|
|
1165
|
-
designed_by=_attribution_author(a.drawn_by),
|
|
1166
|
-
material=a.material,
|
|
1167
|
-
date=a.date,
|
|
1168
|
-
revision=a.revision,
|
|
1169
|
-
legal_owner=a.company,
|
|
1211
|
+
general_tolerance=_font_safe_text(a.tolerance),
|
|
1212
|
+
designed_by=_font_safe_text(_attribution_author(a.drawn_by)),
|
|
1213
|
+
material=_font_safe_text(a.material),
|
|
1214
|
+
date=_font_safe_text(a.date),
|
|
1215
|
+
revision=_font_safe_text(a.revision),
|
|
1216
|
+
legal_owner=_font_safe_text(a.company),
|
|
1170
1217
|
width=a.TB_W,
|
|
1171
1218
|
# Title block renders in condensed sans (the tight ISO 7200 cells), a
|
|
1172
1219
|
# different face from the monospace dimensions — so it carries its own
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"""Structured Part21 facts that OCCT's XCAF PMI transfer currently drops.
|
|
2
2
|
|
|
3
3
|
This is deliberately a leaf adapter: it understands ISO 10303-21 entities and units, but
|
|
4
|
-
knows nothing about XCAF labels, drafting IR, or placement. ``pmi.py`` owns the overlay
|
|
5
|
-
|
|
4
|
+
knows nothing about XCAF labels, drafting IR, or placement. ``pmi.py`` owns the overlay.
|
|
5
|
+
Geometric-tolerance facts require exact XCAF correspondence; manufacturing-requirement facts
|
|
6
|
+
retain their own complete property -> representation -> shape-aspect source chain.
|
|
6
7
|
"""
|
|
7
8
|
|
|
8
9
|
from __future__ import annotations
|
|
9
10
|
|
|
10
11
|
import math
|
|
12
|
+
import re
|
|
11
13
|
from dataclasses import dataclass
|
|
12
14
|
from pathlib import Path
|
|
13
15
|
|
|
@@ -53,6 +55,13 @@ _SI_METRE_TO_MM: dict[str, float] = {
|
|
|
53
55
|
".ATTO.": 1e-15,
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
# Entity names are invariant ASCII Part21 syntax; string parameters are not. Keying this
|
|
59
|
+
# guard on the literal category text silently missed valid ``\X2\...\X0\`` encodings before
|
|
60
|
+
# steputils had a chance to decode them. A file with no property definitions cannot carry
|
|
61
|
+
# the requirement chain, while any file that does is parsed conservatively (#1297). Match
|
|
62
|
+
# only the invariant token: Part 21 comments may legally separate it from the opening ``(``.
|
|
63
|
+
_PROPERTY_DEFINITION_MARKER = re.compile(rb"\bPROPERTY_DEFINITION\b", re.IGNORECASE)
|
|
64
|
+
|
|
56
65
|
|
|
57
66
|
@dataclass(frozen=True)
|
|
58
67
|
class GeometricToleranceFact:
|
|
@@ -84,7 +93,31 @@ class DatumOccurrenceFact:
|
|
|
84
93
|
reason: str = ""
|
|
85
94
|
|
|
86
95
|
|
|
96
|
+
@dataclass(frozen=True)
|
|
97
|
+
class ManufacturingRequirementFact:
|
|
98
|
+
"""One authoritative semantic manufacturing requirement from Part 21.
|
|
99
|
+
|
|
100
|
+
``entity_id`` is the ``PROPERTY_DEFINITION`` identity, while ``text`` comes from the
|
|
101
|
+
linked ``DESCRIPTIVE_REPRESENTATION_ITEM`` rather than presentation glyphs. The
|
|
102
|
+
remaining IDs preserve the semantic-callout -> shape-aspect -> representation-item
|
|
103
|
+
association for concept lowering; this leaf adapter deliberately does not interpret
|
|
104
|
+
those items as drafting features.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
entity_id: str
|
|
108
|
+
semantic_name: str
|
|
109
|
+
text: str
|
|
110
|
+
representation_id: str = ""
|
|
111
|
+
descriptive_item_id: str = ""
|
|
112
|
+
callout_ids: tuple[str, ...] = ()
|
|
113
|
+
shape_aspect_ids: tuple[str, ...] = ()
|
|
114
|
+
reference_item_ids: tuple[str, ...] = ()
|
|
115
|
+
reason: str = ""
|
|
116
|
+
|
|
117
|
+
|
|
87
118
|
def _entities(instance) -> tuple:
|
|
119
|
+
if instance is None:
|
|
120
|
+
return ()
|
|
88
121
|
entity = getattr(instance, "entity", None)
|
|
89
122
|
if entity is not None:
|
|
90
123
|
return (entity,)
|
|
@@ -158,6 +191,205 @@ def _datum_feature_items(step) -> dict[str, tuple[str, ...]]:
|
|
|
158
191
|
return {key: tuple(dict.fromkeys(values)) for key, values in result.items()}
|
|
159
192
|
|
|
160
193
|
|
|
194
|
+
def _text(value) -> str:
|
|
195
|
+
return str(value).strip() if isinstance(value, str) else ""
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _name_tokens(value: str) -> frozenset[str]:
|
|
199
|
+
"""Normalise semantic names for callout correspondence, not requirement inference."""
|
|
200
|
+
words = []
|
|
201
|
+
for raw in value.lower().replace("_", " ").replace("-", " ").split():
|
|
202
|
+
word = "".join(character for character in raw if character.isalnum())
|
|
203
|
+
if len(word) > 3 and word.endswith("s") and not word.endswith("ss"):
|
|
204
|
+
word = word[:-1]
|
|
205
|
+
if word and word != "requirement":
|
|
206
|
+
words.append(word)
|
|
207
|
+
return frozenset(words)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def _manufacturing_graph(step):
|
|
211
|
+
"""Collect the Part21 indexes shared by manufacturing-requirement facts."""
|
|
212
|
+
definitions: list[tuple[str, object]] = []
|
|
213
|
+
representations: dict[str, list[str]] = {}
|
|
214
|
+
callout_names: dict[str, str] = {}
|
|
215
|
+
callout_aspects: dict[str, list[str]] = {}
|
|
216
|
+
aspect_items: dict[str, list[str]] = {}
|
|
217
|
+
|
|
218
|
+
for section in step.data:
|
|
219
|
+
for entity_id, instance in section.instances.items():
|
|
220
|
+
definition = _entity_named(instance, "PROPERTY_DEFINITION")
|
|
221
|
+
if (
|
|
222
|
+
definition is not None
|
|
223
|
+
and len(definition.params) >= 2
|
|
224
|
+
and _text(definition.params[0]).lower() == "manufacturing requirement"
|
|
225
|
+
):
|
|
226
|
+
definitions.append((entity_id, definition))
|
|
227
|
+
|
|
228
|
+
relationship = _entity_named(instance, "PROPERTY_DEFINITION_REPRESENTATION")
|
|
229
|
+
if relationship is not None and len(relationship.params) >= 2:
|
|
230
|
+
definition_ref, representation_ref = relationship.params[:2]
|
|
231
|
+
if isinstance(definition_ref, p21.Reference) and isinstance(
|
|
232
|
+
representation_ref, p21.Reference
|
|
233
|
+
):
|
|
234
|
+
representations.setdefault(str(definition_ref), []).append(
|
|
235
|
+
str(representation_ref)
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
callout = _entity_named(instance, "DRAUGHTING_CALLOUT")
|
|
239
|
+
if callout is not None and callout.params:
|
|
240
|
+
callout_names[entity_id] = _text(callout.params[0])
|
|
241
|
+
|
|
242
|
+
association = _entity_named(instance, "DRAUGHTING_MODEL_ITEM_ASSOCIATION")
|
|
243
|
+
if association is not None and len(association.params) >= 5:
|
|
244
|
+
aspect_ref = association.params[2]
|
|
245
|
+
if isinstance(aspect_ref, p21.Reference) and _instance_is(
|
|
246
|
+
step, str(aspect_ref), "SHAPE_ASPECT"
|
|
247
|
+
):
|
|
248
|
+
for callout_ref in _references(association.params[4]):
|
|
249
|
+
if _instance_is(step, callout_ref, "DRAUGHTING_CALLOUT"):
|
|
250
|
+
callout_aspects.setdefault(callout_ref, []).append(str(aspect_ref))
|
|
251
|
+
|
|
252
|
+
usage = _entity_named(instance, "GEOMETRIC_ITEM_SPECIFIC_USAGE")
|
|
253
|
+
if usage is not None and len(usage.params) >= 5:
|
|
254
|
+
aspect_ref = usage.params[2]
|
|
255
|
+
if isinstance(aspect_ref, p21.Reference) and _instance_is(
|
|
256
|
+
step, str(aspect_ref), "SHAPE_ASPECT"
|
|
257
|
+
):
|
|
258
|
+
aspect_items.setdefault(str(aspect_ref), []).extend(
|
|
259
|
+
_references(usage.params[4])
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
return definitions, representations, callout_names, callout_aspects, aspect_items
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def read_manufacturing_requirements(
|
|
266
|
+
step_file: str | Path,
|
|
267
|
+
) -> tuple[ManufacturingRequirementFact, ...]:
|
|
268
|
+
"""Read authoritative semantic requirements and retain their geometry associations.
|
|
269
|
+
|
|
270
|
+
The property-definition chain owns the full requirement text. A draughting callout
|
|
271
|
+
with the same representation name (or, where the presentation adds a qualifier such as
|
|
272
|
+
``Straight``, the same semantic-name tokens) supplies the shape-aspect association.
|
|
273
|
+
This is correspondence between two source semantic identities; no nominal value or
|
|
274
|
+
B-rep measurement is guessed here.
|
|
275
|
+
"""
|
|
276
|
+
# A file with no property-definition entity cannot carry this semantic chain, so avoid a
|
|
277
|
+
# third full Part21 parse there. Once any property definition exists, parse
|
|
278
|
+
# conservatively: its string category may use a valid escape encoding that a byte-level
|
|
279
|
+
# literal check cannot interpret.
|
|
280
|
+
if _PROPERTY_DEFINITION_MARKER.search(Path(step_file).read_bytes()) is None:
|
|
281
|
+
return ()
|
|
282
|
+
step = p21.readfile(step_file)
|
|
283
|
+
(
|
|
284
|
+
definitions,
|
|
285
|
+
representations,
|
|
286
|
+
callout_names,
|
|
287
|
+
callout_aspects,
|
|
288
|
+
aspect_items,
|
|
289
|
+
) = _manufacturing_graph(step)
|
|
290
|
+
facts: list[ManufacturingRequirementFact] = []
|
|
291
|
+
|
|
292
|
+
for entity_id, definition in definitions:
|
|
293
|
+
semantic_name = _text(definition.params[1])
|
|
294
|
+
reasons: list[str] = []
|
|
295
|
+
if not semantic_name:
|
|
296
|
+
reasons.append("manufacturing requirement has no semantic name")
|
|
297
|
+
|
|
298
|
+
representation_ids = tuple(dict.fromkeys(representations.get(entity_id, ())))
|
|
299
|
+
representation_id = representation_ids[0] if len(representation_ids) == 1 else ""
|
|
300
|
+
if len(representation_ids) != 1:
|
|
301
|
+
reasons.append(
|
|
302
|
+
f"manufacturing requirement has {len(representation_ids)} linked representations"
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
representation_name = ""
|
|
306
|
+
descriptive_ids: tuple[str, ...] = ()
|
|
307
|
+
if representation_id:
|
|
308
|
+
representation = _entity_named(step.get(representation_id), "REPRESENTATION")
|
|
309
|
+
if representation is None or len(representation.params) < 2:
|
|
310
|
+
reasons.append(
|
|
311
|
+
f"linked representation {representation_id} is unavailable or malformed"
|
|
312
|
+
)
|
|
313
|
+
else:
|
|
314
|
+
representation_name = _text(representation.params[0])
|
|
315
|
+
descriptive_ids = tuple(
|
|
316
|
+
dict.fromkeys(
|
|
317
|
+
ref
|
|
318
|
+
for ref in _references(representation.params[1])
|
|
319
|
+
if _instance_is(step, ref, "DESCRIPTIVE_REPRESENTATION_ITEM")
|
|
320
|
+
)
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
descriptive_item_id = descriptive_ids[0] if len(descriptive_ids) == 1 else ""
|
|
324
|
+
text = ""
|
|
325
|
+
if representation_id and len(descriptive_ids) != 1:
|
|
326
|
+
reasons.append(f"linked representation has {len(descriptive_ids)} descriptive items")
|
|
327
|
+
if descriptive_item_id:
|
|
328
|
+
item = _entity_named(step.get(descriptive_item_id), "DESCRIPTIVE_REPRESENTATION_ITEM")
|
|
329
|
+
if item is None or len(item.params) < 2:
|
|
330
|
+
reasons.append(f"descriptive item {descriptive_item_id} is malformed")
|
|
331
|
+
else:
|
|
332
|
+
text = _text(item.params[1])
|
|
333
|
+
if not text:
|
|
334
|
+
reasons.append("manufacturing requirement has no authoritative text")
|
|
335
|
+
|
|
336
|
+
exact_callouts = tuple(
|
|
337
|
+
callout_id
|
|
338
|
+
for callout_id, name in callout_names.items()
|
|
339
|
+
if representation_name and name.casefold() == representation_name.casefold()
|
|
340
|
+
)
|
|
341
|
+
semantic_tokens = _name_tokens(semantic_name)
|
|
342
|
+
callout_ids = exact_callouts or tuple(
|
|
343
|
+
callout_id
|
|
344
|
+
for callout_id, name in callout_names.items()
|
|
345
|
+
if semantic_tokens and semantic_tokens <= _name_tokens(name)
|
|
346
|
+
)
|
|
347
|
+
missing_callout_associations = tuple(
|
|
348
|
+
callout_id for callout_id in callout_ids if not callout_aspects.get(callout_id)
|
|
349
|
+
)
|
|
350
|
+
if missing_callout_associations:
|
|
351
|
+
reasons.append(
|
|
352
|
+
"matched semantic callout(s) have no shape-aspect association: "
|
|
353
|
+
+ ", ".join(missing_callout_associations)
|
|
354
|
+
)
|
|
355
|
+
shape_aspect_ids = tuple(
|
|
356
|
+
dict.fromkeys(
|
|
357
|
+
aspect_id
|
|
358
|
+
for callout_id in callout_ids
|
|
359
|
+
for aspect_id in callout_aspects.get(callout_id, ())
|
|
360
|
+
)
|
|
361
|
+
)
|
|
362
|
+
missing_aspect_items = tuple(
|
|
363
|
+
aspect_id for aspect_id in shape_aspect_ids if not aspect_items.get(aspect_id)
|
|
364
|
+
)
|
|
365
|
+
if missing_aspect_items:
|
|
366
|
+
reasons.append(
|
|
367
|
+
"associated shape aspect(s) have no representation items: "
|
|
368
|
+
+ ", ".join(missing_aspect_items)
|
|
369
|
+
)
|
|
370
|
+
reference_item_ids = tuple(
|
|
371
|
+
dict.fromkeys(
|
|
372
|
+
item_id
|
|
373
|
+
for aspect_id in shape_aspect_ids
|
|
374
|
+
for item_id in aspect_items.get(aspect_id, ())
|
|
375
|
+
)
|
|
376
|
+
)
|
|
377
|
+
facts.append(
|
|
378
|
+
ManufacturingRequirementFact(
|
|
379
|
+
entity_id=entity_id,
|
|
380
|
+
semantic_name=semantic_name,
|
|
381
|
+
text=text,
|
|
382
|
+
representation_id=representation_id,
|
|
383
|
+
descriptive_item_id=descriptive_item_id,
|
|
384
|
+
callout_ids=tuple(dict.fromkeys(callout_ids)),
|
|
385
|
+
shape_aspect_ids=shape_aspect_ids,
|
|
386
|
+
reference_item_ids=reference_item_ids,
|
|
387
|
+
reason="; ".join(dict.fromkeys(reasons)),
|
|
388
|
+
)
|
|
389
|
+
)
|
|
390
|
+
return tuple(facts)
|
|
391
|
+
|
|
392
|
+
|
|
161
393
|
def _unit_factor_mm(step, unit_ref: str) -> tuple[float | None, str]:
|
|
162
394
|
unit = step.get(unit_ref)
|
|
163
395
|
if unit is None:
|
|
@@ -20,6 +20,7 @@ from build123d_drafting.helpers import DEFAULT_FONT_PATH, Dimension, Note, SafeD
|
|
|
20
20
|
|
|
21
21
|
from draftwright._core import ( # noqa: F401 — _anno_box re-exported (#700)
|
|
22
22
|
_anno_box,
|
|
23
|
+
_decode_hole_location_fact,
|
|
23
24
|
_text_size,
|
|
24
25
|
place_annotation,
|
|
25
26
|
)
|
|
@@ -129,7 +130,24 @@ def _annotation_hole_features(registry, name, annotation) -> frozenset:
|
|
|
129
130
|
if getattr(feature, "kind", None) in {"hole", "pattern"}:
|
|
130
131
|
features.add(feature)
|
|
131
132
|
for fact in getattr(annotation, "covers_hole_locations", ()):
|
|
132
|
-
|
|
133
|
+
decoded = _decode_hole_location_fact(fact)
|
|
134
|
+
if decoded is not None:
|
|
135
|
+
feature = decoded[0]
|
|
136
|
+
else:
|
|
137
|
+
# Replacement ownership is a broader question than whether a fact can
|
|
138
|
+
# prove axis-specific coverage. Legacy/external riders may carry only
|
|
139
|
+
# ``(measurement, point)``; retain that measurement's semantic owner
|
|
140
|
+
# even when it has no parameter and the strict decoder rightly refuses
|
|
141
|
+
# to treat it as location evidence.
|
|
142
|
+
try:
|
|
143
|
+
candidate = fact[0]
|
|
144
|
+
except (IndexError, TypeError):
|
|
145
|
+
continue
|
|
146
|
+
feature = (
|
|
147
|
+
candidate
|
|
148
|
+
if getattr(candidate, "kind", None) in {"hole", "pattern"}
|
|
149
|
+
else getattr(candidate, "feature", None)
|
|
150
|
+
)
|
|
133
151
|
if getattr(feature, "kind", None) in {"hole", "pattern"}:
|
|
134
152
|
features.add(feature)
|
|
135
153
|
for feature, _requirement, _count in getattr(
|
|
@@ -1743,14 +1761,24 @@ class PlacementContext:
|
|
|
1743
1761
|
"""Place an annotation onto the drawing through this context (#817) — the render passes'
|
|
1744
1762
|
door to the placement primitive, so a pass never reaches into the ``Drawing`` (ADR 0005
|
|
1745
1763
|
§2). Registers *obj* under *name* (owning *view* + source *feature*) and appends it to the
|
|
1746
|
-
render list.
|
|
1764
|
+
render list. Opaque compiler provenance is resolved here, at the placement boundary,
|
|
1765
|
+
so public ``annotations_of(IR feature)`` / ``drop(IR feature)`` keep their value-based
|
|
1766
|
+
contract for immediate passes as well as corridor-drained candidates. Returns *obj*."""
|
|
1747
1767
|
if self.items is None:
|
|
1748
1768
|
raise ValueError(
|
|
1749
1769
|
"PlacementContext.place() needs the drawing's render list — construct the context "
|
|
1750
1770
|
"with items=dwg.items (the orchestrator and Drawing verbs already do; a unit test "
|
|
1751
1771
|
"calling a render helper must pass it too)."
|
|
1752
1772
|
)
|
|
1753
|
-
return place_annotation(
|
|
1773
|
+
return place_annotation(
|
|
1774
|
+
self.registry,
|
|
1775
|
+
self.items,
|
|
1776
|
+
obj,
|
|
1777
|
+
name,
|
|
1778
|
+
view,
|
|
1779
|
+
resolve_feature(feature),
|
|
1780
|
+
measurement,
|
|
1781
|
+
)
|
|
1754
1782
|
|
|
1755
1783
|
def feature_of_hole_at(self, location):
|
|
1756
1784
|
"""The IR hole/pattern feature whose member sits at model-space *location*, or ``None``
|