Commit Graph

25 Commits

Author SHA1 Message Date
Thomas Hallock 47ecbb3bc9 fixup! fix: expand heaven-earth-gap to 30pt to accommodate equal 19pt gaps for both heaven and earth inactive beads
fixup! fix: expand heaven-earth-gap to 30pt to accommodate equal 19pt gaps for both heaven and earth inactive beads

Adjust active earth bead positioning from 2pt to 1pt gap to match
active heaven beads distance from reckoning bar, ensuring consistent
active bead positioning for both heaven and earth beads.

Also updates visual regression reference image to reflect the
improved active bead positioning consistency.
2025-09-10 08:47:22 -05:00
Thomas Hallock a048e11f44 fix: expand heaven-earth-gap to 30pt to accommodate equal 19pt gaps for both heaven and earth inactive beads 2025-09-10 08:35:30 -05:00
Thomas Hallock 3424ca1d34 fix: position inactive heaven beads relative to reckoning bar with same 19pt gap as earth beads 2025-09-10 08:33:29 -05:00
Thomas Hallock 708cc91bcc fix: move inactive heaven beads to 2pt from top for 18pt gap from reckoning bar 2025-09-10 08:32:39 -05:00
Thomas Hallock 2a82902375 fix: move inactive heaven beads HIGHER for larger gap from reckoning bar
Previous fix moved them lower (worse). Now positioned at 7pt from top
giving 13pt gap from reckoning bar to better match earth bead gap.
2025-09-10 08:29:35 -05:00
Thomas Hallock 22c4bd3112 fix: simplify inactive heaven bead positioning for better gap matching
Simplified positioning to 3pt + bead-size/2 from top, giving 11pt gap
from reckoning bar. This should provide closer visual balance with
inactive earth bead gaps.

Removed complicated calculations and used direct, simple positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 08:25:00 -05:00
Thomas Hallock 421ec11efc fix: position inactive heaven beads with maximum gap using available space
Position inactive heaven beads at the top edge (bead-size/2) to maximize
their separation from the reckoning bar within the constraint of the
heaven section space.

This provides the best possible visual balance between inactive heaven
and earth beads while keeping active bead positioning intact:
- Inactive heaven: 6pt from top, 14pt gap from reckoning bar
- Active heaven: 13pt from top, just above reckoning bar
- Active earth: just below reckoning bar
- Inactive earth: large gap from reckoning bar at bottom

Updated all example images to show the optimized positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 08:21:59 -05:00
Thomas Hallock 8f88eeb071 fix: maximize inactive heaven bead gap from reckoning bar
Position inactive heaven beads much closer to top edge (7pt from top)
to create maximum visual separation from reckoning bar (13pt gap vs
previous 6pt gap).

This provides much better visual balance with the large gap that
inactive earth beads have from the reckoning bar, while keeping
heaven beads clearly in the upper portion of the soroban.

Updated all example images to show the maximized positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 07:26:07 -05:00
Thomas Hallock a7890873ed fix: improve visual balance of inactive heaven bead positioning
Increased inactive heaven bead gap from 3pt to 8pt for better visual
balance with earth beads. Now positioned at 14pt from top vs
reckoning bar at 20pt, giving 6pt clearance.

This provides more proportional spacing compared to earth beads
while keeping heaven beads clearly above the reckoning bar.

Updated all example images to reflect the improved positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 07:24:49 -05:00
Thomas Hallock 2d7d4efacc fix: position inactive heaven beads above reckoning bar, not below
My previous attempt to match earth bead gaps exactly resulted in
inactive heaven beads appearing below the reckoning bar at 27pt
while the bar is at 20pt.

Fixed by:
- Positioning inactive heaven beads at bead-size/2 + 3pt = 9pt from top
- This places them clearly above the reckoning bar (at 20pt)
- Removed unused inactive-bead-gap variable
- Active heaven beads remain just above the bar as intended

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 07:22:19 -05:00
Thomas Hallock 209ea0f13b fix: make inactive heaven bead gaps truly equal to earth bead gaps
The previous fix used a fixed 5pt gap for heaven beads while earth beads
used a calculated gap of (bead-size + bead-spacing) + 5pt = 21pt.

This fix:
- Adds inactive-bead-gap variable for consistency
- Makes inactive heaven beads use same gap calculation as earth beads
- Now both heaven and earth inactive beads have visually equal spacing
- Updated all example images to show the corrected equal spacing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 07:18:42 -05:00
Thomas Hallock 0c4eea5a04 fix: correct heaven bead positioning to match earth bead gap consistency
Fix heaven bead positioning issue where inactive heaven beads appeared
too close to the reckoning bar. Now inactive heaven beads use the same
5pt gap as inactive earth beads for visual consistency.

Changes:
- Inactive heaven beads: moved from 5pt+bead-size/2 to bead-size/2+5pt gap
- Active heaven beads: fine-tuned to heaven-earth-gap-bead-size/2-1pt
- Updated example images to reflect corrected positioning

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 07:15:53 -05:00
Thomas Hallock 33153108a2 feat: add single card template for PNG/SVG output
- Create templates/single-card.typ for individual card rendering
- Includes local copy of create-colored-numeral function
- Supports transparent backgrounds and exact card dimensions
- Used by PNG/SVG generation to avoid PDF intermediate

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 17:01:50 -05:00
Thomas Hallock e4aaaeab13 feat: add colored numerals feature to match bead colors
- Add create-colored-numeral function for coloring digits
- Support place-value, heaven-earth, and alternating color schemes
- Numerals on back of cards now use same colors as beads on front

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:23 -05:00
Thomas Hallock 06926262c1 Add full-page cutting guides for accurate card separation
- Implement horizontal and vertical cutting guides that extend across entire page
- Use subtle 50% gray lines (0.25pt) that won't be distracting if cut is slightly off
- Guides run through the gutter space between cards
- Automatically adjust to any grid layout (2x3, 3x3, 3x4, etc.)
- Controlled by existing --cut-marks flag
- Appear on both front and back sides for consistent cutting

