mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
3.2 KiB
3.2 KiB
@sumisonic/bezier-kit-core
0.2.0
Minor Changes
-
4ad6856Thanks @sumisonic! - Add hot-path Frenet and Catmull-Rom APIs for allocation-free 3D geometry.New public API
- Frenet frames (3D):
writeFrenetFrames(out, path, samples, options?)— in-place double-reflection frames toFloat32ArrayreadFrenetFrame(frames, frameIdx)— read asFrenetFrame { position, tangent, normal, binormal }: Point3DcomputeFrenetFrames(path, samples, options?)— convenience wrapperFRENET_STRIDE = 12/FRENET_OFFSETconstants, stable within major version
- Catmull-Rom Float32Array writers (3D):
writeCatmullRomSegments(out, controlPoints, pointCount, options?)— flat xyz → 12 floats/segmentwriteFrenetFramesFromSegments(out, segments, segCount, samples, options?)writeFrenetFramesFromCatmullRom(out, controlPoints, pointCount, samples, options?)— one-shot wrapperCATMULL_ROM_SEGMENT_STRIDE = 12/CATMULL_ROM_SEGMENT_OFFSETconstants, stable within major version
No breaking changes
All existing APIs (
arcLengthToParam,createArcLengthIndex,pointAtLength,tangentAtLength,fromCatmullRom, etc.) are unchanged in signature and behavior.Performance (micro-benchmark, 20 segments × 101 samples, 3D)
writeFrenetFramesvscreateArcLengthIndex + pointAt + tangentAtloop: ~50x fasterwriteFrenetFramesFromCatmullRomwith segments buffer reuse: ~80x faster thanfromCatmullRom + writeFrenetFramesper frame
Numerical agreement
writeCatmullRomSegmentsmatchesfromCatmullRomat float32 precision (within 1e-4)writeFrenetFramesis orthonormal (|T| = |N| = |B| = 1, T·N ≈ N·B ≈ T·B ≈ 0 within 1e-5)
- Frenet frames (3D):
0.1.0
Minor Changes
f575c3fThanks @sumisonic! - Initial release ofbezier-kit.@sumisonic/bezier-kit-core: zero-dependency cubic-bezier geometry layer with 2D / 3D support via a<P extends Point>generic that is propagated through every API (BezierSegment<P>,BezierPath<P>,BBox<P>, etc.). Includes: types, math utilities, bbox (BBox2D/BBox3Dvia conditional type), segment / path operations (split, interpolate, match-count), arc-length index (O(N) scan + O(log N) binary search), Catmull-Rom / polyline constructors,pointAtLength/tangentAtLength, and the functormapPoints(2D ↔ 3D conversion, translation, scale, etc.).@sumisonic/bezier-kit-style: style-aware morphing and splitting, built on top of core and constrained to 2D (<P extends Point2D>). Includes hex color validation + interpolation, linear-gradient remap, stroke / styled-path interpolator and splitter, styled-path count matcher.- ESM + CJS dual publish with
.d.ts/.d.ctsandsideEffects: falsefor tree-shaking. - Merges and generalizes the bezier / bezier-utils modules from the
arte-webproject and the@sumisonic/find-point-on-pathlibrary, removing fp-ts and Effect Schema dependencies.