skia path offsetting #2

152 views
Skip to first unread message

Martin

unread,
Sep 13, 2021, 4:30:23 AM9/13/21
to skia-discuss
Hello,
I've tried to reply in the thread above, hovever my messages are getting deleted instantly so I post the follow up here. (https://groups.google.com/g/skia-discuss/c/tmdCrrFKYMc)

Thank you for the solution for path offsetting. I've found the method working for well-tempered configurations. When the stroke size is large on more complex paths seemingly random triangles appear here and there. For the inverse method (inner strokes) the path seems to dissolve when stroke size gets too large. I haven't analyzed further yet but for me I think the method is only usable if setting proper limits in which everything works well. How could such limits could be determined?

There have been discussions on this board in the past. A message from 2015 Cary (Clark?) posted he was working on an offset algorithm, any news on this? Thank you!

Martin

unread,
Sep 15, 2021, 5:00:03 AM9/15/21
to skia-discuss
To answer my question:
There is another simple way to achieve the effect of stroking a dashed outline with line caps:
First, the path is linearized and an two raw offset curves are computed. 
The offset curves are stroked with any stroke style (e.g. rounded caps).
Next, the original curve is filled on top of the two offset curves.
This works for outside offset curves. For inside curves I suppose this can be achieved with compositing.

offset.png
Reply all
Reply to author
Forward
0 new messages