Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-07 14:06:34 -07:00
parent 6d1035710f
commit 35e844e2a9
12 changed files with 10862 additions and 17575 deletions

View File

@ -103,8 +103,6 @@ impl ExecutorContext {
) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> { ) -> Result<(Option<KclValue>, EnvironmentRef, Vec<String>), KclError> {
crate::log::log(format!("enter module {path} {}", exec_state.stack())); crate::log::log(format!("enter module {path} {}", exec_state.stack()));
let old_units = exec_state.length_unit();
let mut local_state = ModuleState::new(path.std_path(), exec_state.stack().memory.clone(), Some(module_id)); let mut local_state = ModuleState::new(path.std_path(), exec_state.stack().memory.clone(), Some(module_id));
if !preserve_mem { if !preserve_mem {
std::mem::swap(&mut exec_state.mod_local, &mut local_state); std::mem::swap(&mut exec_state.mod_local, &mut local_state);
@ -132,16 +130,6 @@ impl ExecutorContext {
std::mem::swap(&mut exec_state.mod_local, &mut local_state); std::mem::swap(&mut exec_state.mod_local, &mut local_state);
} }
// We only need to reset the units if we are not on the Main path.
// If we reset at the end of the main path, then we just add on an extra
// command and we'd need to flush the batch again.
// This avoids that.
if new_units != old_units && *path != ModulePath::Main {
self.engine
.set_units(old_units.into(), Default::default(), exec_state.id_generator())
.await?;
}
crate::log::log(format!("leave {path}")); crate::log::log(format!("leave {path}"));
result.map(|result| (result, env_ref, local_state.module_exports)) result.map(|result| (result, env_ref, local_state.module_exports))

View File

@ -162,11 +162,11 @@ pub(crate) async fn do_post_extrude<'a>(
) -> Result<Solid, KclError> { ) -> Result<Solid, KclError> {
// Bring the object to the front of the scene. // Bring the object to the front of the scene.
// See: https://github.com/KittyCAD/modeling-app/issues/806 // See: https://github.com/KittyCAD/modeling-app/issues/806
args.batch_modeling_cmd( /*args.batch_modeling_cmd(
exec_state.next_uuid(), exec_state.next_uuid(),
ModelingCmd::from(mcmd::ObjectBringToFront { object_id: sketch.id }), ModelingCmd::from(mcmd::ObjectBringToFront { object_id: sketch.id }),
) )
.await?; .await?;*/
let any_edge_id = if let Some(edge_id) = sketch.mirror { let any_edge_id = if let Some(edge_id) = sketch.mirror {
edge_id edge_id
@ -208,6 +208,8 @@ pub(crate) async fn do_post_extrude<'a>(
vec![] vec![]
}; };
println!("face_infos: {:?}", face_infos);
// Face filtering attempt in order to resolve https://github.com/KittyCAD/modeling-app/issues/5328 // Face filtering attempt in order to resolve https://github.com/KittyCAD/modeling-app/issues/5328
// In case of a sectional sweep, empirically it looks that the first n faces that are yielded from the sweep // In case of a sectional sweep, empirically it looks that the first n faces that are yielded from the sweep
// are the ones that work with GetOppositeEdge and GetNextAdjacentEdge, aka the n sides in the sweep. // are the ones that work with GetOppositeEdge and GetNextAdjacentEdge, aka the n sides in the sweep.

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ description: Variables in memory after executing car-wheel-assembly.kcl
}, },
"brakeCaliper": { "brakeCaliper": {
"type": "Module", "type": "Module",
"value": 7 "value": 8
}, },
"c1": { "c1": {
"type": "TagIdentifier", "type": "TagIdentifier",
@ -105,11 +105,11 @@ description: Variables in memory after executing car-wheel-assembly.kcl
}, },
"carRotor": { "carRotor": {
"type": "Module", "type": "Module",
"value": 6 "value": 7
}, },
"carTire": { "carTire": {
"type": "Module", "type": "Module",
"value": 9 "value": 10
}, },
"carWheel": { "carWheel": {
"type": "Module", "type": "Module",
@ -177,7 +177,7 @@ description: Variables in memory after executing car-wheel-assembly.kcl
}, },
"lugNut": { "lugNut": {
"type": "Module", "type": "Module",
"value": 8 "value": 9
}, },
"lugSpacing": { "lugSpacing": {
"type": "Number", "type": "Number",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ description: Variables in memory after executing walkie-talkie.kcl
{ {
"antenna": { "antenna": {
"type": "Module", "type": "Module",
"value": 8 "value": 9
}, },
"antennaBaseHeight": { "antennaBaseHeight": {
"type": "Number", "type": "Number",
@ -157,7 +157,7 @@ description: Variables in memory after executing walkie-talkie.kcl
}, },
"knob": { "knob": {
"type": "Module", "type": "Module",
"value": 10 "value": 11
}, },
"knobDiameter": { "knobDiameter": {
"type": "Number", "type": "Number",
@ -318,7 +318,7 @@ description: Variables in memory after executing walkie-talkie.kcl
}, },
"talkButton": { "talkButton": {
"type": "Module", "type": "Module",
"value": 9 "value": 10
}, },
"talkButtonHeight": { "talkButtonHeight": {
"type": "Number", "type": "Number",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 34 KiB