/** * Section hatching for clip caps (CAD mode, shader-only). The per-solid cap quads * draw hatch lines anchored to the plane (stable while rotating/panning) whose * spacing is kept at a constant pixel distance by a per-frame world-per-pixel * uniform. The outline of the caps is drawn separately (see cap-outline.ts); for its * id pass the same cap shader can output the cap's id instead of its color. * * All shared uniforms are plain `{ value }` objects held by reference, so a single * write (e.g. the per-frame hatch spacing) updates every patched material without a * recompile. */ import * as THREE from "three"; /** Distance between hatch lines in pixels. */ export declare const HATCH_SPACING_PX = 8; /** Width of a hatch line in pixels. */ export declare const HATCH_LINE_WIDTH_PX = 1; /** Uniforms shared by all hatch patched cap materials of one clipping setup. */ export interface HatchUniforms { /** World units between hatch lines (before the per-solid scale); set per frame. */ uHatchSpacing: { value: number; }; /** Half the cap quad size: maps the quad's [-1, 1] geometry to plane units. */ uCapHalfSize: { value: number; }; uHatchLineWidth: { value: number; }; uHatchOn: { value: number; }; /** 1 while the cap outline id pass renders: caps output their id, not a color. */ uCapIdPass: { value: number; }; } export declare function createHatchUniforms(capHalfSize: number): HatchUniforms; /** * World units covered by one screen pixel at the given point (exact for an * orthographic camera; at the point's distance for a perspective camera). */ export declare function worldPerPixel(camera: THREE.Camera, point: THREE.Vector3, height: number): number; /** * Patch a cap quad material to draw section hatching. `index` is the solid's index * among the caps of its plane; it selects the hatch direction and spacing. `capId` * is the cap's unique id color for the outline id pass (see `capIdColor`). */ export declare function patchHatchMaterial(material: THREE.Material, uniforms: HatchUniforms, index: number, capId: THREE.Vector3): void;