Bezier-rs: Add normal and tangent to subpath (#1003)

tangent and normal for subpath

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
This commit is contained in:
Jackie Chen
2023-01-31 00:15:37 -05:00
committed by Keavon Chambers
co-authored by Rob Nadal
parent beab0f01c6
commit 511a8aa164
4 changed files with 77 additions and 7 deletions
@@ -24,6 +24,14 @@ const subpathFeatures = {
mouseLocation ? subpath.project(mouseLocation[0], mouseLocation[1]) : subpath.to_svg(),
triggerOnMouseMove: true,
},
Tangent: {
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string => subpath.tangent(options.t),
sliderOptions: [tSliderOptions],
},
Normal: {
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string => subpath.normal(options.t),
sliderOptions: [tSliderOptions],
},
"Intersect (Line Segment)": {
callback: (subpath: WasmSubpathInstance): string =>
subpath.intersect_line_segment([