Skip to content

How are offsets calculated? #20

Answered by steveruizok
aaronshenhao asked this question in Q&A
Discussion options

You must be logged in to vote

Ah the many weird corners of this algorithm. The answer is generally “lots of trial and error” mixed with “trying everything and seeing what worked”.

The first question has to do with pressure: the more pressure, the greater the radius, and so the greater the risk (iirc) of strange corners when a corner is not quite enough to create a cap. You can try the using the old offset code and drawing some upper case “M”s, and see if you can spot the difference.

The second question is easier to answer specifically: if we find a sharp corner, then the current vector is thrown out; we need to start the cap using the previous vector (which would have pointed to the current point).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by steveruizok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants