Files
OneCAD/crates/ui-egui/tests/scenarios/sketch_pattern_alignment.json
T

49 lines
3.0 KiB
JSON

[
{"note":"Each column has independent spacing, quantity and alignment. Center keeps the original in the middle; Left follows the negative second guide."},
{"call":"engine.execute","params":{"command":"sketch.create","params":{"plane":"XY"}}},
{"call":"engine.execute","params":{"command":"sketch.circle.center","params":{"center":[5,5],"radius":2,"id":"seed"}}},
{"call":"engine.execute","params":{"command":"sketch.line","params":{"points":[[0,-10],[20,-10]],"ids":["guide1"]}}},
{"call":"engine.execute","params":{"command":"sketch.line","params":{"points":[[0,-30],[12,-14]],"ids":["guide2"]}}},
{"call":"engine.execute","params":{"command":"sketch.constraint.fix","params":{"entities":["guide1","guide2"],"fixed":true}}},
{"call":"ui.view","params":{"view":"top"}},
{"click":{"handle":"toolbar:sketch.pattern.rectangular"}},
{"click":{"sketch":[7,5]}},
{"click":{"handle":"dialog:Direction"}},
{"click":{"sketch":[10,-10]}},
{"click":{"handle":"dialog:Direction 2"}},
{"click":{"sketch":[6,-22]}},
{"click":{"handle":"dialog:Quantity"}},
{"key":"A","cmd":true},
{"text":"3"},
{"click":{"handle":"dialog:Spacing"}},
{"key":"A","cmd":true},
{"text":"20"},
{"click":{"handle":"dialog:Quantity 2"}},
{"key":"A","cmd":true},
{"text":"2"},
{"click":{"handle":"dialog:Spacing 2"}},
{"key":"A","cmd":true},
{"text":"10"},
{"expect":{"dialog":"PatternRect","errors":0,"sketch_curves":{"own":3}}},
{"click":{"handle":"dialog:Alignment:Center"}},
{"click":{"handle":"dialog:Alignment 2:Flip direction"}},
{"shot":"sketch_pattern_alignment_preview"},
{"click":{"handle":"dialog:OK"}},
{"expect":{"dialog":null,"errors":0,"sketch_curves":{"own":8}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",0],"value":-21}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",1],"value":-3}}},
{"call":"ui.view","params":{"view":"fit"}},
{"shot":"sketch_pattern_alignment_before"},
{"call":"engine.execute","params":{"command":"sketch.drag","params":{"entity":"seed.center","from":[5,5],"to":[7,8]}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",0],"value":-19}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",1],"value":0}}},
{"call":"engine.execute","params":{"command":"sketch.constraint.fix","params":{"entities":["seed"],"fixed":true}}},
{"call":"engine.execute","params":{"command":"sketch.constraint.fix","params":{"entities":["guide2"],"fixed":false}}},
{"call":"engine.execute","params":{"command":"sketch.constraint.fix","params":{"entities":["guide2.start"],"fixed":true}}},
{"call":"engine.execute","params":{"command":"sketch.drag","params":{"entity":"guide2.end","from":[12,-14],"to":[16,-18]}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",0],"value":-21}}},
{"expect":{"query":{"command":"sketch.inspect","path":["curves",7,"center_at",1],"value":2}}},
{"expect":{"errors":0,"sketch_curves":{"own":8}}},
{"shot":"sketch_pattern_alignment_after"}
]