@@ -258,7 +258,8 @@ mod test {
258
258
use super :: * ;
259
259
use crate :: Node ;
260
260
use crate :: ops:: ExtractXyNode ;
261
- use crate :: vector:: VectorData ;
261
+ use crate :: transform:: Footprint ;
262
+ use crate :: vector:: { PointId , VectorData , flatten_path} ;
262
263
use bezier_rs:: Subpath ;
263
264
use glam:: DVec2 ;
264
265
use std:: pin:: Pin ;
@@ -274,12 +275,16 @@ mod test {
274
275
}
275
276
}
276
277
278
+ fn vector_node ( data : Subpath < PointId > ) -> VectorDataTable {
279
+ VectorDataTable :: new ( VectorData :: from_subpath ( data) )
280
+ }
281
+
277
282
#[ tokio:: test]
278
283
async fn repeat ( ) {
279
284
let direction = DVec2 :: X * 1.5 ;
280
285
let instances = 3 ;
281
286
let repeated = super :: repeat ( Footprint :: default ( ) , vector_node ( Subpath :: new_rect ( DVec2 :: ZERO , DVec2 :: ONE ) ) , direction, 0. , instances) . await ;
282
- let vector_data = super :: flatten_path ( Footprint :: default ( ) , repeated) . await ;
287
+ let vector_data = flatten_path ( Footprint :: default ( ) , repeated) . await ;
283
288
let vector_data = vector_data. instance_ref_iter ( ) . next ( ) . unwrap ( ) . instance ;
284
289
assert_eq ! ( vector_data. region_bezier_paths( ) . count( ) , 3 ) ;
285
290
for ( index, ( _, subpath) ) in vector_data. region_bezier_paths ( ) . enumerate ( ) {
@@ -290,7 +295,7 @@ mod test {
290
295
#[ tokio:: test]
291
296
async fn circular_repeat ( ) {
292
297
let repeated = super :: circular_repeat ( Footprint :: default ( ) , vector_node ( Subpath :: new_rect ( DVec2 :: NEG_ONE , DVec2 :: ONE ) ) , 45. , 4. , 8 ) . await ;
293
- let vector_data = super :: flatten_path ( Footprint :: default ( ) , repeated) . await ;
298
+ let vector_data = flatten_path ( Footprint :: default ( ) , repeated) . await ;
294
299
let vector_data = vector_data. instance_ref_iter ( ) . next ( ) . unwrap ( ) . instance ;
295
300
assert_eq ! ( vector_data. region_bezier_paths( ) . count( ) , 8 ) ;
296
301
@@ -312,7 +317,7 @@ mod test {
312
317
let expected_points = VectorData :: from_subpath ( points. clone ( ) ) . point_domain . positions ( ) . to_vec ( ) ;
313
318
314
319
let copy_to_points = super :: copy_to_points ( Footprint :: default ( ) , vector_node ( points) , vector_node ( instance) , 1. , 1. , 0. , 0 , 0. , 0 ) . await ;
315
- let flatten_path = super :: flatten_path ( Footprint :: default ( ) , copy_to_points) . await ;
320
+ let flatten_path = flatten_path ( Footprint :: default ( ) , copy_to_points) . await ;
316
321
let flattened_copy_to_points = flatten_path. instance_ref_iter ( ) . next ( ) . unwrap ( ) . instance ;
317
322
318
323
assert_eq ! ( flattened_copy_to_points. region_bezier_paths( ) . count( ) , expected_points. len( ) ) ;
0 commit comments