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
// let segment_t_parametric = bezpath.get_seg(segment_index).unwrap().euclidean_to_parametric(segment_t_euclidean, DEFAULT_EUCLIDEAN_ERROR_BOUND);
1314
-
// (segment_index, segment_t_parametric)
1315
-
(segment_index, segment_t_euclidean)
1316
-
}
1317
-
SubpathTValue::GlobalParametric(global_t) => {
1318
-
assert!((0.0..=1.).contains(&global_t));
1319
-
1320
-
if global_t == 1.{
1321
-
return(segment_len - 1,1.);
1322
-
}
1323
-
1324
-
let scaled_t = global_t * segment_len asf64;
1325
-
let segment_index = scaled_t.floor()asusize;
1326
-
let t = scaled_t - segment_index asf64;
1327
-
1328
-
(segment_index, t)
1329
-
}
1330
-
_ => unreachable!(),
1331
-
}
1332
-
}
1333
-
1334
1261
/// Determines the position of a point on the path, given by its progress from 0 to 1 along the path.
1335
1262
/// 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.
1336
1263
#[node_macro::node(name("Position on Path"), category("Vector"), path(graphene_core::vector))]
@@ -1350,7 +1277,7 @@ async fn position_on_path(
1350
1277
let vector_data_transform = vector_data.transform();
1351
1278
let vector_data = vector_data.one_instance().instance;
let seg = bezpath.get_seg(1 + seg_index).unwrap();
1369
-
point_to_dvec2(seg.eval(t))
1370
-
}
1289
+
1290
+
let position = position_on_bezpath(&bezpath, t, euclidian);
1291
+
point_to_dvec2(position)
1371
1292
})
1372
1293
}
1373
-
/////////////
1374
1294
1375
1295
/// Determines the angle of the tangent at a point on the path, given by its progress from 0 to 1 along the path.
1376
1296
/// 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.
0 commit comments