ιαηδαπα

ovenbird - alpha

geome

Single-UMD generative geometry, animation and lightweight game graphics engine for Ovenbird

como usar

módulo
import * as geome from 'https://cdn.iandara.com/mjs/ovenbird/geome';
script clássico
<script src="https://cdn.iandara.com/js/ovenbird/geome.umd.min"></script>
<!-- window.geome -->
no monorepo
import * as geome from '@iandara/geome';
4 subcaminhos
  • @iandara/geome/geometryhttps://cdn.iandara.com/mjs/ovenbird/geome-geometry
  • @iandara/geome/spatialhttps://cdn.iandara.com/mjs/ovenbird/geome-spatial
  • @iandara/geome/profilehttps://cdn.iandara.com/mjs/ovenbird/geome-profile
  • @iandara/geome/primitiveshttps://cdn.iandara.com/mjs/ovenbird/geome-primitives

documentação

Browser-first ESM + UMD · global window.geome.

Generative geometry, animation and lightweight game graphics engine for Ovenbird.

Pure geometry for particle engines

@iandara/geome/geometry is an independent ESM entry with no DOM, canvas, renderer registration or animation loop. It reuses Geome's seeded random generator and returns reusable Float32Array positions and Uint32Array groups.

import {sample_discs, sample_segments} from '@iandara/geome/geometry';

const swarms = sample_discs(
    [
        {x: -0.5, y: 0, radius: 0.2},
        {x: 0.5, y: 0, radius: 0.2}
    ],
    6000,
    {seed: 'my-scene'}
);

const strokes = sample_segments(
    [
        {ax: -1, ay: 0, bx: 0, by: 0},
        {ax: 0.5, ay: 0, bx: 1, by: 1}
    ],
    6000,
    {seed: 'my-scene', jitter: 0.003}
);

sample_discs distributes the requested population equally among discs and uniformly within each area. sample_segments samples independent segments in proportion to arc length, without connecting separate strokes; group on a segment can override its default segment index. Coordinates have no imposed viewport or projection. Counts must be integers from 1 to 100000, coordinates finite, radii positive and total segment length nonzero.

@iandara/zordan/geome adapts these buffers to Visualdo's generic point-source contract. Zordan owns the Iandara mark and its choreography; Geome does not import either engine. CDN ESM entry: geome-geometry.

The same pure entry exports:

  • create_path_source([{points: [[x, y], ...], closed: false}, ...]): compiles independent polylines, exposes total length, at(progress, output) and sample(count, options). Lookup uses arc length and never bridges gaps between paths. Closed paths add their own final segment.
  • sample_topology(nodes, edges, count, {max_edges: 256, seed, jitter}): samples explicit [from_index, to_index] edges. Nodes have finite x/y; indices and connection budgets are validated before sampling. Returned topology preserves author-specified connectivity rather than inferring all-pairs links.
  • flow_along_topology(sample, time, output, {first, weight, amplitude, cycles, hertz, phase}): a pulse train that runs along every link of a sample_topology result, from the first node to the second. Samples carry along (0..1, where each one sits on its link) and do not travel: each swings around its place with a phase that depends on along, so the swing reads as crests of density running down the link. It is a travelling wave, not a conveyor: nothing wraps back to the start, so no target ever teleports and a field that chases the targets never draws a streak across the link. The displacement is added to output (positions already displayed), scaled by weight, so a morph that blends toward or away from the topology fades the wave with it, and the ends of every link stay put. It is a pure function of time. phase receives each sample's phase in cycles (a crest sits on an integer) for whoever wants to ride the light on the same wave. An amplitude that would let neighbours cross (amplitude · π · cycles ≥ ½) is refused.
  • sample_band(count, {rx, ry, width, seed, profile}): samples an elliptical band with an explicit elliptical exclusion region for text/negative space. profile: 'woven' adds a procedural width variation; it does not imitate an artist or replace the official Iandara geometry. Particle counts and random sampling remain reproducible.

Paths and graphs are compiled once; animation can move point targets or pulse colors using the owning runtime's time. None of these helpers imports a drawing engine or installs a clock.

Geome is browser-first and ships as a single UMD bundle:

