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
+
1260
1334
/// Determines the position of a point on the path, given by its progress from 0 to 1 along the path.
1261
1335
/// 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.
1262
1336
#[node_macro::node(name("Position on Path"), category("Vector"), path(graphene_core::vector))]
let seg = bezpath.get_seg(1 + seg_index).unwrap();
1369
+
point_to_dvec2(seg.eval(t))
1370
+
}
1289
1371
})
1290
1372
}
1373
+
/////////////
1291
1374
1292
1375
/// Determines the angle of the tangent at a point on the path, given by its progress from 0 to 1 along the path.
1293
1376
/// 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