Merge branch 'main' into andrewvarga/6629/make-undo-redo-work-without-code-pane

This commit is contained in:
Andrew Varga
2025-06-14 11:04:52 +02:00
46 changed files with 37120 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -55,6 +55,7 @@ layout: manual
* [`circleThreePoint`](/docs/kcl-std/functions/std-sketch-circleThreePoint)
* [`close`](/docs/kcl-std/functions/std-sketch-close)
* [`extrude`](/docs/kcl-std/functions/std-sketch-extrude)
* [`extrudeTwist`](/docs/kcl-std/functions/std-sketch-extrudeTwist)
* [`getCommonEdge`](/docs/kcl-std/functions/std-sketch-getCommonEdge)
* [`getNextAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge)
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)

View File

@ -20,6 +20,7 @@ This module contains functions for creating and manipulating sketches, and makin
* [`circleThreePoint`](/docs/kcl-std/functions/std-sketch-circleThreePoint)
* [`close`](/docs/kcl-std/functions/std-sketch-close)
* [`extrude`](/docs/kcl-std/functions/std-sketch-extrude)
* [`extrudeTwist`](/docs/kcl-std/functions/std-sketch-extrudeTwist)
* [`getCommonEdge`](/docs/kcl-std/functions/std-sketch-getCommonEdge)
* [`getNextAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge)
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -109,6 +109,8 @@ When you submit a PR to add or modify KCL samples, images will be generated and
[![makeup-mirror](screenshots/makeup-mirror.png)](makeup-mirror/main.kcl)
#### [mounting-plate](mounting-plate/main.kcl) ([screenshot](screenshots/mounting-plate.png))
[![mounting-plate](screenshots/mounting-plate.png)](mounting-plate/main.kcl)
#### [mug](mug/main.kcl) ([screenshot](screenshots/mug.png))
[![mug](screenshots/mug.png)](mug/main.kcl)
#### [multi-axis-robot](multi-axis-robot/main.kcl) ([screenshot](screenshots/multi-axis-robot.png))
[![multi-axis-robot](screenshots/multi-axis-robot.png)](multi-axis-robot/main.kcl)
#### [pdu-faceplate](pdu-faceplate/main.kcl) ([screenshot](screenshots/pdu-faceplate.png))
@ -139,6 +141,8 @@ When you submit a PR to add or modify KCL samples, images will be generated and
[![socket-head-cap-screw](screenshots/socket-head-cap-screw.png)](socket-head-cap-screw/main.kcl)
#### [spinning-highrise-tower](spinning-highrise-tower/main.kcl) ([screenshot](screenshots/spinning-highrise-tower.png))
[![spinning-highrise-tower](screenshots/spinning-highrise-tower.png)](spinning-highrise-tower/main.kcl)
#### [spool](spool/main.kcl) ([screenshot](screenshots/spool.png))
[![spool](screenshots/spool.png)](spool/main.kcl)
#### [spur-gear](spur-gear/main.kcl) ([screenshot](screenshots/spur-gear.png))
[![spur-gear](screenshots/spur-gear.png)](spur-gear/main.kcl)
#### [spur-reduction-gearset](spur-reduction-gearset/main.kcl) ([screenshot](screenshots/spur-reduction-gearset.png))
@ -147,6 +151,8 @@ When you submit a PR to add or modify KCL samples, images will be generated and
[![surgical-drill-guide](screenshots/surgical-drill-guide.png)](surgical-drill-guide/main.kcl)
#### [t-slot-rail](t-slot-rail/main.kcl) ([screenshot](screenshots/t-slot-rail.png))
[![t-slot-rail](screenshots/t-slot-rail.png)](t-slot-rail/main.kcl)
#### [teapot](teapot/main.kcl) ([screenshot](screenshots/teapot.png))
[![teapot](screenshots/teapot.png)](teapot/main.kcl)
#### [telemetry-antenna](telemetry-antenna/main.kcl) ([screenshot](screenshots/telemetry-antenna.png))
[![telemetry-antenna](screenshots/telemetry-antenna.png)](telemetry-antenna/main.kcl)
#### [thermal-block-insert](thermal-block-insert/main.kcl) ([screenshot](screenshots/thermal-block-insert.png))

View File

