Skip to content

Conversation

@danila-schelkov
Copy link

Rendering didn't change, code simplified

Here is a thing: both cases On&On and Off&Off for two nearest points leads us to get an average point between them.

Instead of handling lines (On&On) separately, let's turn them into degenerate quadratic curves by inserting a midpoint. That allows us to eliminate SEGMENT_LINE logic completely and treat everything uniformly as quadratic Béziers.

Furthermore, the algorithm acts as a two-point sliding window (cp1, cp2) that analyzes the previous and current contour points to decide how to form the next Segment. This allows us to reduce code repetition..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant