[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93156":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":34,"discoverSource":35},93156,"Krbn","vpalos\u002FKrbn","vpalos","A web engine for pencil-style rendering of 3D scenes to SVG — exact silhouettes, hidden-line ghosting, hatching. Great for abstract and technical scenes.","",null,"TypeScript",69,1,2,0,16,42.5,"MIT License",false,"main",true,[23,24,25,26,27,28,29,30],"generative-art","non-photorealistic-rendering","npr","pen-plotter","rendering","sketch","svg","typescript","2026-07-22 04:02:08","# Krbn\n\n**I call it \"Carbon\", with the vowels sketched out.** A web engine for non-photorealistic,\npencil-style rendering of abstract and technical scenes — math and physics\nconstructions today, medical\u002Forganic illustration on the roadmap.\n\n> **Building something?** See **[API.md](API.md)** — a short guide to using Krbn to build scenes and animations.\n\n![a sphere resting in a gravity well, the sheet's hatching flowing into the dent](examples\u002Fgallery\u002F16-gravity-well.svg)\n\n> **[See the full example gallery →](examples\u002FREADME.md)** — multiple annotated\n> renders, real STL\u002FOBJ imports, and an animated camera orbit that stays calm\n> (the hand-drawn lines don't boil).\n\n## Why a pencil is a rendering problem\n\nMost graphics code answers one question: _what color is this pixel?_ A pencil\ndrawing answers a different one: _which lines would an artist draw — and which\nwould they leave out?_ Krbn is built around that second question.\n\nSo it does not render surfaces. It derives, classifies, and styles **strokes**\nfrom geometry. The silhouette of a sphere, a cylinder, a cone is not a mesh\nedge found by sampling — it is an exact conic, computed in closed form; a torus\nyields its true quartic. Hidden lines are not z-buffered away but split\nanalytically into visible and ghosted runs, the way a draftsman keeps the far\nedge of a box alive as a faint line.\n\nEven transparency works the way paper does. There is no alpha channel:\ncross-hatching is inherently see-through, and the gaps between strokes reveal\nwhat lies behind. Shading is hatch density; form is hatch _direction_, flowing\nalong each surface's own curvature — parallels and meridians on a sphere,\npoloidal loops on a torus, traced streamlines on an arbitrary mesh.\n\nExactness is a project value, not an optimization. Intersections are roots of\nlow-degree polynomials; degenerate cases — tangent lines, coincident conics,\ngrazing cusps — are the spec, not edge cases. The payoff is output you can\ntrust: the same scene always emits the same, byte-identical, diffable SVG.\n\nOne more inversion: the author supplies _semantics_, the engine supplies\n_mechanics_. You mark what matters — importance, focus, role — and Krbn decides\nwhat to draw, what to ghost, and what to abstract away, like an illustrator\ndeciding what the figure is actually _about_.\n\n![two trefoil knots, one hatched along its curvature, one hatched flat](examples\u002Fgallery\u002F15-mesh-showcase.svg)\n\nIt moves, too — and this is the part stills can't show: wobble is seeded on\nstable stroke identity, so the hand-drawn lines **don't boil** between frames.\nAn orbiting camera slides the silhouettes; nothing shimmers, jumps, or re-deals\nits jitter:\n\n![a camera orbit of a mixed scene — the hand-drawn lines stay calm](examples\u002Fkrbn-animation.gif)\n\nKrbn began as a research prototype and grew into a full pipeline: an analytic\nprimitive catalog and triangle meshes rendering through the _same_ five-stage\npass, with hidden-line visibility, suggestive contours, hand-drawn wobble, and\nvariable-width strokes. It is MIT-licensed and written in TypeScript — see the\nfull **[example gallery](examples\u002FREADME.md)**, and open a discussion if this\nproblem space interests you.\n\n## Genesis imperfecta\n\nThis project is a childhood dream, finally built. I always wanted to make\nsomething like this, and never had the time to research and learn everything\nit needed — until a recent medical issue suspended my normal work and,\nunexpectedly, handed me a few months to invest in the old idea.\n\nWhat fascinated me from the start is going _against_ photorealism. A human\nbeing can convey far more **meaning** in a drawing than any machine-like\nphotorealistic render — precisely by being willing to go the other way: to\nrenounce detail, to drop precision, even to deliberately introduce impurities\nand imperfections. Ah — but _which_ detail to drop? _Which_ imperfections to\nintroduce? That is the fascinating part, and it is the question this engine is\nreally trying to answer.\n\nAs a kid I wanted to call it _genesis imperfecta_, for exactly these reasons.\nWhat can I say — I was a kid. The name matured into Krbn; the fascination\ndidn't.\n\n## Disclaimer — built with AI, unapologetically\n\nKrbn was developed with heavy AI assistance, and there is no reason to hide it.\nIt started as an experiment: how far could a carefully directed human–AI\ncollaboration get on a hard rendering problem? The answer turned out to be —\nfar. The direction, the architecture, and the standards (exactness as a value,\ndegenerate cases as the spec) are human; much of the code was written in\ncollaboration with AI, then reviewed and tested like any other code. The\nresults above speak for themselves.\n\n> **Status & roadmap** live in one place, not here: **[`docs\u002FROADMAP.md`](docs\u002FROADMAP.md)**\n> holds the annotated build status and polish backlog, and\n> **[`docs\u002FDESIGN.md`](docs\u002FDESIGN.md)** holds the design, the implementation-status\n> breakdown, and the hard-parts registry. This README stays high-level.\n\n## Features\n\nEach links to a demo in the [gallery](examples\u002FREADME.md).\n\n- **Analytic primitives** — sphere, ellipsoid, cylinder, cone, plane, polygon,\n  line, points, and a torus, each with an _exact_ silhouette (conics; the torus a\n  quartic). ([solids](examples\u002Fgallery\u002F05-solid-shading.svg),\n  [torus](examples\u002Fgallery\u002F10-torus.svg))\n- **Free-form curves** — helices, Bézier curves (carried exactly as control\n  points), and function plots, sampled adaptively and occludable like anything else.\n  ([curves](examples\u002Fgallery\u002F17-parametric-curves.svg))\n- **Triangle meshes** — arbitrary organic geometry renders through the _same_\n  pipeline as the primitives, no fork: silhouette, shading, hidden-line, all shared.\n  Sharp **creases** on faceted solids are permanent view-independent edges.\n  ([knots](examples\u002Fgallery\u002F15-mesh-showcase.svg),\n  [creases](examples\u002Fgallery\u002F18-creases.svg))\n- **Exact hidden lines** — every contour is split into visible and hidden runs, the\n  hidden parts either ghosted (x-ray) or dropped (opaque) so depth reads at a glance.\n  Even points are occludable. ([hidden lines](examples\u002Fgallery\u002F01-hidden-lines.svg),\n  [ghost vs drop](examples\u002Fgallery\u002F19-hidden-modes.svg))\n- **Intersection curves** — where two surfaces meet (a ball through a plane, two\n  quadrics), the seam is drawn as its own contour.\n  ([waterline](examples\u002Fgallery\u002F03-depth-hatching.svg),\n  [quartic](examples\u002Fgallery\u002F08-quartic.svg))\n- **Suggestive contours** — the extra \"form lines\" an artist adds where a surface\n  _almost_ turns away, read from mesh curvature (DeCarlo et al.).\n  ([suggestive](examples\u002Fgallery\u002F14-suggestive.svg))\n- **Hatching & tone** — single \u002F cross \u002F triple cross-hatch, shaded **light→dark**\n  on curved surfaces and left flat on flat faces.\n  ([hatching](examples\u002Fgallery\u002F02-hatching.svg))\n- **Curvature-following hatch** — hatch that flows along a surface's own direction\n  field: exact iso-curves on primitives, traced streamlines on meshes.\n  ([fields](examples\u002Fgallery\u002F12-direction-fields.svg),\n  [gravity well](examples\u002Fgallery\u002F16-gravity-well.svg))\n- **Hand-drawn wobble** — one per-object knob turns ruler-clean lines sketchy; it\n  bends outlines and hatch together and stays deterministic.\n  ([wobble](examples\u002Fgallery\u002F04-wobble.svg))\n- **Variable stroke width** — solid lines are pencil-like ribbons: bolder when near\n  or important, tapering and swelling with pressure toward the ends.\n  ([torus](examples\u002Fgallery\u002F10-torus.svg))\n- **Abstraction** — detail too small to matter is dropped, tone is quantized, and\n  coincident lines merge into one clean stroke.\n  ([consolidation](examples\u002Fgallery\u002F09-consolidation.svg))\n- **Highlight** — x-ray emphasis: a bold outline inside a soft halo, dashed where\n  something hides it. ([highlight](examples\u002Fgallery\u002F06-highlight.svg))\n- **Deterministic SVG** — pure, seeded vector output; the same scene always yields\n  the same, diffable file.\n- **Pen-plotter output** — `svg: { centerline: true }` emits every stroke as a\n  single-line `\u003Cpath>` centreline (no `\u003Cpolyline>`, no filled ribbons), so the render\n  goes straight to an SVG→G-code converter. ([API.md](API.md#pen-plotters))\n\n## Why it works this way\n\n- **Strokes are the core object.** Every visual requirement is a policy over the\n  stroke set, not a shading model.\n- **Transparency without alpha.** Cross-hatching is inherently see-through: the\n  gaps reveal the ghosted hidden edges behind. Alpha is an optional later add.\n- **Analytic primitives first.** For quadrics, silhouettes are exact conics and\n  hidden-line visibility is exact — the hardest module is _easier_ here, not\n  skipped. Triangle meshes then plug in behind the very same interface.\n- **Author supplies semantics, engine supplies mechanics.** The developer marks\n  what matters (importance\u002Ffocus); the engine draws at the right level of detail.\n\n## Architecture at a glance\n\nA scene is a set of `FeatureSource`s. Each frame runs a five-stage pass:\n\n1. **Feature extraction** — silhouettes, creases, boundaries, suggestive &\n   intersection curves, plus hatch regions.\n2. **Visibility classification** — split each curve into visible\u002Fhidden intervals.\n3. **Abstraction filter** — drop sub-threshold detail, consolidate, apply importance.\n4. **Styling** — weight, seeded wobble (lines + hatch), variable stroke width,\n   dash, ghost, hatch density.\n5. **Emit** — sample analytic curves and hand to the backend (SVG first).\n\nFull detail, contracts, and the mesh\u002Forgan roadmap live in\n[`docs\u002FDESIGN.md`](docs\u002FDESIGN.md). A short phase view is in [`docs\u002FROADMAP.md`](docs\u002FROADMAP.md).\n\n## Project layout\n\n```\nsrc\u002F\n  math\u002F        vectors, Mat3\u002FMat4, Basis, AABB, Camera + projection\u002Funproject\n  curve\u002F       Curve \u002F Curve2D carriers + exact conic kernel, root solvers, sampler\n  pipeline\u002F    contract types, visibility, styling (wobble\u002Fwidth\u002Fhatch), emit, render\n  scene\u002F       the FeatureSource seam + Scene \u002F element \u002F importance model\n  primitives\u002F  analytic primitives (Quadric→Sphere\u002FEllipsoid\u002FCylinder\u002FCone, Plane,\n               Polygon, Line, ParametricCurve, Point, Torus)\n  backend\u002F     renderers — SVG (implemented)\n  mesh\u002F        deferred organ\u002Fmesh regime — see docs\u002FDESIGN.md §3\nexamples\u002F    runnable demos → *.svg (demo, styled, waterline)\ndocs\u002FDESIGN.md the full design & roadmap\n```\n\n## Development\n\n```bash\nbun install\nbun run typecheck\nbun run build\nbun test\n```\n\n## About the author\n\nI like building things that run well; tools that make math visible. Krbn is an\nopen-source attempt; another is **[AhaBlitz](https:\u002F\u002Fahablitz.ro)** — a game\nthat helps Romanian students prepare for their math exams (Evaluare Națională,\nBacalaureat), built on hand-crafted simulators.\n\n## License\n\nMIT — see [`LICENSE`](LICENSE). Update the copyright holder to your name\u002Forg.\n","Krbn 是一个面向非真实感渲染（NPR）的 Web 引擎，专用于将 3D 几何场景以手绘铅笔风格精确渲染为 SVG 格式。它基于解析几何计算精确轮廓线、隐藏线分段与虚化、方向性排线（hatching）及曲率驱动的笔触样式，支持 STL\u002FOBJ 导入、语义标注驱动的线条取舍，并实现帧间稳定的动画（无抖动\u002F闪烁）。适用于技术插图、数学物理可视化、工程示意图、医学图解等需高精度、可复现、可编辑矢量输出的抽象或专业场景。","2026-07-12 02:30:05","CREATED_QUERY"]