import type { Loop } from 'flo-boolean'; import type { PrePointOnShape } from '../point-on-shape/point-on-shape.js'; import { splitByCurvatureAndLength, controlPointLinesLength, getInflections } from 'flo-bezier3'; import { toP } from '../point-on-shape/to-p.js'; /** * Get useful points on the shape - these incude points of maximum curvature and * points at the bezier-bezier interfaces. * @param loop * @param additionalPointCount * * @internal */ function getFor2ProngsOnLoop( minBezLength: number, maxCurviness: number, maxLength: number) { return function(loop: Loop) { const for2Prongs: PrePointOnShape[] = []; const curves = loop.curves; for (let i=0; i t !== 0 && t !== 1); const byCurvatureAndLength: PrePointOnShape[] = ts.map(t => { const pDd = toP(curve.ps, t); const p = pDd.map(c => c[0] + c[1]); return { curve, t, isSource: true, p, pDd }; }); for2Prongs.push(...byCurvatureAndLength); } return for2Prongs; } } export { getFor2ProngsOnLoop }