<script src="https://cdn.iandara.com/js/ovenbird/geome.umd.min"></script>
<script>
    const app = window.geome.create_geome(document.getElementById('stage'));
    const cs = await app.create_coordinate_system('main', {type: 'multi_axis', axis_count: 16, line_count: 14, spacing: 32, proportion: 'golden_ratio'});
    await cs.calculate_points();
    await app.draw_axes(cs, {alpha: 0.15});
    await app.draw_path(cs, 'smooth_concentric', 'static_path', {max_segment_length: 100, include_origin: true});
    app.enable_camera_controls(); // drag to pan, wheel to zoom
</script>

Concepts

  • cs_strategies: coordinate-system strategies that generate point fields — cartesian, polar, tessellation, galaxy, isometric, iandara, multi_axis (SGU: N radial axes with front/back proportion groups and point dedup), voronoi.
  • axis_strategies: reusable axis layouts (cartesian_grid, radial, iandara, multi_axis).
  • path_strategies: point ordering or generation — snake, spiral, concentric, smooth_concentric, continuous, outward_burst, gravity_well, quadrant, corner_inward, axis_jump, axis_alternating, columnar, sinusoidal_wave, alternating, hilbert, fibonacci, random, diagonal, radial_sort, procedural, parametric, crypto, feather.
  • drawers: renderers for static, steppable, traced, organic, particle, unicode, math, feather and generative drawing plus layer effects.
  • color_strategies: hue_gradient, neon_glow (pulse + velocity aware), dimensional, sector, palette, axis_hue.
  • modifiers and filters: point transforms (rotate, twist, wave, noise, simplex) and layer post-processing.

Source is grouped by concern: core/ (math, geometry, layer, scene, registry, noise, physics, camera), geometry/ (pure sampling and spatial surfaces), coordinate-systems/, path-strategies/, color-strategies/, drawers/, transforms/ and engine/. api/exports.mjs is the single curated surface; main.mjs spreads it into the UMD global.

Multi-axis grids (SGU)

The multi_axis system reproduces the Iandara SGU field: 16 axes by default, even axes in the front group, odd axes in the back group with line spacing divided by a mathematical proportion (PROPORTIONS: square, golden_ratio, sqrt_2, silver_ratio, plastic_ratio, bronze_ratio). Overlapping lattice points are deduplicated and carry axis_angle, group, line_index and point_index metadata used by path and color strategies.

Camera

Every Geome app owns a Camera (pan/zoom, DPR-aware). Static layers re-render on camera change; layers created with {camera: false} stay in screen space (effects, HUD).

app.enable_camera_controls({pan: true, zoom: true});
app.camera.zoom_at(x, y, 1.2);
app.camera.reset();

Constant-speed tracing

The trace drawer draws the path at pixels_per_second with partial segments, echo trails, cell fills and segment culling:

await app.draw_path(cs, 'outward_burst', 'trace', {
    pixels_per_second: 1400,
    glow: 8,
    echo: true,
    include_origin: true,
    max_segment_length: 100,
    events: {finish: () => console.log('done')}
});

Feather

feather is a generative path strategy: it synthesises its own outline instead of ordering a grid. The shaft runs from the origin to the tip and each node is max_width · sin(πt) wide, so the profile tapers to zero at both ends. The sequence climbs the right edge, crosses the tip, comes back down the left edge and then repeats base→tip, which lays the shaft over the closed outline — traced in that order, the animation reads as a feather being drawn rather than assembled.

Geometry lives on the coordinate system (nested under feather or flat), rendering lives on the drawer:

const cs = await app.create_coordinate_system('main', {
    type: 'cartesian',
    feather: {shaft_nodes: 80, length: 900, max_width: 350, angle: -Math.PI / 2}
});
cs.set_origin({x: width / 2, y: height / 2 + 450}); // the feather grows upwards from its base

// whole feather in one frame
await app.draw_path(cs, 'feather', 'feather', {barb_length_max: 60, shaft_width: 3, line_width: 1});

// same feather, drawn step by step
const controller = await app.prepare_path(cs, 'feather', 'feather_trace', {barb_length_max: 60, shaft_width: 3, line_width: 1});
controller.play({steps_per_second: 60});

Both drawers share one barb routine, so feather and feather_trace (alias feather_line_trace) paint identical barbs for the same sequence — the step-by-step version is the static one unrolled in time, and prev / seek replay it exactly.

Barbs leave each node along the local tangent, opened by barb_angle to either side, with length barb_length_max · sin(π·progress). Colour goes through the package-wide resolution — a color_strategy wins, then color, and with neither the feather still comes up on the hue_start → hue_end gradient. The colour context carries part ('shaft' or 'barb'), so a strategy can treat the rachis differently from the vanes.

