draftwright 0.1.1__tar.gz → 0.1.2__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.1 → draftwright-0.1.2}/PKG-INFO +1 -1
- {draftwright-0.1.1 → draftwright-0.1.2}/pyproject.toml +1 -1
- {draftwright-0.1.1 → draftwright-0.1.2}/src/draftwright/make_drawing.py +9 -7
- {draftwright-0.1.1 → draftwright-0.1.2}/tests/test_make_drawing.py +6 -3
- {draftwright-0.1.1 → draftwright-0.1.2}/.gitignore +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/CHANGELOG.md +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/LICENSE +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/README.md +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/skills/SKILL.md +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/src/draftwright/__init__.py +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/src/draftwright/pmi.py +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/tests/fixtures/nist_ctc_01_asme1_ap242.stp +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/tests/test_e2e_standards.py +0 -0
- {draftwright-0.1.1 → draftwright-0.1.2}/tests/test_pmi.py +0 -0
|
@@ -1254,15 +1254,14 @@ def _auto_annotate(dwg, a):
|
|
|
1254
1254
|
return a.PV_Y + (y - a.cy) * a.SCALE
|
|
1255
1255
|
|
|
1256
1256
|
# Tighten right-strip outer_limits to the actual iso view left edge now
|
|
1257
|
-
# that the iso has been projected and fitted.
|
|
1258
|
-
#
|
|
1259
|
-
#
|
|
1257
|
+
# that the iso has been projected and fitted. Always apply so that any
|
|
1258
|
+
# future allocations are bounded; warn when the cursor has already passed
|
|
1259
|
+
# the limit (dims already placed may overlap the iso view).
|
|
1260
1260
|
_iso_x0, _, _, _ = _iso_bbox(dwg)
|
|
1261
1261
|
_iso_x_limit = _iso_x0 - 4
|
|
1262
1262
|
for _rs in (a.fv_zones.right, a.pv_zones.right, a.sv_zones.right):
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
else:
|
|
1263
|
+
_rs.outer_limit = min(_rs.outer_limit, _iso_x_limit)
|
|
1264
|
+
if _rs._cursor >= _iso_x_limit:
|
|
1266
1265
|
_log.warning(
|
|
1267
1266
|
"right-strip cursor %.1f >= iso_x limit %.1f: right-strip dims"
|
|
1268
1267
|
" may overlap iso view (iso view overflows into annotation zone)",
|
|
@@ -2693,7 +2692,10 @@ def _fit_iso_view(dwg, a):
|
|
|
2693
2692
|
if extent > 0
|
|
2694
2693
|
]
|
|
2695
2694
|
needed = min(ratios, default=1.0)
|
|
2696
|
-
|
|
2695
|
+
# Apply a 2 % safety margin and floor to 4 decimal places to avoid
|
|
2696
|
+
# floating-point creep past the region boundary. The iso is NTS so
|
|
2697
|
+
# there is no need to constrain to "clean" fractions.
|
|
2698
|
+
factor = math.floor(needed * 0.98 * 10000) / 10000
|
|
2697
2699
|
_project_iso(dwg, a, a.SCALE * factor)
|
|
2698
2700
|
bb = _iso_bbox(dwg)
|
|
2699
2701
|
if not _bbox_within(bb, region):
|
|
@@ -1167,10 +1167,13 @@ def test_shrunk_iso_keeps_world_to_page_mapping(shrunk_iso_drawing):
|
|
|
1167
1167
|
vis, _hid = dwg.views["iso"]
|
|
1168
1168
|
bb = vis.bounding_box()
|
|
1169
1169
|
assert bb.min.X < centre[0] < bb.max.X and bb.min.Y < centre[1] < bb.max.Y
|
|
1170
|
-
#
|
|
1171
|
-
#
|
|
1170
|
+
# World +Z maps to page +Y; the offset must use the shrunk view scale (not
|
|
1171
|
+
# the sheet scale). Derive the actual shrunk scale from _coords so the
|
|
1172
|
+
# test does not depend on a specific discretised shrink factor.
|
|
1173
|
+
shrunk_scale = dwg._coords["iso"]._scale
|
|
1174
|
+
assert shrunk_scale < dwg.scale, "iso should be shrunk below sheet scale"
|
|
1172
1175
|
raised = dwg.at("iso", cx, cy, cz + 100)
|
|
1173
|
-
assert raised[1] - centre[1] == pytest.approx(100 *
|
|
1176
|
+
assert raised[1] - centre[1] == pytest.approx(100 * shrunk_scale)
|
|
1174
1177
|
|
|
1175
1178
|
|
|
1176
1179
|
@pytest.mark.timeout(60)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|