File size: 397 Bytes
1efb490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def build_spatial_force_map(samples):
    return [
        {
            "position": sample.get("position", [0.0, 0.0, 0.0]),
            "force": sample.get("force", [0.0, 0.0, 0.0]),
        }
        for sample in samples
    ]


if __name__ == "__main__":
    sample_map = build_spatial_force_map([
        {"position": [0.0, 0.0, 0.0], "force": [0.0, 0.1, 0.2]},
    ])
    print(sample_map)