scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.09k stars 256 forks source link

3d: refactor flap+letter rendering; update 3d model and font generation #154

Closed scottbez1 closed 3 years ago

scottbez1 commented 3 years ago

This dev branch ended up getting a bit divergent, but implements a variety of changes to flap and font rendering, ultimately as part of the development of screen-printing jigs and artifacts.

Keepout handling examples:

Ignore

Existing behavior - keepout handling is disabled keepout_ignore model_keepout_ignore

Highlight

Highlight keepout violations in red keepout_highlight model_keepout_highlight

Cut

Automatically clip letter to avoid any contents in the keepout zone (may look bad) keepout_cut model_keepout_cut

Font preset example

This change includes a new example font preset, for the open font "Bangers", which demonstrates font parameter customization and per-letter overrides. In particular, the M and W required minor horizontal positioning tweaks to properly center them, and the Q, ,, and ' required more complex adjustments to size and vertical position to avoid keepout violations.

    "Bangers", [
        "font", "Bangers",
        "height", 0.85,
        "width", 0.7,
        "offset_x", -5.5,
        "offset_y", -1,
        "overrides", [
            ["M", 2.5, 0],
            ["Q", 0, 1, 0.82],
            ["W", -2, 0],
            [",", 0, -4, 0.6, .8],
            ["'", 0, 6, 0.65, .8],
        ],
    ],

font_bangers