Change Sketch to use the units of the module (#7076)
* Change Sketch to use the units of the module * Update output
This commit is contained in:
		@ -26,7 +26,7 @@ use crate::{
 | 
			
		||||
        args::{Args, TyF64},
 | 
			
		||||
        utils::{
 | 
			
		||||
            arc_center_and_end, get_tangential_arc_to_info, get_x_component, get_y_component,
 | 
			
		||||
            intersection_with_parallel_line, point_to_len_unit, point_to_mm, untype_point, untyped_point_to_mm,
 | 
			
		||||
            intersection_with_parallel_line, point_to_len_unit, point_to_mm, untyped_point_to_mm,
 | 
			
		||||
            TangentialArcInfoInput,
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
@ -1396,12 +1396,14 @@ pub(crate) async fn inner_start_profile(
 | 
			
		||||
    ])
 | 
			
		||||
    .await?;
 | 
			
		||||
 | 
			
		||||
    let (to, ty) = untype_point(at);
 | 
			
		||||
    // Convert to the units of the module.  This is what the frontend expects.
 | 
			
		||||
    let units = exec_state.length_unit();
 | 
			
		||||
    let to = point_to_len_unit(at, units);
 | 
			
		||||
    let current_path = BasePath {
 | 
			
		||||
        from: to,
 | 
			
		||||
        to,
 | 
			
		||||
        tag: tag.clone(),
 | 
			
		||||
        units: ty.expect_length(),
 | 
			
		||||
        units,
 | 
			
		||||
        geo_meta: GeoMeta {
 | 
			
		||||
            id: move_pen_id,
 | 
			
		||||
            metadata: args.source_range.into(),
 | 
			
		||||
@ -1414,7 +1416,7 @@ pub(crate) async fn inner_start_profile(
 | 
			
		||||
        artifact_id: path_id.into(),
 | 
			
		||||
        on: sketch_surface.clone(),
 | 
			
		||||
        paths: vec![],
 | 
			
		||||
        units: ty.expect_length(),
 | 
			
		||||
        units,
 | 
			
		||||
        mirror: Default::default(),
 | 
			
		||||
        meta: vec![args.source_range.into()],
 | 
			
		||||
        tags: if let Some(tag) = &tag {
 | 
			
		||||
 | 
			
		||||
@ -203,7 +203,7 @@ description: Artifact commands helium-tank.kcl
 | 
			
		||||
      "path": "[uuid]",
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "tangential_arc",
 | 
			
		||||
        "radius": 95.88500000000016,
 | 
			
		||||
        "radius": 95.8850000000001,
 | 
			
		||||
        "offset": {
 | 
			
		||||
          "unit": "degrees",
 | 
			
		||||
          "value": -90.0
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -148,7 +148,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": 22.6312,
 | 
			
		||||
          "x": 22.6313,
 | 
			
		||||
          "y": -10.0,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
@ -182,7 +182,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": 32.6312,
 | 
			
		||||
          "x": 32.6313,
 | 
			
		||||
          "y": 10.9406,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
@ -199,7 +199,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": 102.6312,
 | 
			
		||||
          "x": 102.6313,
 | 
			
		||||
          "y": 10.9406,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
@ -233,7 +233,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": 32.6312,
 | 
			
		||||
          "x": 32.6313,
 | 
			
		||||
          "y": 30.9406,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
@ -250,7 +250,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": 32.6312,
 | 
			
		||||
          "x": 32.6313,
 | 
			
		||||
          "y": 41.8813,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
@ -284,7 +284,7 @@ description: Artifact commands router-template-cross-bar.kcl
 | 
			
		||||
      "segment": {
 | 
			
		||||
        "type": "line",
 | 
			
		||||
        "end": {
 | 
			
		||||
          "x": -32.6312,
 | 
			
		||||
          "x": -32.6313,
 | 
			
		||||
          "y": 0.0,
 | 
			
		||||
          "z": 0.0
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user