@ -447,6 +447,16 @@
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "mug/main.kcl",
"multipleFiles": false,
"title": "Mug",
"description": "A cup with straight sides and a handle, typically used for hot drinks",
"files": [
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "multi-axis-robot/main.kcl",
@ -612,6 +622,16 @@
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "spool/main.kcl",
"multipleFiles": false,
"title": "Spool",
"description": "A spool is a winding device for storing large batches of filament, wire, tape, etc",
"files": [
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "spur-gear/main.kcl",
@ -652,6 +672,16 @@
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "teapot/main.kcl",
"multipleFiles": false,
"title": "Teapot",
"description": "A vessel with a spout and a handle used for serving tea and boiling water on a stovetop",
"files": [
"main.kcl"
]
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "telemetry-antenna/main.kcl",

View File

@ -0,0 +1,81 @@
// Mug
// A cup with straight sides and a handle, typically used for hot drinks
// Set units
@settings(defaultLengthUnit = mm)
// Define parameters
mugDiameter = 80
mugHeight = 95
wallThickness = 6
handleWidth = 18
handleThickness = 5
// Revolve the outer perimeter of the mug body. This will be used to subtract material from the handle, so that it fits snug to the body
tools = startSketchOn(XZ)
|> startProfile(at = [0, mugDiameter * 0.04])
|> xLine(length = mugDiameter * 0.1)
|> tangentialArc(endAbsolute = [mugDiameter * 0.3, mugDiameter * 0.01])
|> arc(angleStart = -180, angleEnd = -90, radius = mugDiameter * 0.01)
|> xLine(length = mugDiameter * 0.025)
|> arc(angleStart = -90, angleEnd = 0, radius = mugDiameter * 0.01)
|> xLine(endAbsolute = mugDiameter * 0.35)
|> tangentialArc(angle = 90, radius = mugDiameter * 0.15)
|> yLine(endAbsolute = mugHeight - (wallThickness / 2))
|> tangentialArc(angle = 90, diameter = wallThickness)
|> xLine(endAbsolute = profileStartX())
|> yLine(endAbsolute = profileStartY())
|> close()
|> revolve(axis = Y)
// Draw the path of the mug handle
handlePath = startSketchOn(XZ)
|> startProfile(at = [mugDiameter / 3, mugHeight * 0.25])
|> angledLine(angle = -5, length = mugDiameter / 3)
|> tangentialArc(angle = 90, radius = mugHeight * 0.15)
|> tangentialArc(end = [0, mugHeight * 0.425])
|> tangentialArc(angle = 90, radius = mugHeight * 0.15, tag = $seg02)
|> angledLine(angle = tangentToEnd(seg02), endAbsoluteX = profileStartX())
// Sweep the handle profile along the path
handle = startSketchOn(offsetPlane(YZ, offset = mugDiameter / 3))
|> startProfile(at = [
-handleWidth / 2,
mugHeight * 0.25 + handleThickness / 2
])
|> arc(
interiorAbsolute = [
0,
profileStartY() + handleThickness / 4
],
endAbsolute = [handleWidth / 2, profileStartY()],
)
|> tangentialArc(end = [0, -handleThickness])
|> tangentialArc(end = [-handleWidth, 0])
|> tangentialArc(endAbsolute = profileStart())
|> close()
|> sweep(path = handlePath)
|> subtract(tools)
// Create the body of the mug
mug = startSketchOn(XZ)
|> startProfile(at = [0, mugDiameter * 0.04])
|> xLine(length = mugDiameter * 0.1)
|> tangentialArc(endAbsolute = [mugDiameter * 0.3, mugDiameter * 0.01])
|> arc(angleStart = -180, angleEnd = -90, radius = mugDiameter * 0.01)
|> xLine(length = mugDiameter * 0.025)
|> arc(angleStart = -90, angleEnd = 0, radius = mugDiameter * 0.01)
|> xLine(endAbsolute = mugDiameter * 0.35)
|> tangentialArc(angle = 90, radius = mugDiameter * 0.15)
|> yLine(endAbsolute = mugHeight - (wallThickness / 2))
|> tangentialArc(angle = 180, diameter = wallThickness)
|> yLine(endAbsolute = mugDiameter * 0.15)
|> tangentialArc(angle = -90, radius = lastSegX() * 0.2)
|> xLine(endAbsolute = profileStartX())
|> yLine(endAbsolute = profileStartY())
|> close()
|> revolve(axis = Y)
// Join the mug and handle, then add an appearance
[handle, mug]
|> appearance(color = "#9b1212", metalness = 40, roughness = 30)

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View File

@ -0,0 +1,68 @@
// Spool
// A spool is a winding device for storing large batches of filament, wire, tape, etc
// Set units
@settings(defaultLengthUnit = mm)
// Define shaft parameters
hubDiameter = 2in
spoolDiameter = 305
spoolThickness = 267
coreDiameter = 150
webThickness = 10
stockDiameter = 5
// Sketch the revolved profile of one side of the spool
spoolBase = startSketchOn(XY)
|> startProfile(at = [0, coreDiameter / 2])
|> xLine(length = spoolThickness / 2)
|> yLine(endAbsolute = spoolDiameter / 2 - webThickness)
|> tangentialArc(angle = -270, radius = webThickness)
|> yLine(endAbsolute = hubDiameter / 2, tag = $seg01)
|> xLine(endAbsolute = profileStartX())
|> yLine(endAbsolute = profileStartY())
|> close()
|> revolve(axis = X)
|> appearance(color = "#010101", metalness = 10, roughness = 70)
// Create a function that draws an indent on the outer faces of the spool
fn score(radius, length, depth) {
scoreFn = startSketchOn(spoolBase, face = seg01)
|> startProfile(at = [0, radius])
|> arc(angleStart = 90, angleEnd = 55, radius = profileStartY(%))
|> angledLine(angle = 55, length = length)
|> arc(
%,
angleStart = 55,
angleEnd = 90,
radius = profileStartY(%) + length,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
|> patternCircular2d(instances = 8, center = [0, 0])
|> extrude(length = -depth)
return scoreFn
}
// Circular pattern indents around each side face of the spool
scoreSketch01 = score(radius = hubDiameter / 2 + webThickness, length = (coreDiameter - hubDiameter) / 2 - (2 * webThickness), depth = spoolThickness / 2)
scoreSketch02 = score(radius = coreDiameter / 2, length = (spoolDiameter - coreDiameter) / 2 - (webThickness * 3), depth = webThickness / 2)
// Mirror the spool base piece across the Y axis
|> patternCircular3d(instances = 2, axis = [0, 1, 0], center = [0, 0, 0])
// Model a wound coil on the spool diameter
hel01 = helix(
revolutions = spoolThickness / stockDiameter / 1.5,
angleStart = 0,
radius = (coreDiameter + stockDiameter) / 2,
axis = X,
length = spoolThickness,
)
// Sweep and color the coil
stock = startSketchOn(XZ)
|> circle(center = [0, -(coreDiameter + stockDiameter) / 2], diameter = stockDiameter)
|> sweep(path = hel01)
|> translate(x = -spoolThickness / 2)
|> appearance(color = "#f2471c", metalness = 70, roughness = 30)

View File

@ -0,0 +1,106 @@
// Teapot
// A vessel with a spout and a handle used for serving tea and boiling water on a stovetop
// Set units
@settings(defaultLengthUnit = mm)
// Define parameters
teapotHeight = 130
beltlineDiameter = 160
wallThickness = 6
outletHeight = 26
spoutDiameter = 12
// Sketch the path of the teapot spout
spoutPath = startSketchOn(XZ)
|> startProfile(at = [-beltlineDiameter / 2.5, outletHeight])
|> xLine(length = -15.05)
|> tangentialArc(angle = -110, radius = 30, tag = $seg01)
|> angledLine(angle = tangentToEnd(seg01), length = 16.84)
|> tangentialArc(angle = 100, radius = 30)
// Sweep a hollow spout
spout = startSketchOn(offsetPlane(YZ, offset = -beltlineDiameter / 2.5))
|> circle(center = [0, outletHeight], diameter = spoutDiameter)
|> subtract2d(tool = circle(center = [0, outletHeight], diameter = spoutDiameter * 0.8))
|> sweep(path = spoutPath)
// Model the perimeter of the teapot body, to be used to trim the handle so that it fits snug to the body
tools = startSketchOn(YZ)
|> startProfile(at = [0, 0])
|> xLine(length = beltlineDiameter / 5)
|> tangentialArc(endAbsolute = [
beltlineDiameter / 2.1,
teapotHeight / 2.5
])
|> tangentialArc(endAbsolute = [
beltlineDiameter / 3,
teapotHeight / 1.1
])
|> tangentialArc(endAbsolute = [beltlineDiameter / 4, teapotHeight])
|> xLine(endAbsolute = profileStartX(%))
|> line(endAbsolute = profileStart(%))
|> close()
|> revolve(axis = Y)
// Sketch the path of the handle
handlePath = startSketchOn(XZ)
|> startProfile(at = [0, outletHeight])
|> xLine(endAbsolute = 76)
|> tangentialArc(end = [12.98, 6.64])
|> tangentialArc(end = [28.39, 63.11])
|> tangentialArc(end = [-10.27, 14.8])
|> tangentialArc(end = [-48.01, 1.81], tag = $seg02)
|> angledLine(angle = tangentToEnd(seg02), endAbsoluteX = 0)
// Sweep the handle
handle = startSketchOn(YZ)
|> startProfile(at = [-10, outletHeight + 3.5])
|> arc(interiorAbsolute = [0, outletHeight + 5], endAbsolute = [10, profileStartY(%)])
|> tangentialArc(end = [0, -7])
|> tangentialArc(end = [-20, 0])
|> tangentialArc(endAbsolute = profileStart())
|> close()
|> sweep(path = handlePath)
|> subtract(tools)
// Create a cutout in the body for the spout outlet
spoutHole = startSketchOn(YZ)
|> circle(center = [0, outletHeight], diameter = spoutDiameter)
|> extrude(length = -beltlineDiameter / 2)
// Model the body of the teapot
body = startSketchOn(YZ)
|> startProfile(at = [0, 0])
|> xLine(length = beltlineDiameter / 5)
|> tangentialArc(endAbsolute = [
beltlineDiameter / 2.1,
teapotHeight / 2.5
])
|> tangentialArc(endAbsolute = [
beltlineDiameter / 3,
teapotHeight / 1.1
])
|> tangentialArc(endAbsolute = [beltlineDiameter / 4, teapotHeight])
|> tangentialArc(angle = 190, diameter = wallThickness)
|> tangentialArc(endAbsolute = [
beltlineDiameter / 3 - wallThickness,
teapotHeight / 1.1
])
|> tangentialArc(endAbsolute = [
beltlineDiameter / 2.1 - wallThickness,
teapotHeight / 2.5
])
|> tangentialArc(endAbsolute = [
beltlineDiameter / 5,
profileStartY() + wallThickness
])
|> xLine(endAbsolute = profileStartX(%))
|> line(endAbsolute = profileStart(%))
|> close()
|> revolve(axis = Y)
|> subtract(tools = [spoutHole])
// Join each component of the teapot and add an appearance
[body, handle, spout]
|> appearance(color = "#1f9896", metalness = 40, roughness = 30)

4
rust/Cargo.lock generated
View File

@ -2049,9 +2049,9 @@ dependencies = [
[[package]]
name = "kittycad-modeling-cmds"
version = "0.2.121"
version = "0.2.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94ba95c22493d79ec8a1faab963d8903f6de0e373efedf2bc3bb76a0ddbab036"
checksum = "b8f3c1b4b4ddb9aa336a09933f2550f9882552e321187b7bcff47f006379c3aa"
dependencies = [
"anyhow",
"chrono",

View File

@ -36,7 +36,7 @@ dashmap = { version = "6.1.0" }
http = "1"
indexmap = "2.9.0"
kittycad = { version = "0.3.37", default-features = false, features = ["js", "requests"] }
kittycad-modeling-cmds = { version = "0.2.120", features = ["ts-rs", "websocket"] }
kittycad-modeling-cmds = { version = "0.2.123", features = ["ts-rs", "websocket"] }
lazy_static = "1.5.0"
miette = "7.5.0"
pyo3 = { version = "0.24.1" }

View File

@ -117,6 +117,7 @@ pub const TEST_NAMES: &[&str] = &[
"std-sketch-getOppositeEdge-0",
"std-sketch-getPreviousAdjacentEdge-0",
"std-sketch-getNextAdjacentEdge-0",
"std-sketch-extrudeTwist-0",
"std-sketch-extrude-0",
"std-sketch-extrude-1",
"std-sketch-extrude-2",

View File

@ -170,6 +170,7 @@ pub struct Sweep {
#[serde(rename_all = "camelCase")]
pub enum SweepSubType {
Extrusion,
ExtrusionTwist,
Revolve,
RevolveAboutEdge,
Loft,
@ -1082,11 +1083,13 @@ fn artifacts_to_update(
return Ok(return_arr);
}
ModelingCmd::Extrude(kcmc::Extrude { target, .. })
| ModelingCmd::TwistExtrude(kcmc::TwistExtrude { target, .. })
| ModelingCmd::Revolve(kcmc::Revolve { target, .. })
| ModelingCmd::RevolveAboutEdge(kcmc::RevolveAboutEdge { target, .. })
| ModelingCmd::Sweep(kcmc::Sweep { target, .. }) => {
let sub_type = match cmd {
ModelingCmd::Extrude(_) => SweepSubType::Extrusion,
ModelingCmd::TwistExtrude(_) => SweepSubType::ExtrusionTwist,
ModelingCmd::Revolve(_) => SweepSubType::Revolve,
ModelingCmd::RevolveAboutEdge(_) => SweepSubType::RevolveAboutEdge,
ModelingCmd::Sweep(_) => SweepSubType::Sweep,

View File

@ -166,8 +166,12 @@ impl Args {
KclError::new_semantic(KclErrorDetails::new(message, arg.source_ranges()))
})?;
// TODO unnecessary cloning
Ok(T::from_kcl_val(&arg).unwrap())
T::from_kcl_val(&arg).ok_or_else(|| {
KclError::new_internal(KclErrorDetails::new(
format!("Mismatch between type coercion and value extraction (this isn't your fault).\nTo assist in bug-reporting, expected type: {ty:?}; actual value: {arg:?}"),
vec![self.source_range],
))
})
}
/// Get a labelled keyword arg, check it's an array, and return all items in the array

View File

@ -12,10 +12,13 @@ use kcmc::{
websocket::{ModelingCmdReq, OkWebSocketResponseData},
ModelingCmd,
};
use kittycad_modeling_cmds::{self as kcmc};
use kittycad_modeling_cmds::{
self as kcmc,
shared::{Angle, Point2d},
};
use uuid::Uuid;
use super::args::TyF64;
use super::{args::TyF64, utils::point_to_mm, DEFAULT_TOLERANCE};
use crate::{
errors::{KclError, KclErrorDetails},
execution::{
@ -121,6 +124,85 @@ async fn inner_extrude(
Ok(solids)
}
/// Extrudes by a given amount, twisting the sketch as it goes.
pub async fn extrude_twist(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let sketches = args.get_unlabeled_kw_arg("sketches", &RuntimeType::sketches(), exec_state)?;
let length: TyF64 = args.get_kw_arg("length", &RuntimeType::length(), exec_state)?;
let tolerance: Option<TyF64> = args.get_kw_arg_opt("tolerance", &RuntimeType::length(), exec_state)?;
let angle: TyF64 = args.get_kw_arg("angle", &RuntimeType::degrees(), exec_state)?;
let angle_step: Option<TyF64> = args.get_kw_arg_opt("angleStep", &RuntimeType::degrees(), exec_state)?;
let center: Option<[TyF64; 2]> = args.get_kw_arg_opt("center", &RuntimeType::point2d(), exec_state)?;
let tag_start = args.get_kw_arg_opt("tagStart", &RuntimeType::tag_decl(), exec_state)?;
let tag_end = args.get_kw_arg_opt("tagEnd", &RuntimeType::tag_decl(), exec_state)?;
let result = inner_extrude_twist(
sketches, length, tag_start, tag_end, center, angle, angle_step, tolerance, exec_state, args,
)
.await?;
Ok(result.into())
}
#[allow(clippy::too_many_arguments)]
async fn inner_extrude_twist(
sketches: Vec<Sketch>,
length: TyF64,
tag_start: Option<TagNode>,
tag_end: Option<TagNode>,
center: Option<[TyF64; 2]>,
angle: TyF64,
angle_step: Option<TyF64>,
tolerance: Option<TyF64>,
exec_state: &mut ExecState,
args: Args,
) -> Result<Vec<Solid>, KclError> {
// Extrude the element(s).
let mut solids = Vec::new();
let tolerance = LengthUnit(tolerance.as_ref().map(|t| t.to_mm()).unwrap_or(DEFAULT_TOLERANCE));
let center = center.map(point_to_mm).map(Point2d::from).unwrap_or_default();
let angle_step_size = Angle::from_degrees(angle_step.map(|a| a.to_degrees()).unwrap_or(15.0));
for sketch in &sketches {
let id = exec_state.next_uuid();
let cmds = sketch.build_sketch_mode_cmds(
exec_state,
ModelingCmdReq {
cmd_id: id.into(),
cmd: ModelingCmd::from(mcmd::TwistExtrude {
target: sketch.id.into(),
distance: LengthUnit(length.to_mm()),
faces: Default::default(),
center_2d: center,
total_rotation_angle: Angle::from_degrees(angle.to_degrees()),
angle_step_size,
tolerance,
}),
},
);
exec_state
.batch_modeling_cmds(ModelingCmdMeta::from_args_id(&args, id), &cmds)
.await?;
solids.push(
do_post_extrude(
sketch,
id.into(),
length.clone(),
false,
&NamedCapTags {
start: tag_start.as_ref(),
end: tag_end.as_ref(),
},
exec_state,
&args,
None,
)
.await?,
);
}
Ok(solids)
}
#[derive(Debug, Default)]
pub(crate) struct NamedCapTags<'a> {

View File

@ -260,6 +260,10 @@ pub(crate) fn std_fn(path: &str, fn_name: &str) -> (crate::std::StdFn, StdFnProp
|e, a| Box::pin(crate::std::extrude::extrude(e, a)),
StdFnProps::default("std::sketch::extrude").include_in_feature_tree(),
),
("sketch", "extrudeTwist") => (
|e, a| Box::pin(crate::std::extrude::extrude_twist(e, a)),
StdFnProps::default("std::sketch::extrudeTwist").include_in_feature_tree(),
),
("sketch", "patternTransform2d") => (
|e, a| Box::pin(crate::std::patterns::pattern_transform_2d(e, a)),
StdFnProps::default("std::sketch::patternTransform2d"),

View File

@ -380,6 +380,39 @@ export fn extrude(
tagEnd?: tag,
): [Solid; 1+] {}
/// Works just like the `extrude` command, but also twists the sketch around
/// some center point while it's extruding.
///
/// You can provide more than one sketch to extrude, and they will all be
/// extruded in the same direction with the same twist.
///
/// ```kcl
/// example = startSketchOn(XZ)
/// |> polygon(radius = 10, numSides = 3, center = [0, 0])
/// |> extrudeTwist(length = 10, angle = 120deg)
/// ```
@(impl = std_rust)
export fn extrudeTwist(
/// Which sketch or sketches should be extruded.
@sketches: [Sketch; 1+],
/// The total angle that the sketch will be twisted around
angle: number(Angle),
/// How far to extrude the given sketches.
length: number(Length),
/// The size of each intermediate angle as the sketch twists around.
/// Must be between 4 and 90 degrees.
/// Defaults to 15 degrees.
angleStep?: number(Angle),
/// A named tag for the face at the start of the extrusion, i.e. the original sketch.
tagStart?: tag,
/// A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch.
tagEnd?: tag,
/// The center around which the sketch will be twisted. Relative to the sketch's center.
/// If not given, defaults to 0,0 i.e. the sketch's center.
@(snippetArray = ["0", "0"])
center?: Point2d,
): [Solid; 1+] {}
/// Rotate a sketch around some provided axis, creating a solid from its extent.
///
/// This, like extrude, is able to create a 3-dimensional solid from a

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,437 @@
```mermaid
flowchart LR
subgraph path6 [Path]
6["Path<br>[406, 448, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
10["Segment<br>[454, 487, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
11["Segment<br>[493, 561, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
12["Segment<br>[567, 634, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
13["Segment<br>[640, 675, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
14["Segment<br>[681, 745, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
15["Segment<br>[751, 790, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
16["Segment<br>[796, 850, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
17["Segment<br>[856, 908, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
18["Segment<br>[914, 965, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }]
19["Segment<br>[971, 1007, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }]
20["Segment<br>[1013, 1049, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 12 }]
21["Segment<br>[1055, 1062, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 13 }]
48[Solid2d]
end
subgraph path7 [Path]
7["Path<br>[1158, 1212, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
22["Segment<br>[1218, 1266, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
23["Segment<br>[1272, 1324, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
24["Segment<br>[1330, 1373, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
25["Segment<br>[1379, 1445, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
26["Segment<br>[1451, 1522, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
end
subgraph path8 [Path]
8["Path<br>[1638, 1736, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
27["Segment<br>[1742, 1907, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
28["Segment<br>[1913, 1955, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
29["Segment<br>[1961, 1999, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
30["Segment<br>[2005, 2048, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
31["Segment<br>[2054, 2061, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
47[Solid2d]
end
subgraph path9 [Path]
9["Path<br>[2173, 2215, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
32["Segment<br>[2221, 2254, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
33["Segment<br>[2260, 2328, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
34["Segment<br>[2334, 2401, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
35["Segment<br>[2407, 2442, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
36["Segment<br>[2448, 2512, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
37["Segment<br>[2518, 2557, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
38["Segment<br>[2563, 2617, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
39["Segment<br>[2623, 2675, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
40["Segment<br>[2681, 2733, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }]
41["Segment<br>[2739, 2778, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }]
42["Segment<br>[2784, 2837, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 12 }]
43["Segment<br>[2843, 2879, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 13 }]
44["Segment<br>[2885, 2921, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 14 }]
45["Segment<br>[2927, 2934, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 15 }]
46[Solid2d]
end
1["Plane<br>[383, 400, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
2["Plane<br>[1135, 1152, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
3["Plane<br>[1590, 1631, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }, CallKwUnlabeledArg]
4["Plane<br>[2150, 2167, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
5["StartSketchOnPlane<br>[1576, 1632, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
49["Sweep Revolve<br>[1068, 1085, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 14 }]
50["Sweep Sweep<br>[2067, 2091, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
51["Sweep Revolve<br>[2940, 2957, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 16 }]
52["CompositeSolid Subtract<br>[2097, 2112, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
53[Wall]
%% face_code_ref=Missing NodePath
54[Wall]
%% face_code_ref=Missing NodePath
55[Wall]
%% face_code_ref=Missing NodePath
56[Wall]
%% face_code_ref=Missing NodePath
57[Wall]
%% face_code_ref=Missing NodePath
58[Wall]
%% face_code_ref=Missing NodePath
59[Wall]
%% face_code_ref=Missing NodePath
60[Wall]
%% face_code_ref=Missing NodePath
61[Wall]
%% face_code_ref=Missing NodePath
62[Wall]
%% face_code_ref=Missing NodePath
63[Wall]
%% face_code_ref=Missing NodePath
64[Wall]
%% face_code_ref=Missing NodePath
65[Wall]
%% face_code_ref=Missing NodePath
66[Wall]
%% face_code_ref=Missing NodePath
67[Wall]
%% face_code_ref=Missing NodePath
68[Wall]
%% face_code_ref=Missing NodePath
69[Wall]
%% face_code_ref=Missing NodePath
70[Wall]
%% face_code_ref=Missing NodePath
71[Wall]
%% face_code_ref=Missing NodePath
72[Wall]
%% face_code_ref=Missing NodePath
73[Wall]
%% face_code_ref=Missing NodePath
74[Wall]
%% face_code_ref=Missing NodePath
75[Wall]
%% face_code_ref=Missing NodePath
76[Wall]
%% face_code_ref=Missing NodePath
77[Wall]
%% face_code_ref=Missing NodePath
78[Wall]
%% face_code_ref=Missing NodePath
79["Cap End"]
%% face_code_ref=Missing NodePath
80["Cap End"]
%% face_code_ref=Missing NodePath
81["SweepEdge Opposite"]
82["SweepEdge Opposite"]
83["SweepEdge Opposite"]
84["SweepEdge Opposite"]
85["SweepEdge Adjacent"]
86["SweepEdge Adjacent"]
87["SweepEdge Adjacent"]
88["SweepEdge Adjacent"]
89["SweepEdge Adjacent"]
90["SweepEdge Adjacent"]
91["SweepEdge Adjacent"]
92["SweepEdge Adjacent"]
93["SweepEdge Adjacent"]
94["SweepEdge Adjacent"]
95["SweepEdge Adjacent"]
96["SweepEdge Adjacent"]
97["SweepEdge Adjacent"]
98["SweepEdge Adjacent"]
99["SweepEdge Adjacent"]
100["SweepEdge Adjacent"]
101["SweepEdge Adjacent"]
102["SweepEdge Adjacent"]
103["SweepEdge Adjacent"]
104["SweepEdge Adjacent"]
105["SweepEdge Adjacent"]
106["SweepEdge Adjacent"]
107["SweepEdge Adjacent"]
108["SweepEdge Adjacent"]
1 --- 6
2 --- 7
3 <--x 5
3 --- 8
4 --- 9
6 --- 10
6 --- 11
6 --- 12
6 --- 13
6 --- 14
6 --- 15
6 --- 16
6 --- 17
6 --- 18
6 --- 19
6 --- 20
6 --- 21
6 --- 48
6 ---- 49
6 --- 52
7 --- 22
7 --- 23
7 --- 24
7 --- 25
7 --- 26
8 --- 27
8 --- 28
8 --- 29
8 --- 30
8 --- 31
8 --- 47
8 ---- 50
8 --- 52
9 --- 32
9 --- 33
9 --- 34
9 --- 35
9 --- 36
9 --- 37
9 --- 38
9 --- 39
9 --- 40
9 --- 41
9 --- 42
9 --- 43
9 --- 44
9 --- 45
9 --- 46
9 ---- 51
49 <--x 10
10 --- 72
10 --- 96
49 <--x 11
11 --- 69
11 --- 97
49 <--x 12
12 --- 68
12 --- 98
49 <--x 13
13 --- 70
13 --- 99
49 <--x 14
14 --- 67
14 --- 100
49 <--x 15
15 --- 66
15 --- 101
49 <--x 16
16 --- 71
16 --- 102
49 <--x 17
17 --- 74
17 --- 103
49 <--x 18
18 --- 73
18 --- 104
49 <--x 19
19 --- 65
27 --- 77
27 x--> 80
27 --- 81
27 --- 105
28 --- 78
28 x--> 80
28 --- 82
28 --- 106
29 --- 76
29 x--> 80
29 --- 83
29 --- 107
30 --- 75
30 x--> 80
30 --- 84
30 --- 108
51 <--x 32
32 --- 53
32 --- 85
51 <--x 33
33 --- 55
33 --- 86
51 <--x 34
34 --- 62
34 --- 87
51 <--x 35
35 --- 64
35 --- 88
51 <--x 36
36 --- 56
36 --- 89
51 <--x 37
37 --- 57
37 --- 90
51 <--x 38
38 --- 54
38 --- 91
51 <--x 39
39 --- 58
39 --- 92
51 <--x 40
40 --- 61
40 --- 93
51 <--x 41
41 --- 60
41 --- 94
51 <--x 42
42 --- 63
42 --- 95
51 <--x 43
43 --- 59
49 --- 65
49 --- 66
49 --- 67
49 --- 68
49 --- 69
49 --- 70
49 --- 71
49 --- 72
49 --- 73
49 --- 74
49 --- 96
49 --- 97
49 --- 98
49 --- 99
49 --- 100
49 --- 101
49 --- 102
49 --- 103
49 --- 104
50 --- 75
50 --- 76
50 --- 77
50 --- 78
50 --- 79
50 --- 80
50 --- 81
50 --- 82
50 --- 83
50 --- 84
50 --- 105
50 --- 106
50 --- 107
50 --- 108
51 --- 53
51 --- 54
51 --- 55
51 --- 56
51 --- 57
51 --- 58
51 --- 59
51 --- 60
51 --- 61
51 --- 62
51 --- 63
51 --- 64
51 --- 85
51 --- 86
51 --- 87
51 --- 88
51 --- 89
51 --- 90
51 --- 91
51 --- 92
51 --- 93
51 --- 94
51 --- 95
53 --- 85
90 <--x 54
54 --- 91
85 <--x 55
55 --- 86
88 <--x 56
56 --- 89
89 <--x 57
57 --- 90
91 <--x 58
58 --- 92
95 <--x 59
93 <--x 60
60 --- 94
92 <--x 61
61 --- 93
86 <--x 62
62 --- 87
94 <--x 63
63 --- 95
87 <--x 64
64 --- 88
104 <--x 65
100 <--x 66
66 --- 101
99 <--x 67
67 --- 100
97 <--x 68
68 --- 98
96 <--x 69
69 --- 97
98 <--x 70
70 --- 99
101 <--x 71
71 --- 102
72 --- 96
103 <--x 73
73 --- 104
102 <--x 74
74 --- 103
75 --- 84
105 <--x 75
75 --- 108
76 --- 83
76 --- 107
108 <--x 76
77 --- 81
77 --- 105
106 <--x 77
78 --- 82
78 --- 106
107 <--x 78
81 <--x 79
82 <--x 79
83 <--x 79
84 <--x 79
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,731 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed mug.kcl
---
{
"public/kcl-samples/mug/main.kcl": [
{
"type": "VariableDeclaration",
"name": "mugDiameter",
"value": {
"type": "Number",
"value": 80.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "mugHeight",
"value": {
"type": "Number",
"value": 95.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "wallThickness",
"value": {
"type": "Number",
"value": 6.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "handleWidth",
"value": {
"type": "Number",
"value": 18.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "handleThickness",
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 4
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "revolve",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"axis": {
"value": {
"type": "Object",
"value": {
"direction": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"origin": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 14
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {
"offset": {
"value": {
"type": "Number",
"value": 26.667,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
},
{
"type": "CallKwUnlabeledArg"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "sweep",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"path": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 7
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "subtract",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"tools": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 8
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 8
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "revolve",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"axis": {
"value": {
"type": "Object",
"value": {
"direction": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"origin": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
}
]
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 8
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 16
}
]
},
"sourceRange": []
}
],
"std::appearance": [],
"std::array": [],
"std::math": [
{
"type": "VariableDeclaration",
"name": "PI",
"value": {
"type": "Number",
"value": 3.142,
"ty": {
"type": "Unknown"
}
},
"visibility": "export",
"nodePath": {
"steps": []
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "E",
"value": {
"type": "Number",
"value": 2.718,
"ty": {
"type": "Known",
"type": "Count"
}
},
"visibility": "export",
"nodePath": {
"steps": []
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "TAU",
"value": {
"type": "Number",
"value": 6.283,
"ty": {
"type": "Known",
"type": "Count"
}
},
"visibility": "export",
"nodePath": {
"steps": []
},
"sourceRange": []
}
],
"std::prelude": [
{
"type": "VariableDeclaration",
"name": "START",
"value": {
"type": "String",
"value": "start"
},
"visibility": "export",
"nodePath": {
"steps": []
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "END",
"value": {
"type": "String",
"value": "end"
},
"visibility": "export",
"nodePath": {
"steps": []
},
"sourceRange": []
}
],
"std::sketch": [],
"std::solid": [],
"std::sweep": [],
"std::transform": [],
"std::turns": [],
"std::types": [],
"std::units": []
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,343 @@
```mermaid
flowchart LR
subgraph path5 [Path]
5["Path<br>[377, 417, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
9["Segment<br>[423, 457, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
10["Segment<br>[463, 516, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
11["Segment<br>[522, 572, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
12["Segment<br>[578, 628, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
13["Segment<br>[634, 670, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
14["Segment<br>[676, 712, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
15["Segment<br>[718, 725, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
30[Solid2d]
end
subgraph path6 [Path]
6["Path<br>[983, 1013, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
16["Segment<br>[1021, 1083, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
19["Segment<br>[1091, 1130, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
20["Segment<br>[1138, 1258, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
22["Segment<br>[1266, 1322, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
24["Segment<br>[1330, 1337, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
27[Solid2d]
end
subgraph path7 [Path]
7["Path<br>[983, 1013, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
17["Segment<br>[1021, 1083, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
18["Segment<br>[1091, 1130, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
21["Segment<br>[1138, 1258, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
23["Segment<br>[1266, 1322, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
25["Segment<br>[1330, 1337, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
28[Solid2d]
end
subgraph path8 [Path]
8["Path<br>[2214, 2297, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
26["Segment<br>[2214, 2297, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
29[Solid2d]
end
1["Plane<br>[354, 371, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
2["Plane<br>[2191, 2208, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
3["StartSketchOnFace<br>[937, 975, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
4["StartSketchOnFace<br>[937, 975, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
31["Sweep Revolve<br>[731, 748, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
32["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
33["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
34["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
35["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
36["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
37["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
38["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
39["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
40["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
41["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
42["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
43["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
44["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
45["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
46["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
47["Sweep Extrusion<br>[1402, 1426, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
48["Sweep Sweep<br>[2303, 2322, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
49[Wall]
%% face_code_ref=Missing NodePath
50[Wall]
%% face_code_ref=Missing NodePath
51[Wall]
%% face_code_ref=Missing NodePath
52[Wall]
%% face_code_ref=Missing NodePath
53[Wall]
%% face_code_ref=Missing NodePath
54[Wall]
%% face_code_ref=Missing NodePath
55[Wall]
%% face_code_ref=Missing NodePath
56[Wall]
%% face_code_ref=Missing NodePath
57[Wall]
%% face_code_ref=Missing NodePath
58[Wall]
%% face_code_ref=Missing NodePath
59[Wall]
%% face_code_ref=Missing NodePath
60[Wall]
%% face_code_ref=Missing NodePath
61[Wall]
%% face_code_ref=Missing NodePath
62[Wall]
%% face_code_ref=Missing NodePath
63[Wall]
%% face_code_ref=[ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
64["Cap Start"]
%% face_code_ref=Missing NodePath
65["Cap Start"]
%% face_code_ref=Missing NodePath
66["Cap Start"]
%% face_code_ref=Missing NodePath
67["Cap End"]
%% face_code_ref=Missing NodePath
68["SweepEdge Opposite"]
69["SweepEdge Opposite"]
70["SweepEdge Opposite"]
71["SweepEdge Opposite"]
72["SweepEdge Opposite"]
73["SweepEdge Opposite"]
74["SweepEdge Opposite"]
75["SweepEdge Opposite"]
76["SweepEdge Opposite"]
77["SweepEdge Adjacent"]
78["SweepEdge Adjacent"]
79["SweepEdge Adjacent"]
80["SweepEdge Adjacent"]
81["SweepEdge Adjacent"]
82["SweepEdge Adjacent"]
83["SweepEdge Adjacent"]
84["SweepEdge Adjacent"]
85["SweepEdge Adjacent"]
86["SweepEdge Adjacent"]
87["SweepEdge Adjacent"]
88["SweepEdge Adjacent"]
89["SweepEdge Adjacent"]
90["SweepEdge Adjacent"]
91["SweepEdge Adjacent"]
92["Helix<br>[1987, 2153, 0]"]
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit]
1 --- 5
2 --- 8
63 x--> 3
63 x--> 4
5 --- 9
5 --- 10
5 --- 11
5 --- 12
5 --- 13
5 --- 14
5 --- 15
5 --- 30
5 ---- 31
6 --- 16
6 --- 19
6 --- 20
6 --- 22
6 --- 24
6 --- 27
6 ---- 37
63 --- 6
7 --- 17
7 --- 18
7 --- 21
7 --- 23
7 --- 25
7 --- 28
7 ---- 38
63 --- 7
8 --- 26
8 --- 29
8 ---- 48
31 <--x 9
9 --- 62
9 --- 86
31 <--x 10
10 --- 61
10 --- 87
31 <--x 11
11 --- 60
11 --- 88
31 <--x 12
12 --- 63
12 --- 89
31 <--x 13
13 --- 59
13 --- 90
31 <--x 14
14 --- 58
14 --- 91
16 --- 51
16 x--> 63
16 --- 68
16 --- 77
17 --- 56
17 x--> 63
17 --- 72
17 --- 81
18 --- 53
18 x--> 63
18 --- 73
18 --- 82
19 --- 50
19 x--> 63
19 --- 69
19 --- 78
20 --- 49
20 x--> 63
20 --- 70
20 --- 79
21 --- 54
21 x--> 63
21 --- 74
21 --- 83
22 --- 52
22 x--> 63
22 --- 71
22 --- 80
23 --- 55
23 x--> 63
23 --- 75
23 --- 84
26 --- 57
26 x--> 64
26 --- 76
26 --- 85
31 --- 58
31 --- 59
31 --- 60
31 --- 61
31 --- 62
31 --- 63
31 --- 86
31 --- 87
31 --- 88
31 --- 89
31 --- 90
31 --- 91
37 --- 49
37 --- 50
37 --- 51
37 --- 52
37 --- 66
37 --- 68
37 --- 69
37 --- 70
37 --- 71
37 --- 77
37 --- 78
37 --- 79
37 --- 80
38 --- 53
38 --- 54
38 --- 55
38 --- 56
38 --- 65
38 --- 72
38 --- 73
38 --- 74
38 --- 75
38 --- 81
38 --- 82
38 --- 83
38 --- 84
48 --- 57
48 --- 64
48 --- 67
48 --- 76
48 --- 85
49 --- 70
78 <--x 49
49 --- 79
50 --- 69
77 <--x 50
50 --- 78
51 --- 68
51 --- 77
80 <--x 51
52 --- 71
79 <--x 52
52 --- 80
53 --- 73
81 <--x 53
53 --- 82
54 --- 74
82 <--x 54
54 --- 83
55 --- 75
83 <--x 55
55 --- 84
56 --- 72
56 --- 81
84 <--x 56
57 --- 76
57 --- 85
90 <--x 58
58 --- 91
89 <--x 59
59 --- 90
87 <--x 60
60 --- 88
86 <--x 61
61 --- 87
62 --- 86
91 <--x 62
88 <--x 63
63 --- 89
72 <--x 65
73 <--x 65
74 <--x 65
75 <--x 65
68 <--x 66
69 <--x 66
70 <--x 66
71 <--x 66
76 <--x 67
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,439 @@
```mermaid
flowchart LR
subgraph path9 [Path]
9["Path<br>[343, 401, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
17["Segment<br>[407, 429, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
18["Segment<br>[435, 489, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
19["Segment<br>[495, 550, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
20["Segment<br>[556, 595, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
end
subgraph path10 [Path]
10["Path<br>[699, 759, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
21["Segment<br>[699, 759, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
54[Solid2d]
end
subgraph path11 [Path]
11["Path<br>[783, 849, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }]
22["Segment<br>[783, 849, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }]
58[Solid2d]
end
subgraph path12 [Path]
12["Path<br>[1018, 1043, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
23["Segment<br>[1049, 1085, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
24["Segment<br>[1091, 1185, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
25["Segment<br>[1191, 1283, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
26["Segment<br>[1289, 1354, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
27["Segment<br>[1360, 1397, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
28["Segment<br>[1403, 1438, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
29["Segment<br>[1444, 1451, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
53[Solid2d]
end
subgraph path13 [Path]
13["Path<br>[1545, 1581, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
30["Segment<br>[1587, 1610, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
31["Segment<br>[1616, 1650, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
32["Segment<br>[1656, 1691, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
33["Segment<br>[1697, 1732, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
34["Segment<br>[1738, 1787, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
35["Segment<br>[1793, 1850, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
end
subgraph path14 [Path]
14["Path<br>[1904, 1948, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
36["Segment<br>[1954, 2037, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
37["Segment<br>[2043, 2071, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
38["Segment<br>[2077, 2106, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
39["Segment<br>[2112, 2155, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
40["Segment<br>[2161, 2168, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
56[Solid2d]
end
subgraph path15 [Path]
15["Path<br>[2308, 2368, 0]"]
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
41["Segment<br>[2308, 2368, 0]"]
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
57[Solid2d]
end
subgraph path16 [Path]
16["Path<br>[2477, 2502, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
42["Segment<br>[2508, 2544, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
43["Segment<br>[2550, 2644, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
44["Segment<br>[2650, 2742, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
45["Segment<br>[2748, 2813, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
46["Segment<br>[2819, 2871, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
47["Segment<br>[2877, 2985, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
48["Segment<br>[2991, 3101, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
49["Segment<br>[3107, 3212, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
50["Segment<br>[3218, 3255, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }]
51["Segment<br>[3261, 3296, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }]
52["Segment<br>[3302, 3309, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 12 }]
55[Solid2d]
end
1["Plane<br>[320, 337, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
2["Plane<br>[643, 692, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }, CallKwUnlabeledArg]
3["Plane<br>[995, 1012, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
4["Plane<br>[1522, 1539, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
5["Plane<br>[1881, 1898, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
6["Plane<br>[2285, 2302, 0]"]
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
7["Plane<br>[2454, 2471, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
8["StartSketchOnPlane<br>[629, 693, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
59["Sweep Sweep<br>[856, 879, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
60["Sweep Revolve<br>[1457, 1474, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
61["Sweep Sweep<br>[2174, 2198, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
62["Sweep Extrusion<br>[2374, 2413, 0]"]
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
63["Sweep Revolve<br>[3315, 3332, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 13 }]
64["CompositeSolid Subtract<br>[3338, 3367, 0]"]
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 14 }]
65["CompositeSolid Subtract<br>[2204, 2219, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
66[Wall]
%% face_code_ref=Missing NodePath
67[Wall]
%% face_code_ref=Missing NodePath
68[Wall]
%% face_code_ref=Missing NodePath
69[Wall]
%% face_code_ref=Missing NodePath
70[Wall]
%% face_code_ref=Missing NodePath
71[Wall]
%% face_code_ref=Missing NodePath
72[Wall]
%% face_code_ref=Missing NodePath
73[Wall]
%% face_code_ref=Missing NodePath
74[Wall]
%% face_code_ref=Missing NodePath
75[Wall]
%% face_code_ref=Missing NodePath
76[Wall]
%% face_code_ref=Missing NodePath
77[Wall]
%% face_code_ref=Missing NodePath
78[Wall]
%% face_code_ref=Missing NodePath
79[Wall]
%% face_code_ref=Missing NodePath
80[Wall]
%% face_code_ref=Missing NodePath
81[Wall]
%% face_code_ref=Missing NodePath
82[Wall]
%% face_code_ref=Missing NodePath
83[Wall]
%% face_code_ref=Missing NodePath
84[Wall]
%% face_code_ref=Missing NodePath
85[Wall]
%% face_code_ref=Missing NodePath
86["Cap Start"]
%% face_code_ref=Missing NodePath
87["Cap Start"]
%% face_code_ref=Missing NodePath
88["Cap Start"]
%% face_code_ref=Missing NodePath
89["Cap End"]
%% face_code_ref=Missing NodePath
90["Cap End"]
%% face_code_ref=Missing NodePath
91["Cap End"]
%% face_code_ref=Missing NodePath
92["SweepEdge Opposite"]
93["SweepEdge Opposite"]
94["SweepEdge Opposite"]
95["SweepEdge Opposite"]
96["SweepEdge Opposite"]
97["SweepEdge Opposite"]
98["SweepEdge Adjacent"]
99["SweepEdge Adjacent"]
100["SweepEdge Adjacent"]
101["SweepEdge Adjacent"]
102["SweepEdge Adjacent"]
103["SweepEdge Adjacent"]
104["SweepEdge Adjacent"]
105["SweepEdge Adjacent"]
106["SweepEdge Adjacent"]
107["SweepEdge Adjacent"]
108["SweepEdge Adjacent"]
109["SweepEdge Adjacent"]
110["SweepEdge Adjacent"]
111["SweepEdge Adjacent"]
112["SweepEdge Adjacent"]
113["SweepEdge Adjacent"]
114["SweepEdge Adjacent"]
115["SweepEdge Adjacent"]
1 --- 9
2 <--x 8
2 --- 10
2 --- 11
3 --- 12
4 --- 13
5 --- 14
6 --- 15
7 --- 16
9 --- 17
9 --- 18
9 --- 19
9 --- 20
10 --- 21
10 --- 54
10 ---- 59
11 --- 22
11 --- 58
12 --- 23
12 --- 24
12 --- 25
12 --- 26
12 --- 27
12 --- 28
12 --- 29
12 --- 53
12 ---- 60
12 --- 65
13 --- 30
13 --- 31
13 --- 32
13 --- 33
13 --- 34
13 --- 35
14 --- 36
14 --- 37
14 --- 38
14 --- 39
14 --- 40
14 --- 56
14 ---- 61
14 --- 65
15 --- 41
15 --- 57
15 ---- 62
15 --- 64
16 --- 42
16 --- 43
16 --- 44
16 --- 45
16 --- 46
16 --- 47
16 --- 48
16 --- 49
16 --- 50
16 --- 51
16 --- 52
16 --- 55
16 ---- 63
16 --- 64
21 --- 80
21 x--> 90
21 --- 97
21 --- 111
60 <--x 23
23 --- 82
23 --- 112
60 <--x 24
24 --- 83
24 --- 113
60 <--x 25
25 --- 81
25 --- 114
60 <--x 26
26 --- 84
26 --- 115
60 <--x 27
27 --- 85
36 --- 68
36 x--> 88
36 --- 92
36 --- 98
37 --- 67
37 x--> 88
37 --- 93
37 --- 99
38 --- 69
38 x--> 88
38 --- 94
38 --- 100
39 --- 66
39 x--> 88
39 --- 95
39 --- 101
41 --- 70
41 x--> 89
41 --- 96
41 --- 102
63 <--x 42
42 --- 79
42 --- 103
63 <--x 43
43 --- 74
43 --- 104
63 <--x 44
44 --- 77
44 --- 105
63 <--x 45
45 --- 76
45 --- 106
63 <--x 46
46 --- 72
46 --- 107
63 <--x 47
47 --- 73
47 --- 108
63 <--x 48
48 --- 71
48 --- 109
63 <--x 49
49 --- 78
49 --- 110
63 <--x 50
50 --- 75
59 --- 80
59 --- 90
59 --- 91
59 --- 97
59 --- 111
60 --- 81
60 --- 82
60 --- 83
60 --- 84
60 --- 85
60 --- 112
60 --- 113
60 --- 114
60 --- 115
61 --- 66
61 --- 67
61 --- 68
61 --- 69
61 --- 87
61 --- 88
61 --- 92
61 --- 93
61 --- 94
61 --- 95
61 --- 98
61 --- 99
61 --- 100
61 --- 101
62 --- 70
62 --- 86
62 --- 89
62 --- 96
62 --- 102
63 --- 71
63 --- 72
63 --- 73
63 --- 74
63 --- 75
63 --- 76
63 --- 77
63 --- 78
63 --- 79
63 --- 103
63 --- 104
63 --- 105
63 --- 106
63 --- 107
63 --- 108
63 --- 109
63 --- 110
66 --- 95
98 <--x 66
66 --- 101
67 --- 93
67 --- 99
100 <--x 67
68 --- 92
68 --- 98
99 <--x 68
69 --- 94
69 --- 100
101 <--x 69
70 --- 96
70 --- 102
108 <--x 71
71 --- 109
106 <--x 72
72 --- 107
107 <--x 73
73 --- 108
103 <--x 74
74 --- 104
110 <--x 75
105 <--x 76
76 --- 106
104 <--x 77
77 --- 105
109 <--x 78
78 --- 110
79 --- 103
80 --- 97
80 --- 111
113 <--x 81
81 --- 114
82 --- 112
112 <--x 83
83 --- 113
114 <--x 84
84 --- 115
115 <--x 85
96 <--x 86
92 <--x 87
93 <--x 87
94 <--x 87
95 <--x 87
97 <--x 91
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -256,7 +256,6 @@ impl EngineConnection {
let entity_ids = generate_repl_uuids(*num_repetitions as usize);
this_response = OkModelingCmdResponse::EntityCircularPattern(kcmc::output::EntityCircularPattern {
entity_ids: entity_ids.clone(),
entity_face_edge_ids: vec![],
});

View File

@ -49,6 +49,8 @@ export function useQueryParamEffects() {
searchParams.has(CMD_NAME_QUERY_PARAM) &&
searchParams.has(CMD_GROUP_QUERY_PARAM)
console.log(window.location.href)
/**
* Watches for legacy `?create-file` hook, which share links currently use.
*/

View File

@ -6,6 +6,7 @@ import type {
Plane,
StartSketchOnFace,
StartSketchOnPlane,
SweepSubType,
Wall,
} from '@rust/kcl-lib/bindings/Artifact'
@ -92,7 +93,7 @@ interface SegmentArtifactRich extends BaseArtifact {
interface SweepArtifactRich extends BaseArtifact {
type: 'sweep'
subType: 'extrusion' | 'revolve' | 'revolveAboutEdge' | 'loft' | 'sweep'
subType: SweepSubType
path: PathArtifact
surfaces: Array<WallArtifact | CapArtifact>
edges: Array<SweepEdge>

View File

@ -1,6 +1,9 @@
import { NODE_ENV, VITE_KC_SITE_BASE_URL } from '@src/env'
import { isDesktop } from '@src/lib/isDesktop'
import { IS_PLAYWRIGHT_KEY } from '@src/lib/constants'
import {
IS_PLAYWRIGHT_KEY,
IMMEDIATE_SIGN_IN_IF_NECESSARY_QUERY_PARAM,
} from '@src/lib/constants'
import { PATHS } from '@src/lib/paths'
const isTestEnv = window?.localStorage.getItem(IS_PLAYWRIGHT_KEY) === 'true'
@ -30,9 +33,18 @@ export function getReleaseUrl(version: string = APP_VERSION) {
}
export function generateSignInUrl() {
const queryParamsNext = window.location.search.replace(
IMMEDIATE_SIGN_IN_IF_NECESSARY_QUERY_PARAM,
''
)
const finalURL =
typeof window !== 'undefined' &&
(window.location.origin + encodeURIComponent(queryParamsNext)).replace(
'?&',
'?'
)
return `${VITE_KC_SITE_BASE_URL}${
PATHS.SIGN_IN
}?callbackUrl=${encodeURIComponent(
typeof window !== 'undefined' && window.location.href.replace('signin', '')
)}`
}?callbackUrl=${encodeURIComponent(finalURL)}`
}