Fix operations to reflect concurrent module import behavior (#6568)

* Fix operations to reflect concurrent module import behavior

* Add new generated output

* Fix root module import tracking

* Rename test so that it's easier to filter

* Update output ops

* Fix clippy

* Update output after rebase

* Disable e2e tests until future PR

* Fix generated output; probably from recent merge

* Delete unused snap file
This commit is contained in:
Jonathan Tran
2025-04-30 12:26:46 -04:00
committed by GitHub
parent c050739f41
commit 0002295cdf
48 changed files with 1019 additions and 96 deletions

View File

@ -174,7 +174,8 @@ test.describe('Point-and-click assemblies tests', () => {
}
)
test(
// TODO: bring back in https://github.com/KittyCAD/modeling-app/issues/6570
test.fixme(
`Insert the bracket part into an assembly and transform it`,
{ tag: ['@electron'] },
async ({
@ -366,7 +367,8 @@ test.describe('Point-and-click assemblies tests', () => {
}
)
test(
// TODO: bring back in https://github.com/KittyCAD/modeling-app/issues/6570
test.fixme(
`Insert foreign parts into assembly as whole module import`,
{ tag: ['@electron'] },
async ({
@ -609,7 +611,8 @@ foreign
}
)
test(
// TODO: bring back in https://github.com/KittyCAD/modeling-app/issues/6570
test.fixme(
'Point-and-click Clone on assembly parts',
{ tag: ['@electron'] },
async ({

View File

@ -3,6 +3,8 @@ use std::collections::HashMap;
use async_recursion::async_recursion;
use indexmap::IndexMap;
#[cfg(feature = "artifact-graph")]
use crate::execution::cad_op::{Group, OpArg, OpKclValue, Operation};
use crate::{
errors::{KclError, KclErrorDetails},
execution::{
@ -28,11 +30,6 @@ use crate::{
},
CompilationError,
};
#[cfg(feature = "artifact-graph")]
use crate::{
execution::cad_op::{Group, OpArg, OpKclValue, Operation},
parsing::ast::types::BoxNode,
};
enum StatementKind<'a> {
Declaration { name: &'a str },
@ -519,19 +516,9 @@ impl ExecutorContext {
async fn exec_module_for_result(
&self,
module_id: ModuleId,
#[cfg(feature = "artifact-graph")] module_name: &BoxNode<Name>,
exec_state: &mut ExecState,
source_range: SourceRange,
) -> Result<Option<KclValue>, KclError> {
#[cfg(feature = "artifact-graph")]
exec_state.global.operations.push(Operation::GroupBegin {
group: Group::ModuleInstance {
name: module_name.to_string(),
module_id,
},
source_range,
});
let path = exec_state.global.module_infos[&module_id].path.clone();
let mut repr = exec_state.global.module_infos[&module_id].take_repr();
// DON'T EARLY RETURN! We need to restore the module repr
@ -570,9 +557,6 @@ impl ExecutorContext {
exec_state.global.module_infos[&module_id].restore_repr(repr);
#[cfg(feature = "artifact-graph")]
exec_state.global.operations.push(Operation::GroupEnd);
result
}
@ -626,7 +610,6 @@ impl ExecutorContext {
if let KclValue::Module { value: module_id, meta } = value {
self.exec_module_for_result(
module_id,
#[cfg(feature = "artifact-graph")] name,
exec_state,
metadata.source_range
).await?

View File

@ -10,7 +10,7 @@ pub use artifact::{
use cache::OldAstState;
pub use cache::{bust_cache, clear_mem_cache};
#[cfg(feature = "artifact-graph")]
pub use cad_op::Operation;
pub use cad_op::{Group, Operation};
pub use geometry::*;
pub use id_generator::IdGenerator;
pub(crate) use import::PreImportedGeometry;
@ -738,7 +738,8 @@ impl ExecutorContext {
let mut universe = std::collections::HashMap::new();
let default_planes = self.engine.get_default_planes().read().await.clone();
crate::walk::import_universe(
#[cfg_attr(not(feature = "artifact-graph"), expect(unused_variables))]
let root_imports = crate::walk::import_universe(
self,
&ModuleRepr::Kcl(program.ast.clone(), None),
&mut universe,
@ -810,11 +811,39 @@ impl ExecutorContext {
};
let module_id = *module_id;
let module_path = module_path.clone();
let source_range = SourceRange::from(import_stmt);
#[cfg(feature = "artifact-graph")]
match &module_path {
ModulePath::Main => {
// This should never happen.
}
ModulePath::Local { value, .. } => {
// We only want to display the top-level module imports in
// the Feature Tree, not transitive imports.
if root_imports.contains_key(value) {
exec_state.global.operations.push(Operation::GroupBegin {
group: Group::ModuleInstance {
name: value.file_name().unwrap_or_default().to_string_lossy().into_owned(),
module_id,
},
source_range,
});
// Due to concurrent execution, we cannot easily
// group operations by module. So we leave the
// group empty and close it immediately.
exec_state.global.operations.push(Operation::GroupEnd);
}
}
ModulePath::Std { .. } => {
// We don't want to display stdlib in the Feature Tree.
}
}
let repr = repr.clone();
let exec_state = exec_state.clone();
let exec_ctxt = self.clone();
let results_tx = results_tx.clone();
let source_range = SourceRange::from(import_stmt);
let exec_module = async |exec_ctxt: &ExecutorContext,
repr: &ModuleRepr,

View File

@ -1016,8 +1016,29 @@ mod import_glob {
super::execute(TEST_NAME, false).await
}
}
mod import_whole {
const TEST_NAME: &str = "import_whole";
mod import_whole_simple {
const TEST_NAME: &str = "import_whole_simple";
/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}
/// Test that parsing and unparsing KCL produces the original KCL input.
#[tokio::test(flavor = "multi_thread")]
async fn unparse() {
super::unparse(TEST_NAME).await
}
/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, false).await
}
}
mod import_whole_transitive_import {
const TEST_NAME: &str = "import_whole_transitive_import";
/// Test parsing KCL.
#[test]

View File

@ -1,5 +1,6 @@
use std::{
collections::HashMap,
path::PathBuf,
sync::{Arc, Mutex},
};
@ -176,19 +177,34 @@ pub(crate) fn import_dependencies(repr: &ModuleRepr, ctx: &ExecutorContext) -> R
Ok(ret.clone())
}
/// Mutates the `out` universe with the imported modules. Returns the imports of
/// only `repr`'s non-transitive imports.
pub(crate) async fn import_universe(
ctx: &ExecutorContext,
repr: &ModuleRepr,
out: &mut Universe,
exec_state: &mut ExecState,
) -> Result<(), KclError> {
) -> Result<HashMap<PathBuf, crate::parsing::ast::types::Node<ImportStatement>>, KclError> {
let modules = import_dependencies(repr, ctx)?;
let mut module_imports = HashMap::new();
for (filename, import_stmt, module_path) in modules {
match &module_path {
ModulePath::Main => {
// We only care about what the root module imports.
}
ModulePath::Local { value, .. } => {
module_imports.insert(value.clone(), import_stmt.clone());
}
ModulePath::Std { .. } => {
// We don't care about std imports.
}
}
if out.contains_key(&filename) {
continue;
}
let source_range = SourceRange::from(import_stmt.clone());
let source_range = SourceRange::from(&import_stmt);
let attrs = &import_stmt.outer_attrs;
let module_id = ctx
.open_module(&import_stmt.path, attrs, exec_state, source_range)
@ -204,14 +220,11 @@ pub(crate) async fn import_universe(
module_info.repr.clone()
};
out.insert(
filename.clone(),
(import_stmt.clone(), module_id, module_path.clone(), repr.clone()),
);
out.insert(filename, (import_stmt, module_id, module_path, repr.clone()));
Box::pin(import_universe(ctx, &repr, out, exec_state)).await?;
}
Ok(())
Ok(module_imports)
}
#[cfg(test)]

View File

@ -7,7 +7,7 @@ description: Operations executed assembly_mixed_units_cubes.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cubeIn",
"name": "cube-inches.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed assembly_mixed_units_cubes.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cubeMm",
"name": "cube-mm.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -7,7 +7,7 @@ description: Operations executed assembly_non_default_units.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "other1",
"name": "other1.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed assembly_non_default_units.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "other2",
"name": "other2.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -7,7 +7,7 @@ description: Operations executed import_async.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "screw",
"name": "2-5-long-m8-chc-screw.stl",
"moduleId": 0
},
"sourceRange": []

View File

@ -1,5 +1,18 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_constant.kcl
---
[]
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "export_constant.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_cycle1.kcl
---
[]

View File

@ -1,5 +1,18 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_export.kcl
---
[]
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "export_1.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -7,7 +7,7 @@ description: Operations executed import_foreign.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cube",
"name": "cube.gltf",
"moduleId": 0
},
"sourceRange": []

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_function_not_sketch.kcl
---
[]
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "my_functions.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -1,5 +1,18 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_glob.kcl
---
[]
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "export_constant.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -2,4 +2,17 @@
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_side_effect.kcl
---
[]
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "export_side_effect.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -7,7 +7,7 @@ description: Operations executed import_transform.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "screw",
"name": "2-5-long-m8-chc-screw.stl",
"moduleId": 0
},
"sourceRange": []

View File

@ -1,13 +1,13 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_whole.kcl
description: Operations executed import_whole_simple.kcl
---
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "foo",
"name": "exported_mod.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -0,0 +1,255 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Artifact commands import_whole.kcl
---
[
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "edge_lines_visible",
"hidden": false
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "set_object_transform",
"object_id": "[uuid]",
"transforms": [
{
"translate": {
"property": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"set": false,
"is_local": true
},
"rotate_rpy": null,
"rotate_angle_axis": null,
"scale": null
}
]
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "arc",
"center": {
"x": 127.0,
"y": 127.0
},
"radius": 254.0,
"start": {
"unit": "degrees",
"value": 0.0
},
"end": {
"unit": "degrees",
"value": 360.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 381.0,
"y": 127.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 254.0,
"faces": null,
"opposite": "None"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_all_edge_faces",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_all_edge_faces",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_all_edge_faces",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -0,0 +1,6 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart import_whole_transitive_import.kcl
extension: md
snapshot_kind: binary
---

View File

@ -0,0 +1,31 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[101, 137, 8]"]
3["Segment<br>[101, 137, 8]"]
4[Solid2d]
end
1["Plane<br>[78, 95, 8]"]
5["Sweep Extrusion<br>[143, 163, 8]"]
6[Wall]
7["Cap Start"]
8["Cap End"]
9["SweepEdge Opposite"]
10["SweepEdge Adjacent"]
1 --- 2
2 --- 3
2 --- 4
2 ---- 5
3 --- 6
3 x--> 7
3 --- 9
3 --- 10
5 --- 6
5 --- 7
5 --- 8
5 --- 9
5 --- 10
9 <--x 6
10 <--x 6
9 <--x 8
```

View File

@ -0,0 +1,193 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing import_whole_transitive_import.kcl
---
{
"Ok": {
"body": [
{
"commentStart": 0,
"end": 0,
"path": {
"type": "Kcl",
"filename": "part.kcl"
},
"selector": {
"type": "None",
"alias": null
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 0,
"declaration": {
"commentStart": 0,
"end": 0,
"id": {
"commentStart": 0,
"end": 0,
"name": "bar",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "part",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "z",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 0,
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 0,
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"commentStart": 0,
"end": 0,
"innerAttrs": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"properties": [
{
"commentStart": 0,
"end": 0,
"key": {
"commentStart": 0,
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "mm",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"commentStart": 0,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": [
{
"commentStart": 0,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"start": 0
}
}

View File

@ -0,0 +1 @@
// Pretend that we render something here.

View File

@ -0,0 +1,6 @@
@settings(defaultLengthUnit = mm)
import "part.kcl"
bar = part
|> translate(z=1)

View File

@ -0,0 +1,18 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed import_whole_transitive_import.kcl
---
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "part.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
]

View File

@ -0,0 +1,9 @@
@settings(defaultLengthUnit = inch)
import "bolt.kcl"
export thickness = 4
startSketchOn(XY)
|> circle(center = [5, 5], radius = 10)
|> extrude(length = 10)

View File

@ -0,0 +1,118 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing import_whole_transitive_import.kcl
---
{
"bar": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudeArc"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"ccw": true,
"center": [
5.0,
5.0
],
"from": [
15.0,
5.0
],
"radius": 10.0,
"tag": null,
"to": [
15.0,
5.0
],
"type": "Circle",
"units": {
"type": "Inches"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XY",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
15.0,
5.0
],
"to": [
15.0,
5.0
],
"units": {
"type": "Inches"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Inches"
}
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Inches"
},
"sectional": false
}
},
"part": {
"type": "Module",
"value": 8
}
}

View File

@ -0,0 +1,10 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing import_whole_transitive_import.kcl
---
@settings(defaultLengthUnit = mm)
import "part.kcl"
bar = part
|> translate(z = 1)

View File

@ -0,0 +1,5 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing tests/import_whole_transitive_import/bolt.kcl
---
// Pretend that we render something here.

View File

@ -0,0 +1,13 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing tests/import_whole_transitive_import/part.kcl
---
@settings(defaultLengthUnit = inch)
import "bolt.kcl"
export thickness = 4
startSketchOn(XY)
|> circle(center = [5, 5], radius = 10)
|> extrude(length = 10)

View File

@ -7,7 +7,7 @@ description: Operations executed axial-fan.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "fanHousing",
"name": "fan-housing.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed axial-fan.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "motor",
"name": "motor.kcl",
"moduleId": 0
},
"sourceRange": []
@ -25,7 +25,7 @@ description: Operations executed axial-fan.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "fan",
"name": "fan.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -3,6 +3,15 @@ source: kcl-lib/src/simulation_tests.rs
description: Operations executed bench.kcl
---
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "bench-parts.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
@ -1480,6 +1489,9 @@ description: Operations executed bench.kcl
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
}

View File

@ -7,7 +7,7 @@ description: Operations executed car-wheel-assembly.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "carRotor",
"name": "car-wheel.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed car-wheel-assembly.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "carWheel",
"name": "car-rotor.kcl",
"moduleId": 0
},
"sourceRange": []
@ -25,7 +25,25 @@ description: Operations executed car-wheel-assembly.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "lugNut",
"name": "brake-caliper.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "lug-nut.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "car-tire.kcl",
"moduleId": 0
},
"sourceRange": []
@ -183,19 +201,13 @@ description: Operations executed car-wheel-assembly.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "brakeCaliper",
"name": "parameters.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "carTire",
"moduleId": 0
},
"sourceRange": []
"type": "GroupEnd"
},
{
"type": "GroupEnd"

View File

@ -7,7 +7,7 @@ description: Operations executed multi-axis-robot.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "robotArmBase",
"name": "robot-arm-base.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed multi-axis-robot.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "rotatingBase",
"name": "robot-rotating-base.kcl",
"moduleId": 0
},
"sourceRange": []
@ -25,7 +25,7 @@ description: Operations executed multi-axis-robot.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "j2RobotArm",
"name": "robot-arm-j2.kcl",
"moduleId": 0
},
"sourceRange": []
@ -34,7 +34,7 @@ description: Operations executed multi-axis-robot.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "j3RobotArm",
"name": "robot-arm-j3.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -6,22 +6,9 @@ description: Operations executed pipe-flange-assembly.kcl
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "flange",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {}
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "flange",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {}
"type": "ModuleInstance",
"name": "parameters.kcl",
"moduleId": 0
},
"sourceRange": []
},
@ -29,11 +16,78 @@ description: Operations executed pipe-flange-assembly.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "gasket",
"name": "9472k188-gasket.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "68095k348-flange.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "98017a257-washer.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "91251a404-bolt.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "95479a127-hex-nut.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "1120t74-pipe.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "flange",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {}
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "flange",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {}
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
@ -1839,6 +1893,24 @@ description: Operations executed pipe-flange-assembly.kcl
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
}

View File

@ -7,7 +7,7 @@ description: Operations executed walkie-talkie.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "body",
"name": "parameters.kcl",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed walkie-talkie.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "antenna",
"name": "body.kcl",
"moduleId": 0
},
"sourceRange": []
@ -25,7 +25,7 @@ description: Operations executed walkie-talkie.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "case",
"name": "case.kcl",
"moduleId": 0
},
"sourceRange": []
@ -34,7 +34,7 @@ description: Operations executed walkie-talkie.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "talkButton",
"name": "antenna.kcl",
"moduleId": 0
},
"sourceRange": []
@ -43,7 +43,25 @@ description: Operations executed walkie-talkie.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "knob",
"name": "talk-button.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "knob.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "button.kcl",
"moduleId": 0
},
"sourceRange": []
@ -496,6 +514,12 @@ description: Operations executed walkie-talkie.kcl
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
}

View File

@ -7,7 +7,7 @@ description: Operations executed module_return_using_var.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cube",
"name": "cube.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -7,7 +7,7 @@ description: Operations executed multiple-foreign-imports-all-render.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "cube",
"name": "cube.step",
"moduleId": 0
},
"sourceRange": []
@ -16,7 +16,7 @@ description: Operations executed multiple-foreign-imports-all-render.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "othercube",
"name": "othercube.kcl",
"moduleId": 0
},
"sourceRange": []
@ -25,7 +25,7 @@ description: Operations executed multiple-foreign-imports-all-render.kcl
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "anothercube",
"name": "anothercube.kcl",
"moduleId": 0
},
"sourceRange": []

View File

@ -3,6 +3,15 @@ source: kcl-lib/src/simulation_tests.rs
description: Operations executed pattern_circular_in_module.kcl
---
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "thing.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
@ -84,6 +93,9 @@ description: Operations executed pattern_circular_in_module.kcl
"sourceRange": []
}
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
}

View File

@ -3,6 +3,15 @@ source: kcl-lib/src/simulation_tests.rs
description: Operations executed pattern_linear_in_module.kcl
---
[
{
"type": "GroupBegin",
"group": {
"type": "ModuleInstance",
"name": "thing.kcl",
"moduleId": 0
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
@ -102,6 +111,9 @@ description: Operations executed pattern_linear_in_module.kcl
"sourceRange": []
}
},
{
"type": "GroupEnd"
},
{
"type": "GroupEnd"
}