mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-08 02:18:12 +08:00
Bezier-rs: Add method to check subpath insideness (#2183)
* add function to calculate if a subpath is inside polygon * make is_subpath_inside_polygon() flexible * obtimize is_subpath_inside_polygon function * move is_inside_subpath function to Subpath struct method * add interactive demo for subpath insideness * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
51d1c4eeac
commit
bf6ffbddeb
@@ -142,6 +142,27 @@ const subpathFeatures = {
|
||||
),
|
||||
inputOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
"inside-other": {
|
||||
name: "Inside (Other Subpath)",
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>): string =>
|
||||
subpath.inside_subpath(
|
||||
[
|
||||
[40, 40],
|
||||
[160, 40],
|
||||
[160, 80],
|
||||
[200, 100],
|
||||
[160, 120],
|
||||
[160, 160],
|
||||
[40, 160],
|
||||
[40, 120],
|
||||
[80, 100],
|
||||
[40, 80],
|
||||
],
|
||||
options.error,
|
||||
options.minimum_separation,
|
||||
),
|
||||
inputOptions: [intersectionErrorOptions, minimumSeparationOptions],
|
||||
},
|
||||
curvature: {
|
||||
name: "Curvature",
|
||||
callback: (subpath: WasmSubpathInstance, options: Record<string, number>, _: undefined): string => subpath.curvature(options.t, SUBPATH_T_VALUE_VARIANTS[options.TVariant]),
|
||||
|
||||
Reference in New Issue
Block a user