Is there a way to get square caps using the fat line material?

e.g. instead of this…

I would like this

Did you try this in the material:

dashed: true

There’s no easy way out-of-the-box. Each segment uses rounded endcaps for a smooth transition between the lines so the final ends are rounded, as well. You’d have to modify the shaders in order to add support for only making the first and last end caps straight.

Enabling dashed lines may be able to be hacked around to get this to work but I can’t say for sure.

2 Likes

Not perfect, but somewhat possible (defects appear when the object is rotated, or when the length of the end segments are smaller than their width):

https://codepen.io/boytchev/pen/eYqwXxz

3 Likes

I find the dash options produce too maybe gaps tears

I’ll perhaps look at the code.

Oh nice, that looks good, ill have a play with that. thank you

Hm I forgot that dashed removes the end caps from all segments - it’s not a setting use much because I’m not a huge fan of the artifacts.

Not perfect, but somewhat possible (defects appear when the object is rotated, or when the length of the end segments are smaller than their width):

https://codepen.io/boytchev/pen/eYqwXxz

Very nice!

2 Likes