Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: incorrect behaviour with block processor and metadata issue with splitdist #501

Closed
abey79 opened this issue Jun 24, 2022 · 1 comment · Fixed by #506
Closed

Bug: incorrect behaviour with block processor and metadata issue with splitdist #501

abey79 opened this issue Jun 24, 2022 · 1 comment · Fixed by #506
Labels
bug Something isn't working
Milestone

Comments

@abey79
Copy link
Owner

abey79 commented Jun 24, 2022

While building a complex command to address the painting use case (see discussion in #487), I uncovered multiple issues:

  1. faulty doc management in block:
with state.temp_document(keep_layer=False) as doc:

This construct is wrong, because doc might be replaced by the nested workflow (after execute_processors). Best use state.document throughout.

  1. splitdist doesn't appear to handle metadata properly

Experiment

I created a 3-color input file, with each layer named after the corresponding layer:

vpype random -l1 -n 200 -a 10cm 10cm name -l1 red color -l1 "#f00" random -l2 -n 200 -a 10cm 10cm name -l2 green color -l2 "#0f0" random -l3 -n 200 -a 10cm 10cm name -l3 blue color -l3 "#00f" write /tmp/multilayer.svg

Create 3 "well" files, using the same color names:

vpype circle 12cm 2cm 0.5cm pagesize -l 14x10cm write /tmp/well_red.svg
vpype circle 12cm 4cm 0.5cm pagesize -l 14x10cm write /tmp/well_green.svg
vpype circle 12cm 6cm 0.5cm pagesize -l 14x10cm write /tmp/well_blue.svg

Process each layer and insert corresponding well files every XXm:

vpype read /tmp/multilayer.svg forlayer eval "cur_color=_name" lmove %_lid% 1 splitdist 2m forlayer lmove %_lid% %_lid*2% read -l %_lid*2-1% /tmp/well_%cur_color%.svg end lmove all %_lid% end show
@abey79 abey79 mentioned this issue Jun 24, 2022
10 tasks
@abey79 abey79 added the bug Something isn't working label Jun 24, 2022
@abey79 abey79 added this to the 1.11.0 milestone Jun 24, 2022
@abey79
Copy link
Owner Author

abey79 commented Jun 25, 2022

The splitdist metadata issue should be fixed by #501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant