かんたんな説明
森の散歩をえがいた厚いボードブック。どの丁にも前より少し小さな丸い穴があり、表紙から最後のページまで見通せます。
できあがり
Into the Wood(スペイン語版は『Al fondo del bosque』)。150ミリ角、20枚のボードでできたトンネルブックです。右ページはそれぞれ描かれた森の一層で(オーク、ジギタリス、コマドリ、シダの中のキツネ、フクロウ、シラカバ)、どれも前より少し小さな丸窓を同じ中心に抜いてあります。最後の層だけは抜かず、空き地の池にいる母ジカと子ジカです。表紙からのぞくと19の窓を通ってシカまで目が届き、ボードの切り口が木の幹のようにトンネルを囲みます。各丁の裏には、向かいの層を名指す一行の詩があります。印刷所に渡すPDFには、すべての窓が抜き型の版に載ります。
このレシピが答える質問
- 穴から二十ページ奥まで見えるトンネルブックを作るには?
- 抜き型の線をPDFの専用の版に載せて抜き型屋に渡すには?
手短な答え
// Leaf k (pages 2k − 1 and 2k) is cut with a circle of radius R1 · Q^(k − 1) round the
// same centre: 58 mm on the cover down to 12 mm on leaf 19. Leaf 20, the clearing, is
// whole, so from the cover the eye goes through nineteen windows to the far plane.
const [CX, CY, R1, Q] = [75, 66, 58, 0.9162];
const radius = (k) => R1 * Q ** (k - 1);
const leaves = Array.from({ length: 19 }, (_, i) => i + 1);
const dieCuts = {
shapes: leaves.map((k) => ({ id: `w${k}`, name: `${t({ en: 'Window', es: 'Ventana' })} ${k}`,
shape: 'circle', x: mm(CX - radius(k)), y: mm(CY - radius(k)),
width: mm(2 * radius(k)), height: mm(2 * radius(k)) })),
pages: leaves.map((k) => ({ pages: String(2 * k - 1), die: `w${k}` })), // recto of leaf k
corners: { radius: mm(4), edges: 'fore' },
};
材料
- 機能
- 抜き穴PDFの抜き型の線角丸と型抜きの本3Dの本のビューアー(Folio)見出しスタイルページデザインの画像ページデザインのテキスト・罫・ボックス文書のメタデータ段落スタイル裁ち落としとトンボCMYKとグレースケールのPDFPDFの書き出しリソースとしての図と表セマンティックカラーパレットキャンバス上のページ
- 種類
- Cormorant Garamond, Lora (SIL OFL 1.1)
- 素材
plane01.jpgplane02.jpgplane03.jpgplane04.jpgplane05.jpgplane06.jpgplane07.jpgplane08.jpgplane09.jpgplane10.jpgplane11.jpgplane12.jpgplane13.jpgplane14.jpgplane15.jpgplane16.jpgplane17.jpgplane18.jpgplane19.jpgplane20.jpg- Plane 1 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 2 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 3 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 4 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 5 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 6 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 7 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 8 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 9 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 10 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 11 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 12 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 13 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 14 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 15 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 16 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 17 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 18 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 19 of the wood (Generated With Diffusion Models, オリジナル)
- Plane 20 of the wood (Generated With Diffusion Models, オリジナル)
作り方
#1 · 同じ軸にそろえた19の窓
コードは上の手短な答えです。窓はループで作ります。k枚目の丁には同じ中心で半径R1 · Q^(k − 1)の円が与えられ、dieCuts.pagesがそれを2k − 1ページ、つまりその丁の表に置きます。穴は丁の両面を抜くので、裏にも同じ窓が左右反転して開きます。Q = 0.9162で、半径は18段階で58ミリから12ミリになります。
#2 · 窓と位置をそろえた森の層
// The plane pictures were scaled so each painting's opening meets its window, centred on
// (CX, CY), over a softened copy of itself; the window's centre is flat, the die takes it.
const SHEET = { width: mm(TRIM + 2 * BLEED), height: mm(TRIM + 2 * BLEED) };
const painting = { kind: 'image', id: 'painting', resourceId: '{attr.picture}', fit: 'cover',
placement: at('page', 'top-left', -BLEED, -BLEED, SHEET) };
const full = (elements) => ({ enabled: true, minHeight: mm(TRIM - TOP), slot: { elements } });
const plate = { kind: 'box', id: 'plate', placement: at('page', 'top-left', 25, 129,
{ width: mm(100), height: mm(17) }), style: { backgroundColor: col('forest') } };
const line = (id, content, y, size, color, extra) => ({ kind: 'text', id, content,
fontFamily: DISPLAY, fontSize: pt(size), lineHeight: 1.1, color: col(color),
align: 'center', placement: at('page', 'top-left', 25, y, { width: mm(100) }), ...extra });
const headingStyles = [
{ id: 'cover', numbered: false, toc: false, advancedDesign: full([painting, plate,
line('title', '{title}', 131, 21, 'cream', { fontWeight: 600 }),
line('subtitle', '{subtitle}', 139.5, 10.5, 'moss', { italic: true })]) },
{ id: 'plane', numbered: false, breakBefore: { enabled: true, parity: 'odd' },
advancedDesign: full([painting]) },
];
どの絵にも霧の空き間があるので、本に入れる前に絵を拡大縮小しました。各画像で、葉が輪の半分を覆う半径をピクセルで測り、その半径がその丁の窓に重なるよう、窓の中心に合わせて縮めています。表紙から見ると、各層は窓のまわりの細い葉の輪だけを見せ、輪が重なってトンネルになります。抜き型が取り去る中央は単色なので、ファイルはほとんど重くなりません。
#3 · Die版の19の円
print: { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false,
dieLine: { output: 'page', ink: 'Die', width: pt(0.5) } },
PDFは各窓と、小口側の角を丸めた各丁の輪郭を、オーバープリントでインキを載せないDieの分版に描きます。convertImages: falseで、40ページの絵でも1.5メガバイトに収まります。
#4 · 手の中のトンネル
folio: {
tilt: 40, yaw: -30,
paper: { type: 'board', shade: '#f4ecd6' },
binding: { type: 'hardcover', cover: 'pages', coverMaterial: 'paper' },
surface: { type: 'oak' },
lighting: { environment: 'daylight', intensity: 1.1 },
},
20枚のボードは厚いかたまりになり、Folioはそのすべてに窓を抜きます。閉じた本にはトンネルが現れ、切り口の壁が段になって空き地まで下りていきます。
#5 · 平らなページで20層
// `beneath` paints the page two on, which paints the page two on from it, and so on to
// the clearing: page 1 shows all twenty planes. Each canvas is painted once and reused.
const under = new Map();
const beneath = (i) => {
if (!under.has(i) && doc.pages[i]) {
const canvas = document.createElement('canvas');
under.set(i, canvas);
renderPageToCanvas(doc.pages[i], doc, canvas, { scale: 1, beneath });
}
return under.get(i);
};
beneathは2ページ先のページを、それ自身のbeneathで描きます。表紙の窓には3ページが、その窓には5ページが見え、39ページまで続きます。各ページは一度だけ描いて使い回します。
レシピの全体
// ═══ Postext Cookbook · Nº 195 · A tunnel book twenty leaves deep ═══════════════════════
// https://postext.dev/en/cookbook/forest-tunnel-book
// Code: MIT · Text: original (CC BY 4.0) · Paintings: generated with diffusion models
// Fonts: Cormorant Garamond, Lora (SIL OFL 1.1) · Needs postext ≥ 1.84.0
//
// Twenty board leaves, each printed with one plane of a wood and cut with a round window a
// little smaller than the one before. From the cover you look down the whole tunnel, past
// oaks, foxgloves, an owl and a fox, to a doe and her fawn at a pool in the clearing.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createFolioFromDocument } from 'https://esm.sh/postext-folio';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'forest-tunnel-book';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a deep forest green behind the words, cream type
const palette = {
forest: '#1c2a1e', // the versos, and the plate under the cover title
cream: '#f4ecd6', // all the type
moss: '#a9b98a', // the subtitle and the colophon
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
{ id: 'main-color', name: 'moss (defaults)', value: { hex: palette.moss, model: 'hex' } },
];
// #endregion
const [TRIM, BLEED] = [150, 3]; // mm: a square board book, and its bleed
const [TOP, SIDE] = [128, 14]; // the words on each verso sit under its window
const [DISPLAY, TEXT] = ['Cormorant Garamond', 'Lora'];
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
// #region answer: nineteen windows, each smaller than the last, all on one axis
// Leaf k (pages 2k − 1 and 2k) is cut with a circle of radius R1 · Q^(k − 1) round the
// same centre: 58 mm on the cover down to 12 mm on leaf 19. Leaf 20, the clearing, is
// whole, so from the cover the eye goes through nineteen windows to the far plane.
const [CX, CY, R1, Q] = [75, 66, 58, 0.9162];
const radius = (k) => R1 * Q ** (k - 1);
const leaves = Array.from({ length: 19 }, (_, i) => i + 1);
const dieCuts = {
shapes: leaves.map((k) => ({ id: `w${k}`, name: `${t({ en: 'Window', es: 'Ventana' })} ${k}`,
shape: 'circle', x: mm(CX - radius(k)), y: mm(CY - radius(k)),
width: mm(2 * radius(k)), height: mm(2 * radius(k)) })),
pages: leaves.map((k) => ({ pages: String(2 * k - 1), die: `w${k}` })), // recto of leaf k
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#角の丸い四角の窓
roundRectで角の半径を半幅の3分の1にすると、切り絵のようなやわらかい感じになります。
- shape: 'circle', x: mm(CX - radius(k)), y: mm(CY - radius(k)),
+ shape: 'roundRect', radius: mm(radius(k) / 3), x: mm(CX - radius(k)), y: mm(CY - radius(k)),#四隅をすべて丸める
小さな手のためのボードブックは、各丁の四隅を丸めます。
- corners: { radius: mm(4), edges: 'fore' },
+ corners: { radius: mm(8), edges: 'all' },クレジット
- 本文
- The verse of the walk and the colophon · Postext Cookbook · CC BY 4.0
- 画像
- Plane 1 of the wood · Generated With Diffusion Models · オリジナル
- Plane 2 of the wood · Generated With Diffusion Models · オリジナル
- Plane 3 of the wood · Generated With Diffusion Models · オリジナル
- Plane 4 of the wood · Generated With Diffusion Models · オリジナル
- Plane 5 of the wood · Generated With Diffusion Models · オリジナル
- Plane 6 of the wood · Generated With Diffusion Models · オリジナル
- Plane 7 of the wood · Generated With Diffusion Models · オリジナル
- Plane 8 of the wood · Generated With Diffusion Models · オリジナル
- Plane 9 of the wood · Generated With Diffusion Models · オリジナル
- Plane 10 of the wood · Generated With Diffusion Models · オリジナル
- Plane 11 of the wood · Generated With Diffusion Models · オリジナル
- Plane 12 of the wood · Generated With Diffusion Models · オリジナル
- Plane 13 of the wood · Generated With Diffusion Models · オリジナル
- Plane 14 of the wood · Generated With Diffusion Models · オリジナル
- Plane 15 of the wood · Generated With Diffusion Models · オリジナル
- Plane 16 of the wood · Generated With Diffusion Models · オリジナル
- Plane 17 of the wood · Generated With Diffusion Models · オリジナル
- Plane 18 of the wood · Generated With Diffusion Models · オリジナル
- Plane 19 of the wood · Generated With Diffusion Models · オリジナル
- Plane 20 of the wood · Generated With Diffusion Models · オリジナル
- フォント
- Cormorant Garamond (SIL OFL 1.1) · Lora (SIL OFL 1.1)


