Skip to content
pixi-silk
GitHub repository
Function

insertAnchor

import { insertAnchor } from 'pixi-silk/path';
function insertAnchor(
   path: BezierPath, 
   segment: number, 
   t: number
): {
  index: number;
  path: BezierPath;
};

Inserts an anchor on segment segment at t without changing the shape: the segment is split exactly (de Casteljau) and the neighbours’ handles shrink to match. Returns the new path and the new anchor’s index.

Parameters#

ParameterType
pathBezierPath
segmentnumber
tnumber

Returns#

{
  index: number;
  path: BezierPath;
}
NameTypeDefined in
indexnumberpath.ts:333
pathBezierPathpath.ts:333