mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-07 12:58:11 +08:00
Bezier-rs: Add self_intersection to subpath (#1035)
* add self-intersection to subpath, rebased old work onto master * fix interactive website after rebase * fix rustdoc iframe placement * remove double comment * address comments * revert evaluate change * address comment + fix assert statement bug * update function comments
This commit is contained in:
committed by
Keavon Chambers
parent
4797aed05b
commit
f2d35f50de
@@ -1,4 +1,4 @@
|
||||
import { tSliderOptions } from "@/utils/options";
|
||||
import { tSliderOptions, intersectionErrorOptions, minimumSeparationOptions } from "@/utils/options";
|
||||
import { TVariant, SliderOption, SubpathCallback, WasmSubpathInstance } from "@/utils/types";
|
||||
|
||||
const subpathFeatures = {
|
||||
@@ -54,30 +54,50 @@ const subpathFeatures = {
|
||||
},
|
||||
"intersect-linear": {
|
||||
name: "Intersect (Line Segment)",
|
||||
callback: (subpath: WasmSubpathInstance): string =>
|
||||
subpath.intersect_line_segment([
|
||||
[150, 150],
|
||||
[20, 20],
|
||||
]),
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string =>
|
||||
subpath.intersect_line_segment(
|
||||
[
|
||||
[150, 150],
|
||||
[20, 20],
|
||||
],
|
||||
options.error,
|
||||
options.minimum_seperation
|
||||
),
|
||||
sliderOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
"intersect-quadratic": {
|
||||
name: "Intersect (Quadratic segment)",
|
||||
callback: (subpath: WasmSubpathInstance): string =>
|
||||
subpath.intersect_quadratic_segment([
|
||||
[20, 80],
|
||||
[180, 10],
|
||||
[90, 120],
|
||||
]),
|
||||
name: "Intersect (Quadratic Segment)",
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string =>
|
||||
subpath.intersect_quadratic_segment(
|
||||
[
|
||||
[20, 80],
|
||||
[180, 10],
|
||||
[90, 120],
|
||||
],
|
||||
options.error,
|
||||
options.minimum_seperation
|
||||
),
|
||||
sliderOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
"intersect-cubic": {
|
||||
name: "Intersect (Cubic segment)",
|
||||
callback: (subpath: WasmSubpathInstance): string =>
|
||||
subpath.intersect_cubic_segment([
|
||||
[40, 20],
|
||||
[100, 40],
|
||||
[40, 120],
|
||||
[175, 140],
|
||||
]),
|
||||
name: "Intersect (Cubic Segment)",
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string =>
|
||||
subpath.intersect_cubic_segment(
|
||||
[
|
||||
[40, 20],
|
||||
[100, 40],
|
||||
[40, 120],
|
||||
[175, 140],
|
||||
],
|
||||
options.error,
|
||||
options.minimum_seperation
|
||||
),
|
||||
sliderOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
"self-intersect": {
|
||||
name: "Self Intersect",
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string => subpath.self_intersections(options.error, options.minimum_seperation),
|
||||
sliderOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
split: {
|
||||
name: "Split",
|
||||
|
||||
Reference in New Issue
Block a user