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-30 21:15:37 -08:00
committed by Keavon Chambers
co-authored by Rob Nadal
parent 8a9b9e7c3c
commit c92222b4a3
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([