You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Determines the position of a point on the path, given by its progress from 0 to 1 along the path.
1241
+
/// If multiple subpaths make up the path, the whole number part of the progress value selects the subpath and the decimal part determines the position along it.
1242
+
#[node_macro::node(name("Position on Path"), category("Vector"), path(graphene_core::vector))]
1243
+
asyncfnposition_on_path(
1244
+
_:implCtx,
1245
+
/// The path to traverse.
1246
+
vector_data:VectorDataTable,
1247
+
/// The factor from the start to the end of the path, 0–1 for one subpath, 1–2 for a second subpath, and so on.
1248
+
progress:f64,
1249
+
/// Swap the direction of the path.
1250
+
reverse:bool,
1251
+
/// Traverse the path using each segment's Bézier curve parameterization instead of the Euclidean distance. Faster to compute but doesn't respect actual distances.
1252
+
parameterized_distance:bool,
1253
+
) -> DVec2{
1254
+
let euclidian = !parameterized_distance;
1255
+
1256
+
let vector_data_transform = vector_data.transform();
1257
+
let vector_data = vector_data.one_instance().instance;
1258
+
1259
+
let subpaths_count = vector_data.stroke_bezier_paths().count()asf64;
1260
+
let progress = progress.clamp(0., subpaths_count);
1261
+
let progress = if reverse { subpaths_count - progress }else{ progress };
1262
+
let index = if progress >= subpaths_count {(subpaths_count - 1.)asusize}else{ progress asusize};
/// Determines the angle of the tangent at a point on the path, given by its progress from 0 to 1 along the path.
1273
+
/// If multiple subpaths make up the path, the whole number part of the progress value selects the subpath and the decimal part determines the position along it.
1274
+
#[node_macro::node(name("Tangent on Path"), category("Vector"), path(graphene_core::vector))]
1275
+
asyncfntangent_on_path(
1276
+
_:implCtx,
1277
+
/// The path to traverse.
1278
+
vector_data:VectorDataTable,
1279
+
/// The factor from the start to the end of the path, 0–1 for one subpath, 1–2 for a second subpath, and so on.
1280
+
progress:f64,
1281
+
/// Swap the direction of the path.
1282
+
reverse:bool,
1283
+
/// Traverse the path using each segment's Bézier curve parameterization instead of the Euclidean distance. Faster to compute but doesn't respect actual distances.
1284
+
parameterized_distance:bool,
1285
+
) -> f64{
1286
+
let euclidian = !parameterized_distance;
1287
+
1288
+
let vector_data_transform = vector_data.transform();
1289
+
let vector_data = vector_data.one_instance().instance;
1290
+
1291
+
let subpaths_count = vector_data.stroke_bezier_paths().count()asf64;
1292
+
let progress = progress.clamp(0., subpaths_count);
1293
+
let progress = if reverse { subpaths_count - progress }else{ progress };
1294
+
let index = if progress >= subpaths_count {(subpaths_count - 1.)asusize}else{ progress asusize};
0 commit comments