Name the generator Random Stroke Pattern
Align the Blender script and documentation with the stroke geometry. Verify the existing CLI output is byte-identical and the focused tests pass.
This commit is contained in:
@@ -227,7 +227,7 @@ blender -b sensors/finger/r01/source/geometry.blend -P blender/scripts/random_pa
|
|||||||
--vector-width-mm 164 --vector-height-mm 160
|
--vector-width-mm 164 --vector-height-mm 160
|
||||||
```
|
```
|
||||||
|
|
||||||
`binary-preview` derives PNG-only tracking trials from the existing color job
|
`binary-preview` makes Random Stroke Pattern (RSP) PNG trials from a color job
|
||||||
in a separate directory; `--views` selects the multiview job. Stroke width
|
in a separate directory; `--views` selects the multiview job. Stroke width
|
||||||
follows camera-cell print size, bounded to 0.11–0.28 mm. These image-space
|
follows camera-cell print size, bounded to 0.11–0.28 mm. These image-space
|
||||||
trials are for probe comparisons, not print masters; UV views may select
|
trials are for probe comparisons, not print masters; UV views may select
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
"""Generate binary pattern trials from existing colour texture jobs.
|
"""Generate Random Stroke Pattern (RSP) trials from colour texture jobs.
|
||||||
|
|
||||||
Run after the colour texture command has produced its PNGs::
|
Run after the colour texture command has produced its PNGs::
|
||||||
|
|
||||||
blender -b -t 2 --python-exit-code 1 \
|
blender -b -t 2 --python-exit-code 1 \
|
||||||
-P blender/scripts/binary_pattern_from_color.py -- \
|
-P blender/scripts/random_stroke_pattern.py -- \
|
||||||
--job build/textures/finger/r01/_texture_views_job.json \
|
--job build/textures/finger/r01/_texture_views_job.json \
|
||||||
--output-dir .scratch/binary-pattern-from-color/run-01
|
--output-dir .scratch/binary-pattern-from-color/run-01
|
||||||
|
|
||||||
@@ -520,7 +520,7 @@ def cmd_binary_preview(revision_dir: Path, args: argparse.Namespace) -> int:
|
|||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
return 2
|
return 2
|
||||||
code = _run_blender_script(
|
code = _run_blender_script(
|
||||||
"binary_pattern_from_color.py", paths.source_blend,
|
"random_stroke_pattern.py", paths.source_blend,
|
||||||
["--job", str(job_path), "--output-dir", str(output_dir),
|
["--job", str(job_path), "--output-dir", str(output_dir),
|
||||||
"--modes", "camera_compensated_width",
|
"--modes", "camera_compensated_width",
|
||||||
"--camera-width-fraction", str(args.camera_width_fraction)],
|
"--camera-width-fraction", str(args.camera_width_fraction)],
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def test_binary_preview_uses_job_and_preserves_colour_source(tmp_path, monkeypat
|
|||||||
monkeypatch.setattr(cli, "_run_blender_script", run_blender)
|
monkeypatch.setattr(cli, "_run_blender_script", run_blender)
|
||||||
assert cli.cmd_binary_preview(REVISION, _args(job_path, output_dir)) == 0
|
assert cli.cmd_binary_preview(REVISION, _args(job_path, output_dir)) == 0
|
||||||
assert colour.read_bytes() == b"original colour"
|
assert colour.read_bytes() == b"original colour"
|
||||||
assert calls[0][0] == "binary_pattern_from_color.py"
|
assert calls[0][0] == "random_stroke_pattern.py"
|
||||||
assert "--camera-width-fraction" in calls[0][2]
|
assert "--camera-width-fraction" in calls[0][2]
|
||||||
assert cli.cmd_binary_preview(REVISION, _args(job_path, output_dir)) == 2
|
assert cli.cmd_binary_preview(REVISION, _args(job_path, output_dir)) == 2
|
||||||
assert len(calls) == 1
|
assert len(calls) == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user