Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigzag Shape fixes #2651

Merged
merged 6 commits into from
Jan 22, 2025
Merged

Zigzag Shape fixes #2651

merged 6 commits into from
Jan 22, 2025

Conversation

Logo121
Copy link
Contributor

@Logo121 Logo121 commented Jan 21, 2025

Preview

ծ‹›⧘⧙⧚⧛⦚𜺰, in max slant (‹› is not changed)
image

┌𜰉𜰉─𜰊𜰊
𜰊───┘𜰊

image


This PR mainly tries to address the problem of mask-based composition of line segments, which has these little spikes when slanted:
image
The changes aren't really applicable to the guillemets, which probably needs some special treatment. (Might open a separate issue for this)

  • Add a new knot interpolator sharp-corner, which simulates a "corner" biknot by calculating the intersection of the stroke edges of 2 straight lines intersecting at some reference point.
    • Assumes:
      • The knot types before/after the reference point leads to a straight line into/out of the reference (e.g. flat/curl)
      • The widths for the knots before/after are specified (the stroke information is not given otherwise)
        • The widths for the knots are assumed to be constant for the previous->reference and reference->next stroke segments.
      • The knot sink(?) is dispiro (the sink information is not given)
        • Currently the biknot is just simulated by the midpoint of the 2 edges (+ an absurd heading vector)
        • It's technically possible to arrange the knots such that the resulting knots work for both spiro-outline and dispiro, but it will further complicate the code.
  • Add 2 new shared shapes: Polyline and ClosedPolyline, which returns a list of knots to draw a polyline and polygonal stroke.
    • ClosedPolyline is currently not used but is tested to be functional.
  • Rewrite HZigzag and VZigzag to:
    • Include a new variant where the wave starts from the center (for 𜰉𜰊)
    • Extend the terminals so that the stroke actually reaches the edge (for 𜺰)
  • Use the new functions to:
    • Rewrite ծ so that the sharp bend is a bit cleaner in both code and the resulting geometry.
    • Clean up code for 𜺰, which previously used 2 extra strokes to extend the zigzag.
    • Clean up code for 𜰉𜰊, which finally uses HZigzag VZigzag in a relatively clean way.
  • Other changes:
    • Split some of the more geometric legacy symbols (including 𜺰) into its own module pictograph/geometric.ptl.

@be5invis
Copy link
Owner

Wow I always wanted to do this but never realized. Good job.

@be5invis be5invis merged commit d81c034 into be5invis:dev Jan 22, 2025
6 checks passed
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.

2 participants