Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion 3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
lines of text standing on the picture; the bar's buttons say their names and the foot holds the values, as in draw. They
are still written (the checks read them, and the crumb's part name), only not shown. */
body .hint,body .navhint,body .crumb{display:none!important}
body .foot .ptile.pic{padding:0;overflow:hidden} body .foot .ptile.pic img{width:100%;height:100%;object-fit:cover;border-radius:0} body .foot .ptile.pic .nm{display:none}
.ptile .tpick{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;cursor:pointer;border:none;padding:0}
.foot .hist img{height:64px;width:96px;border-radius:12px;border:1px solid var(--chip-line);opacity:1}
@media (pointer:coarse),(max-width:700px){
Expand Down Expand Up @@ -6343,7 +6344,10 @@
for(const o of LIB.list){ if(kind!==null && o.kind!==kind) sep(); kind=o.kind;
const t=tile('lib:'+o.name,o.thumb?'<img alt="" src="assets/'+o.thumb+'">':T_GLYPH.path('M12 3l8 4.5v9L12 21l-8-4.5v-9zM12 12v9M4 7.5l8 4.5l8-4.5'),o.name.replace(/[-_]/g,' '),false,()=>{
fetch('assets/'+o.file).then(r=>{ if(!r.ok) throw new Error('HTTP '+r.status); return r.text(); }).then(txt=>{ importTvf3d(txt,o.file,false); },err=>toast('could not read '+o.file+': '+(err.message||err))); });
t.title=o.name+(o.from?' (from '+o.from+')':'')+': add it to the object'; }
// THE PICTURE IS THE TILE (17 Nov 2026, Tom: "the 3d objects are quite small, and you remove text to a tooltip and fill the
// icon wiht the object?"): a small picture over a name left the object a speck. The picture has the whole tile and
// the name is the tile's tip (and what a reader of the screen is told).
t.classList.add('pic'); t.title=o.name.replace(/[-_]/g,' ')+(o.from?' (from '+o.from+')':'')+': add it to the object'; t.setAttribute('aria-label',o.name.replace(/[-_]/g,' ')); }
return; }
// THE SCENE'S TYPES ARE TILES (16 Nov 2026, Tom: "1 2 3 4 5 7", the third: "Each type could be a tile in the footer,
// like the parts are"). A type was a line of a list in a sheet, with its edit button; it is a tile now, saying how
Expand Down
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ line and the account of it in the `docs/` file, dated, in the voice those have.
**generated**: after adding, changing or removing a file there run `npm run library` (`tools/library.mjs`, which
opens each in the studio; `LIBS_DIR` as the tests take it), or `npm test` fails. The studio's Library button
(`#bLib`, THE LIBRARY, IN THE FOOT) lists them as tiles of the foot and a tile adds the object (`importTvf3d`).
A library tile is its picture, whole, with the name as its tip (`.ptile.pic`; "fill the icon with the object"); the
pictures are 216px squares of the object alone, close.
The first twenty-six are copies of games' `res/` props and wander's `res/` bodies; those pages still read their
own folders. They are served from the same site, so they can read this one (`../3d/assets/`).

Expand Down
Binary file modified assets/thumbs/asteroid-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/asteroid-grey.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/bumper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/moon-callisto.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/moon-ice.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/moon-io.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/moon-luna.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/moon-rust.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/pipe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-alien.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-jupiter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-lava.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-mars.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-neptune.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-ocean.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-saturn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-terra.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-uranus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/planet-venus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/rock.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/sun-blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/sun-orange.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/sun-red.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/sun-white.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/sun-yellow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/thumbs/windmill.jpg
17 changes: 10 additions & 7 deletions tools/library.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ const ORDER = ['object', 'prop', 'sun', 'planet', 'moon', 'asteroid'];
const server = createServer(async (q, r) => { try { const p = decodeURIComponent(q.url.split('?')[0]); const b = await readFile(join(ROOT, p === '/' ? '3d.html' : p));
r.writeHead(200, { 'content-type': { '.html': 'text/html', '.json': 'application/json', '.js': 'text/javascript' }[extname(p)] || 'application/octet-stream' }); r.end(b); } catch { r.writeHead(404); r.end(); } }).listen(0);
const launch = { args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader'] };
const browser = await chromium.launch(launch), page = await browser.newPage({ viewport: { width: 900, height: 600 } });
const browser = await chromium.launch(launch), page = await browser.newPage({ viewport: { width: 216, height: 216 } }); // the picture's own size: a tile is square, and its picture fills it
if (process.env.LIBS_DIR){ const lib = f => readFile(join(process.env.LIBS_DIR, 'three', f));
await page.route(/three\.js\/r128\/three\.min\.js/, async r => r.fulfill({ contentType: 'text/javascript', body: await lib('build/three.min.js') }));
for (const c of ['OrbitControls', 'TransformControls']) await page.route(new RegExp(c + '\\.js'), async r => r.fulfill({ contentType: 'text/javascript', body: await lib('examples/js/controls/' + c + '.js') })); }
await page.goto(`http://127.0.0.1:${server.address().port}/3d.html`, { waitUntil: 'load' });
await page.waitForFunction(() => window.__studio && __studio.S.parts.length > 0, null, { timeout: 60000 });

await mkdir(join(DIR, 'thumbs'), { recursive: true });
// the picture is the studio's own view with nothing over it (the bar, the foot, the gizmo), the object filling the square
await page.addStyleTag({ content: 'body *{visibility:hidden!important} #view canvas{visibility:visible!important}' });
const SHOT = await page.evaluate(() => { const c = document.querySelector('#view canvas'); const r = c.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height }; });
const files = (await readdir(DIR)).filter(f => f.endsWith('.tvf3d')).sort(), objects = [];
for (const file of files){
const name = file.replace(/\.tvf3d$/, ''), [kind, from] = kindOf(name), text = await readFile(join(DIR, file), 'utf8');
const img = await page.evaluate(async ([text, file]) => { const made = __studio.importTvf3d(text, file, true); __studio.S.sel = null; __studio.select_ && __studio.select_(null);
{ const c = __studio.cam(), o = __studio.orbit(); c.position.lerp(o.target, 0.55); c.updateProjectionMatrix(); o.update(); } // closer than the studio frames it: a tile's picture is small
await new Promise(ok => requestAnimationFrame(() => requestAnimationFrame(ok))); await new Promise(ok => setTimeout(ok, 250));
const H = __studio.hist(), h = H[__studio.hpos()]; return { img: h && h.img, parts: made.length }; }, [text, file]);
if (!img.img) throw new Error('no picture of ' + file);
await writeFile(join(DIR, 'thumbs', name + '.jpg'), Buffer.from(img.img.split(',')[1], 'base64'));
const parts = await page.evaluate(async ([text, file]) => { const made = __studio.importTvf3d(text, file, true); __studio.S.sel = null; __studio.select_ && __studio.select_(null);
await new Promise(ok => setTimeout(ok, 500)); // the framing glides
const c = __studio.cam(), o = __studio.orbit(); c.position.lerp(o.target, 0.33); o.update(); // closer than the studio frames it
await new Promise(ok => requestAnimationFrame(() => requestAnimationFrame(ok))); return made.length; }, [text, file]);
await writeFile(join(DIR, 'thumbs', name + '.jpg'), await page.screenshot({ clip: SHOT, type: 'jpeg', quality: 82 }));
const img = { parts };
objects.push({ name, file, kind, from, parts: img.parts, thumb: 'thumbs/' + name + '.jpg' });
console.log(file, kind, img.parts + ' part' + (img.parts > 1 ? 's' : ''));
}
Expand Down
Loading