The guides make it much easier to:
- Cut all cards to exactly the same size
- Make straight cuts across the entire page
- Maintain consistent spacing between cards
- Handle larger batches efficiently with a paper cutter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:18:08 -05:00
Thomas Hallock 7d8d7a1cfd Add color scheme support for enhanced learning
- Implement four color schemes: monochrome, place-value, heaven-earth, alternating
- Place-value: Different colors for ones (blue), tens (magenta), hundreds (orange), etc.
- Heaven-earth: Orange heaven beads, blue earth beads for visual distinction
- Alternating: Blue/green alternating columns for easier reading
- Add --color-scheme CLI flag and config support
- Create place-value-colors.yaml example config

Color coding helps students:
- Instantly recognize place values
- Distinguish between heaven and earth beads
- Reduce reading errors in multi-digit numbers
- Make learning more engaging and memorable

Default remains monochrome for printer-friendly output.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:15:04 -05:00
Thomas Hallock 0ab2a69b90 Add flexible cards-per-page support with dynamic grid layout
- Support common layouts: 1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30
- Add fallback logic for arbitrary card counts using square root calculation
- Remove panic on unsupported values - now handles any reasonable number
- Enable layouts like 18 cards (3x6) for larger batches

Users can now specify any cards-per-page value and get a reasonable
grid layout automatically calculated.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:05:07 -05:00
Thomas Hallock 152c495c40 Fix circle positioning to align with other shapes
- Wrap circles in a box for consistent top-left positioning
- All shapes now position from the same reference point
- Eliminates the bar appearing too high for circles only

Now all three shapes (diamond, square, circle) use the exact same
positioning logic with no special cases or exceptions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:56:17 -05:00
Thomas Hallock 472aa5fc63 Simplify bead positioning with consistent center-based logic
- All shapes now use center-based positioning (no exceptions)
- Remove shape-specific adjustments for cleaner code
- Calculate bead positions using centers for all shapes
- Diamond and square shapes offset from center appropriately

This eliminates the complex conditional logic and makes the code
much cleaner and easier to maintain. All three shapes now follow
the same positioning rules.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:53:31 -05:00
Thomas Hallock a8078b8110 Fix bead positioning for all shapes with proper alignment
- Circles use center-based positioning (original Typst behavior)
- Diamonds and squares use top-edge positioning
- Add shape-specific y-coordinate adjustments for consistent alignment
- Ensure all active beads properly touch the reckoning bar

Each shape now positions correctly relative to the reckoning bar,
with circles using their natural center positioning and other shapes
using top-edge positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:50:06 -05:00
Thomas Hallock 9ed1015bf3 Fix bead vertical alignment for all shapes
- Standardize bead positioning to use top edge as reference point
- Adjust circle positioning to match diamond and square alignment
- Ensure active beads properly touch the reckoning bar
- Fix issue where non-circle beads appeared too high

All bead shapes now align consistently with the reckoning bar,
with active beads properly positioned against it.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:46:53 -05:00
Thomas Hallock 8725d8b4ed Add configurable bead shapes with diamond as default
- Add three bead shape options: diamond (default), circle, square
- Implement diamond shape as horizontally elongated rhombus (realistic)
- Add draw-bead function to handle all three shape types
- Update CLI with --bead-shape parameter
- Create circle-beads.yaml config for traditional round beads

Diamond shape is now the default as it more accurately represents
real soroban/abacus beads which are typically bi-conical or
rhombus-shaped when viewed from the side.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:43:51 -05:00
Thomas Hallock 36b13bb54a Improve duplex printing support and documentation
- Clarify page ordering with detailed comments (fronts on odd, backs on even)
- Add PDF metadata for better document properties
- Improve qpdf linearization with object stream preservation
- Document duplex printing behavior in README
- Ensure consistent front/back pairing with explicit pagebreaks

The PDF now clearly alternates between soroban diagrams (odd pages)
and numerals (even pages) for reliable duplex printing with long-edge
binding.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:40:35 -05:00
Thomas Hallock 5596ef2c81 Add option to hide inactive beads for minimal display
- Add hide-inactive-beads parameter to draw-soroban function
- Conditionally render beads based on active state
- Add --hide-inactive-beads CLI flag
- Create minimal-beads.yaml config example
- Support both display modes: full (with grayed inactive) and minimal (active only)

This allows users to choose between two common soroban display
conventions: showing all beads with inactive ones grayed out, or
showing only the active beads for a cleaner look.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:38:15 -05:00
Thomas Hallock 1312eef345 Add Typst template for soroban flashcard generation
- Implement draw-soroban function for rendering abacus beads
- Create flashcard layout with front/back support
- Add generate-flashcards main function for batch generation
- Support configurable layouts (6/8/9 cards per page)
- Include duplex printing alignment with mirrored backs
- Pure vector graphics using Typst drawing primitives

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:13:51 -05:00