Back to Nappakura
SOURCE / PINNED RELEASE

Made of little things.

Nappakura

Release
a75ca0f8b596…
Author-recorded commit
4463126213fa…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-8db03001b62

Archive hash verified: b448d77b767ae754…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Nappakura</title>
  </head>
  <body>
    <main id="app" data-view="split">
      <div class="minimum">
        <strong>A little more room to unfold.</strong>
        <p>
          Enlarge this napplet to at least 280 × 280. Your model and edits stay
          here.
        </p>
      </div>
      <div class="editor">
        <header class="toolbar">
          <button id="import" class="primary">
            <span aria-hidden="true">↥</span> Open model
          </button>
          <button id="projectSave">Save project</button>
          <span class="separator"></span>
          <button id="undo" aria-label="Undo" title="Undo">↶</button
          ><button id="redo" aria-label="Redo" title="Redo">↷</button>
          <div class="toolbar-spacer"></div>
          <button id="unfold">Unfold again</button>
          <button id="export" class="export">
            <span aria-hidden="true">↧</span> Export PDF
          </button>
        </header>
        <div class="document-bar">
          <span class="document-name" id="modelName">Faceted gem</span
          ><span id="modelStats" class="mono"></span
          ><button id="help" class="text-button">How to use</button>
        </div>
        <nav class="view-switch" aria-label="Workspace view">
          <button data-view="split" class="split-option" aria-pressed="true">
            Split view</button
          ><button data-view="model" aria-pressed="false">3D model</button
          ><button data-view="pattern" aria-pressed="false">2D pattern</button
          ><button data-view="tools" aria-pressed="false">Tools</button>
        </nav>
        <div class="workspace">
          <section class="model-pane pane">
            <div class="pane-heading">
              <h1>3D model</h1>
              <button id="wire" aria-pressed="true">Seams</button
              ><span class="pane-spacer"></span
              ><button id="modelFit">Fit</button>
            </div>
            <div class="canvas-wrap">
              <canvas
                id="modelCanvas"
                aria-label="Interactive 3D model. Drag to orbit. Use the selection controls in Tools for keyboard editing."
              ></canvas>
              <div class="canvas-caption">DRAG TO ORBIT · TAP TO SELECT</div>
            </div>
            <div class="view-controls" aria-label="Model camera">
              <button id="orbitLeft" aria-label="Orbit left">←</button
              ><button id="orbitRight" aria-label="Orbit right">→</button
              ><button id="orbitUp" aria-label="Orbit up">↑</button
              ><button id="orbitDown" aria-label="Orbit down">↓</button
              ><span class="pane-spacer"></span
              ><button id="modelMinus" aria-label="Zoom model out">−</button
              ><button id="modelPlus" aria-label="Zoom model in">+</button>
            </div>
          </section>
          <section class="pattern-pane pane">
            <div class="pane-heading">
              <h2>2D pattern</h2>
              <span id="paperBadge" class="badge">A4 · mm</span
              ><span class="pane-spacer"></span
              ><button id="preview" aria-pressed="false">Print preview</button>
            </div>
            <div class="pattern-tools">
              <div class="segmented" aria-label="Editing mode">
                <button data-mode="select" aria-pressed="true">Move</button
                ><button data-mode="seam" aria-pressed="false">
                  Cut / join</button
                ><button data-mode="tab" aria-pressed="false">Tabs</button>
              </div>
              <button id="arrange">Arrange</button>
            </div>
            <div class="canvas-wrap">
              <canvas
                id="paperCanvas"
                aria-label="Paper pattern. Drag pieces to arrange. Use Tools for numeric placement and seam editing."
              ></canvas>
            </div>
            <div class="view-controls">
              <button id="pagePrev" aria-label="Previous sheet">‹</button
              ><span id="pageLabel" class="mono">Sheet 1 / 1</span
              ><button id="pageNext" aria-label="Next sheet">›</button
              ><button
                id="addPage"
                aria-label="Add a sheet and move selected piece"
              >
                + sheet</button
              ><span class="pane-spacer"></span
              ><button id="paperMinus" aria-label="Zoom pattern out">−</button
              ><button id="paperFit">Fit</button
              ><button id="paperPlus" aria-label="Zoom pattern in">+</button>
            </div>
          </section>
          <aside class="inspector" aria-label="Editing tools">
            <section class="inspector-section">
              <h2>Model & paper</h2>
              <label for="modelSize">Longest dimension <span>mm</span></label
              ><input
                id="modelSize"
                type="number"
                min="1"
                max="2000"
                step="1"
                value="100"
              />
              <div class="field-row">
                <div>
                  <label for="paperSize">Paper</label
                  ><select id="paperSize">
                    <option value="a4">A4</option>
                    <option value="letter">US Letter</option>
                  </select>
                </div>
                <div>
                  <label for="margin">Margin <span>mm</span></label
                  ><input
                    id="margin"
                    type="number"
                    min="8"
                    max="40"
                    value="10"
                  />
                </div>
              </div>
              <label class="check" for="landscape"
                ><input id="landscape" type="checkbox" /> Landscape
                sheets</label
              >
              <p class="hint">
                Size, paper and seam changes rearrange the pieces. PDF keeps
                exact scale.
              </p>
            </section>
            <section class="inspector-section">
              <h2>Selection</h2>
              <label for="pieceSelect">Piece</label
              ><select id="pieceSelect"></select>
              <div class="field-row">
                <div>
                  <label for="faceSelect">Polygon</label
                  ><input id="faceSelect" type="number" min="1" value="1" />
                </div>
                <div>
                  <label for="piecePage">Sheet</label
                  ><input
                    id="piecePage"
                    type="number"
                    min="1"
                    max="64"
                    value="1"
                  />
                </div>
              </div>
              <div class="field-row">
                <div>
                  <label for="pieceX">X <span>mm</span></label
                  ><input id="pieceX" type="number" step="0.1" />
                </div>
                <div>
                  <label for="pieceY">Y <span>mm</span></label
                  ><input id="pieceY" type="number" step="0.1" />
                </div>
              </div>
              <div class="field-row">
                <div>
                  <label for="pieceRotation">Rotation <span>°</span></label
                  ><input id="pieceRotation" type="number" step="15" />
                </div>
                <button id="rotate">Rotate 90°</button>
              </div>
              <label for="edgeSelect">Edge</label
              ><select id="edgeSelect"></select>
              <div class="button-pair">
                <button id="seamToggle">Cut edge</button
                ><button id="tabFlip">Switch tab</button>
              </div>
              <button id="tabHide" class="full">Hide tab</button>
            </section>
            <section class="inspector-section">
              <h2>Drawing</h2>
              <label class="check" for="tabs"
                ><input id="tabs" type="checkbox" checked /> Glue tabs</label
              >
              <div class="field-row">
                <div>
                  <label for="tabDepth">Tab depth <span>mm</span></label
                  ><input
                    id="tabDepth"
                    type="number"
                    min="1"
                    max="15"
                    step="0.5"
                    value="5"
                  />
                </div>
                <div>
                  <label for="tabTaper">Tab taper</label
                  ><input
                    id="tabTaper"
                    type="number"
                    min="0.05"
                    max="0.45"
                    step="0.05"
                    value="0.25"
                  />
                </div>
              </div>
              <label class="check" for="labels"
                ><input id="labels" type="checkbox" checked /> Matching edge
                numbers</label
              >
              <div class="field-row">
                <div>
                  <label for="labelSize">Label <span>mm</span></label
                  ><input
                    id="labelSize"
                    type="number"
                    min="1.5"
                    max="5"
                    step="0.1"
                    value="2.4"
                  />
                </div>
                <div>
                  <label for="lineWidth">Line <span>mm</span></label
                  ><input
                    id="lineWidth"
                    type="number"
                    min="0.1"
                    max="1"
                    step="0.02"
                    value="0.18"
                  />
                </div>
              </div>
              <div class="legend">
                <span><i class="cut"></i> Cut</span
                ><span><i class="mountain"></i> Mountain</span
                ><span><i class="valley"></i> Valley</span>
              </div>
            </section>
            <section class="inspector-section">
              <h2>Geometry & files</h2>
              <div class="button-pair">
                <button id="turnModel">Turn model 90°</button
                ><button id="flipNormals">Flip normals</button>
              </div>
              <p class="hint">
                Coincident vertices are welded on import. OBJ materials and
                textures are not imported.
              </p>
              <div class="button-pair">
                <button id="draftSave">Save draft</button
                ><button id="draftLoad">Restore draft</button>
              </div>
              <div class="button-pair">
                <button id="example">Load example</button
                ><button id="settings">Preferences</button>
              </div>
              <p id="capabilities" class="hint"></p>
            </section>
          </aside>
        </div>
        <div id="issues" class="issues" hidden></div>
        <footer class="statusbar">
          <span class="status-dot" aria-hidden="true"></span
          ><output id="status" aria-live="polite">Ready</output
          ><span id="pieceCount" class="mono"></span>
        </footer>
      </div>
      <dialog id="helpDialog" aria-labelledby="helpTitle">
        <form method="dialog">
          <button class="close" aria-label="Close help">×</button>
        </form>
        <h2 id="helpTitle">From mesh to paper</h2>
        <ol>
          <li>
            <strong>Open an OBJ or STL.</strong> Up to 2,000 triangles and 8
            MiB. A sample gem is ready to try.
          </li>
          <li>
            <strong>Set the longest dimension in millimetres.</strong> OBJ/STL
            do not reliably specify units; confirm your intended finished size.
          </li>
          <li>
            <strong>Explore the model.</strong> Drag to orbit; Shift-drag or
            right-drag to pan. Scroll or pinch to zoom. Select a face to locate
            it in both views.
          </li>
          <li>
            <strong>Choose Cut / join.</strong> Click a shared edge in either
            view. Seam changes rearrange pieces. Overlapping joins and cycles
            are refused.
          </li>
          <li>
            <strong>Move pieces on the sheet.</strong> Drag in Move mode, or use
            the X, Y, rotation and sheet fields in Tools. Arrange packs the
            pieces again.
          </li>
          <li>
            <strong>Adjust tabs.</strong> In Tabs mode, click a cut edge to
            switch its tab side. Tools also changes tab depth, taper and
            visibility. Tabs that collide are shortened or omitted; inspect
            warnings.
          </li>
          <li>
            <strong>Preview and export.</strong> Fix any off-page or overlapping
            pieces, export PDF, then download from the host's file panel. Print
            at 100% / Actual size. The reference bar must measure 20 mm.
          </li>
        </ol>
        <p>
          Save project exports an editable .nappakura file. Save draft uses
          optional host storage. Unsaved edits remain only in this session. Open
          surfaces may need manual fold-direction checks.
        </p>
        <form method="dialog">
          <button class="primary">Start making</button>
        </form>
      </dialog>
    </main>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>