Drawer knobs: shaft_width, shaft_color, barb_length_max, barb_angle, barb_density (draw every Nth node), line_width, hue_start, hue_end, saturation, lightness.

Organic physics + collision

  • worm — a verlet chain along the path; the head pins to the origin and the mouse drags or attracts joints.
  • organism — a unicode-morph field that grows along its path over time (steps_per_second), simulates verlet constraints against grid neighbors and registers itself in the shared PhysicsWorld so organisms on different layers collide with each other and with the stage edges.
const controller = await app.draw_path(cs1, 'snake', 'organism', {gravity: 150, particle_radius: 8}, true, 'org_1');
await app.draw_path(cs2, 'snake', 'organism', {gravity: -150, pin_top_row: false, particle_radius: 8}, true, 'org_2');
app.physics().on('collide', event => console.log('collision', event));

PhysicsWorld uses a spatial hash broad-phase; any drawer can join by implementing get_collidable_particles() / on_particle_correct().

Layer effects

wave_effect, glow_effect and echo_effect read a source layer every frame and re-render it processed:

await app.add_effect('wave', {source: 'path', amplitude: 8});

Also included: texture (Iandara stripe texture) and stack (isometric 3D stack with orbit/zoom interaction).

Steppable Drawing

prepare_path() returns a PathController for externally guided drawing:

const controller = await app.prepare_path(cs, 'spiral', 'particle', {
    events: {
        point_reached: event => console.log(event.index, event.progress),
        halfway: () => console.log('halfway'),
        finish: () => console.log('done')
    }
});

controller.next();
controller.prev();
controller.seek(0.5);
controller.play({steps_per_second: 24});
controller.pause();

Events include start, before_step, after_step, point_reached, segment_start, segment_complete, progress, halfway, milestone, pause, resume, seek, reverse, reset, finish, cancel and error.

Unicode Morph Drawer

unicode_morph is a steppable Unicode drawer for living glyph fields. Each reached point becomes a physics entity with an evolving glyph, local constraints to nearby coordinate-system points, rotation from movement, optional mouse influence and external path control.

Export

const svg = app.export_svg({max_segment_length: 100});
app.download_svg('sgu_art.svg');

const png = app.export_png({background: '#0a0a0f'}); // data URL, every layer flattened
app.download_png('sgu_art.png', {layers: ['path']}); // or just the layers you name

A scene created with an explicit size renders at that size — its layers are pinned to it and the resize observer no longer pulls them back to the container — so a full-HD export is a normal render, not a screenshot:

const hd = create_geome(offscreen_container, {width: 1920, height: 1080});
await hd.draw_path(cs, 'feather', 'feather', {barb_length_max: 60});
hd.download_png('feather-hd.png');

sequence_to_svg(sequence, config) and compose_canvas(canvases, config) are also exported standalone.

Artist profile

ArtistProfile reads a profile compiled by iandara-artist-py. The profile publishes distributions, not averages — for each quantity, minimum, quartiles, median and maximum over hundreds of works — and the reader samples from the empirical distribution instead of collapsing it. What distinguishes a hand is not its typical stroke but the range it moves in, so two strokes off the same profile differ and both still belong to it.

  • stroke(name) / colour(name) — one measured quantity, under the name the profile actually uses.
  • paper_color() / ink_colors(limit) — the sheet, and the inks that do not dissolve into it.
  • accent_colors(limit, {min_presence}) — subject colour ranked by presence, not area. On scanned work the paper takes every slot of the area-weighted palette, and the artist's colour disappears from it.
  • stroke_count() / stroke_width_fraction() — how dense and how thick a composition of this corpus is.
  • credit() — who the drawing owes its line to: artist name, licence id, rights status, how many works were observed and which corpus revision. Facts only, no prose and no language: the screen writes the sentence, the library makes sure it cannot contradict the profile.

Utilities

  • SimplexNoise / create_noise(seed) — seeded 2D/3D simplex noise.
  • easing / resolve_easing(name) — easing curve library.
  • SpatialHashGrid — insert/remove/query/find_nearest.
  • VerletParticle, Constraint, Pool, PhysicsWorld.
  • SeededRandom, PROPORTIONS, resolve_proportion.

Development

Use the package and release tasks from the repository root:

task test:unit.package -- @iandara/geome
task iandara-ovenbird:build

The release build follows the Ovenbird pattern, writes dist/geome.umd.min.js and synchronizes the corresponding CDN asset.