增加笔画生产尺寸与数量报告
按最终矢量页面汇总每个相机单元的笔画包络,并标出低于 0.2 mm 的数量。 已核对 SVG、清单哈希和 Blender 导出,175 项相关测试通过。
This commit is contained in:
@@ -57,6 +57,8 @@ from camera_grid_stroke import DEFAULT_PARAMS as STROKE_DEFAULT_PARAMS # noqa:
|
||||
from camera_grid_stroke import render_stroke_polygons # noqa: E402
|
||||
from camera_grid_stroke_geometry import capsule_in_cell, projected_stroke_uv # noqa: E402
|
||||
from camera_grid_stroke_optimizer import optimize_angles # noqa: E402
|
||||
from stroke_production_report import REPORT_FILENAME as STROKE_REPORT_FILENAME # noqa: E402
|
||||
from stroke_production_report import write_report as write_stroke_report # noqa: E402
|
||||
from texture_merge import ( # noqa: E402
|
||||
MergeConfigError,
|
||||
MergePolicy,
|
||||
@@ -966,6 +968,7 @@ def main() -> int:
|
||||
|
||||
# ---- 5. Emit: mask each layout to its owned triangles ---------------------------
|
||||
emitted_stats: dict[str, dict[str, Any]] = {}
|
||||
stroke_views = []
|
||||
for pair, region_cam, _pattern_cam, uv_layer in resolved:
|
||||
pair_id = pair["id"]
|
||||
uv_map = pair["uv_map"]
|
||||
@@ -1191,12 +1194,13 @@ def main() -> int:
|
||||
geometry=filtered,
|
||||
)
|
||||
else:
|
||||
render_stroke_polygons(
|
||||
uv_map, base_layer, [poly for _, _, poly in emitted_patches],
|
||||
stroke_views.append(render_stroke_polygons(
|
||||
uv_map, base_layer, emitted_patches,
|
||||
texture_width, texture_height,
|
||||
{"width_mm": page_width_mm, "height_mm": page_height_mm},
|
||||
Path(pair["artifacts"]["png"]).with_suffix(""),
|
||||
)
|
||||
view_id=pair_id,
|
||||
))
|
||||
except Exception as exc: # noqa: BLE001
|
||||
print(
|
||||
f"ERROR: texture generation failed for view {pair_id!r}: {exc}",
|
||||
@@ -1407,6 +1411,12 @@ def main() -> int:
|
||||
_write_ground_truth(truth_path, truth)
|
||||
detail(f" ground truth -> {truth_path}")
|
||||
|
||||
if stroke_params is not None:
|
||||
stroke_report_path = truth_path.parent / STROKE_REPORT_FILENAME
|
||||
write_stroke_report(stroke_report_path, args.job.resolve(), stroke_params,
|
||||
stroke_views)
|
||||
report(f"stroke production report -> {stroke_report_path}")
|
||||
|
||||
# The artifact inventory is owned by the HOST, which is the only side that can verify the
|
||||
# files exist and are non-empty. Repeating it here was 11 of the run's lines printed twice.
|
||||
detail(f"Completed in {time.time() - start_time:.2f} seconds.")
|
||||
|
||||
Reference in New Issue
Block a user