# Dashed lines (made with Freestyle) are rendering inconsistently

I have a mesh that I've warped into a landscape (using a Displace modifier and a depth-map image). I've then gone into edit mode for that mesh, selected the edges running in one direction, and selected "Mark Freestyle Edge".

In this way I'm able to render those edges as solid lines using the Freestyle feature. I'm also able to render them as dashed lines.

However, some dash values result in inconsistently sized and spaced dashes, and I'm unable to find a behavior pattern that would explain it, nor or a fix to correct it. Can anyone help?

Edit: To knock things back to a more basic level, here's a simple mesh with 300x300 divisions and 10:20 (dash:space) lines applied to the edges running left-to-right. You can see that even that has problems, though in this case the dashes remain the same size but the spacing gradually seems to get out of whack.

And here's the same mesh (zoomed in) with 2:4 lines applied. In this case the dashes seem to be different weights.

So here's a test file for you (note that all this is happening inside Cycles):

And here's the result of that test file when I render it using the default render settings: As you can see, the line spacing is inconsistent:

Update May 5th, 2017: As per TK's suggestion I changed line 1009 of 2.78/scripts/freestyle/modules/parameter_editor.py so that sampling = 0.1 and this was the result: Still some oddness in there, but much much better. Perhaps his permanent fix in the next official release will resolve that. Thanks TK!

Thank you.

Dunstan

• What happens if you do a test disabling the displacement? It could be due to the effect of the modifier. – m.ardito Apr 13 '17 at 7:06
• Thanks for the suggestion. I'd already applied the displacement to that mesh and so couldn't undo it. Instead I made a new, simple mesh and updated my post with a couple of examples of the problems I saw with that. – Dunstan Apr 14 '17 at 4:31

The reported issue seems due to a bug in Freestyle. In the case of the latest 2.78 release, there's a line of code shown below at line 1009 of 2.78/scripts/freestyle/modules/parameter_editor.py:

sampling = 1.0


Decrease the assigned value to 0.1 for instance, and you will get much more consistent dashed lines. I will fix the bug so that you won't need to change the code starting from the next official release.

• Thanks so much! I've updated my post with the results of changing that value to 0.1. It's not perfect, but it'll get me where I need to be for now. I'll fiddle around with that value some more when I get time and see what happens. Thanks again for your help. – Dunstan May 5 '17 at 20:22

I can't get what you show in pictures above:

But I could be doing something different...? You could share your file on http://blend-exchange.giantcowfilms.com/ so we can use the same exact geometry.

I wonder if it could be some kind of this effect, instead: https://xkcd.com/1814/ :D

• Thanks for helping me out! If you look closely I'd say that your dashes also don't line up with each other, though it's a bit hard to tell. I've added a test file to my question and also included screenshots of what it looks like when I render using the default render settings. – Dunstan Apr 14 '17 at 18:26