new sweep default (#6965)
snaps Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -251786,7 +251786,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": false,
|
"required": false,
|
||||||
"description": "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to sketchPlane.",
|
"description": "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to trajectoryCurve.",
|
||||||
"labelRequired": true
|
"labelRequired": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -256720,7 +256720,7 @@
|
|||||||
false
|
false
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(YZ)\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath)",
|
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(YZ)\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath, relativeTo = \"sketchPlane\")",
|
||||||
false
|
false
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
File diff suppressed because one or more lines are too long
@ -112,7 +112,7 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(YZ)
|
/// springSketch = startSketchOn(YZ)
|
||||||
/// |> circle( center = [0, 0], radius = 1)
|
/// |> circle( center = [0, 0], radius = 1)
|
||||||
/// |> sweep(path = helixPath)
|
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
@ -167,7 +167,7 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
|||||||
path = { docs = "The path to sweep the sketch along" },
|
path = { docs = "The path to sweep the sketch along" },
|
||||||
sectional = { docs = "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components." },
|
sectional = { docs = "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components." },
|
||||||
tolerance = { docs = "Tolerance for this operation" },
|
tolerance = { docs = "Tolerance for this operation" },
|
||||||
relative_to = { docs = "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to sketchPlane."},
|
relative_to = { docs = "What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. Defaults to trajectoryCurve."},
|
||||||
tag_start = { docs = "A named tag for the face at the start of the sweep, i.e. the original sketch" },
|
tag_start = { docs = "A named tag for the face at the start of the sweep, i.e. the original sketch" },
|
||||||
tag_end = { docs = "A named tag for the face at the end of the sweep" },
|
tag_end = { docs = "A named tag for the face at the end of the sweep" },
|
||||||
},
|
},
|
||||||
@ -191,14 +191,13 @@ async fn inner_sweep(
|
|||||||
};
|
};
|
||||||
let relative_to = match relative_to.as_deref() {
|
let relative_to = match relative_to.as_deref() {
|
||||||
Some("sketchPlane") => RelativeTo::SketchPlane,
|
Some("sketchPlane") => RelativeTo::SketchPlane,
|
||||||
Some("trajectoryCurve") => RelativeTo::TrajectoryCurve,
|
Some("trajectoryCurve") | None => RelativeTo::TrajectoryCurve,
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
return Err(KclError::Syntax(crate::errors::KclErrorDetails {
|
return Err(KclError::Syntax(crate::errors::KclErrorDetails {
|
||||||
source_ranges: vec![args.source_range],
|
source_ranges: vec![args.source_range],
|
||||||
message: "If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(),
|
message: "If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
None => RelativeTo::default(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut solids = Vec::new();
|
let mut solids = Vec::new();
|
||||||
|
@ -83,7 +83,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(YZ)
|
/// springSketch = startSketchOn(YZ)
|
||||||
/// |> circle( center = [0, 0], radius = 0.5)
|
/// |> circle( center = [0, 0], radius = 0.5)
|
||||||
/// |> sweep(path = helixPath)
|
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -104,7 +104,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(XY)
|
/// springSketch = startSketchOn(XY)
|
||||||
/// |> circle( center = [0, 0], radius = 0.5 )
|
/// |> circle( center = [0, 0], radius = 0.5 )
|
||||||
/// |> sweep(path = helixPath)
|
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -124,7 +124,7 @@ export END = 'end'
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// springSketch = startSketchOn(XY)
|
/// springSketch = startSketchOn(XY)
|
||||||
/// |> circle( center = [0, 0], radius = 1 )
|
/// |> circle( center = [0, 0], radius = 1 )
|
||||||
/// |> sweep(path = helixPath)
|
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
@ -413,7 +413,7 @@ export fn offsetPlane(
|
|||||||
/// // Create a spring by sweeping around the helix path.
|
/// // Create a spring by sweeping around the helix path.
|
||||||
/// sweepedSpring = clone(springSketch)
|
/// sweepedSpring = clone(springSketch)
|
||||||
/// |> translate(x=100)
|
/// |> translate(x=100)
|
||||||
/// |> sweep(path = helixPath)
|
/// |> sweep(path = helixPath, relativeTo = "sketchPlane")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```kcl
|
/// ```kcl
|
||||||
|
@ -5122,7 +5122,7 @@ description: Artifact commands bench.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5134,7 +5134,7 @@ description: Artifact commands bench.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -906,7 +906,7 @@ description: Artifact commands cold-plate.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -5576,7 +5576,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -6111,7 +6111,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -9469,7 +9469,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -9601,7 +9601,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -10120,7 +10120,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -10252,7 +10252,7 @@ description: Artifact commands cpu-cooler.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1598,7 +1598,7 @@ description: Artifact commands exhaust-manifold.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1610,7 +1610,7 @@ description: Artifact commands exhaust-manifold.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1622,7 +1622,7 @@ description: Artifact commands exhaust-manifold.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1634,7 +1634,7 @@ description: Artifact commands exhaust-manifold.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -4491,7 +4491,7 @@ description: Artifact commands utility-sink.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -418,7 +418,7 @@ description: Artifact commands subtract_regression03.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -395,7 +395,7 @@ description: Artifact commands subtract_regression05.kcl
|
|||||||
"trajectory": "[uuid]",
|
"trajectory": "[uuid]",
|
||||||
"sectional": false,
|
"sectional": false,
|
||||||
"tolerance": 0.0000001,
|
"tolerance": 0.0000001,
|
||||||
"relative_to": "sketch_plane"
|
"relative_to": "trajectory_curve"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user