renames sketch group/extrude group (#4016)

* renames

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

udpates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fix parse

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fix typos

Signed-off-by: Jess Frazelle <github@jessfraz.com>

docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

update tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

empty

* fix;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* new

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add the types pages

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Look at this (photo)Graph *in the voice of Nickelback*

* empty

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jess Frazelle
2024-09-27 15:44:44 -07:00
committed by GitHub
parent 9a437ca973
commit e50de134b1
121 changed files with 3939 additions and 4087 deletions

View File

@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
use crate::{
ast::types::TagDeclarator,
errors::{KclError, KclErrorDetails},
executor::{ChamferSurface, EdgeCut, ExecState, ExtrudeGroup, ExtrudeSurface, GeoMeta, KclValue},
executor::{ChamferSurface, EdgeCut, ExecState, ExtrudeSurface, GeoMeta, KclValue, Solid},
std::{fillet::EdgeReference, Args},
};
@ -29,11 +29,10 @@ pub struct ChamferData {
/// Create chamfers on tagged paths.
pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (data, extrude_group, tag): (ChamferData, Box<ExtrudeGroup>, Option<TagDeclarator>) =
args.get_data_and_extrude_group_and_tag()?;
let (data, solid, tag): (ChamferData, Box<Solid>, Option<TagDeclarator>) = args.get_data_and_solid_and_tag()?;
let extrude_group = inner_chamfer(data, extrude_group, tag, exec_state, args).await?;
Ok(KclValue::ExtrudeGroup(extrude_group))
let solid = inner_chamfer(data, solid, tag, exec_state, args).await?;
Ok(KclValue::Solid(solid))
}
/// Cut a straight transitional edge along a tagged path.
@ -102,11 +101,11 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
}]
async fn inner_chamfer(
data: ChamferData,
extrude_group: Box<ExtrudeGroup>,
solid: Box<Solid>,
tag: Option<TagDeclarator>,
exec_state: &mut ExecState,
args: Args,
) -> Result<Box<ExtrudeGroup>, KclError> {
) -> Result<Box<Solid>, KclError> {
// Check if tags contains any duplicate values.
let mut tags = data.tags.clone();
tags.sort();
@ -127,7 +126,7 @@ async fn inner_chamfer(
}));
}
let mut extrude_group = extrude_group.clone();
let mut solid = solid.clone();
for edge_tag in data.tags {
let edge_id = match edge_tag {
EdgeReference::Uuid(uuid) => uuid,
@ -139,7 +138,7 @@ async fn inner_chamfer(
id,
ModelingCmd::from(mcmd::Solid3dFilletEdge {
edge_id,
object_id: extrude_group.id,
object_id: solid.id,
radius: LengthUnit(data.length),
tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future.
cut_type: CutType::Chamfer,
@ -151,7 +150,7 @@ async fn inner_chamfer(
)
.await?;
extrude_group.edge_cuts.push(EdgeCut::Chamfer {
solid.edge_cuts.push(EdgeCut::Chamfer {
id,
edge_id,
length: data.length,
@ -159,7 +158,7 @@ async fn inner_chamfer(
});
if let Some(ref tag) = tag {
extrude_group.value.push(ExtrudeSurface::Chamfer(ChamferSurface {
solid.value.push(ExtrudeSurface::Chamfer(ChamferSurface {
face_id: id,
tag: Some(tag.clone()),
geo_meta: GeoMeta {
@ -170,5 +169,5 @@ async fn inner_chamfer(
}
}
Ok(extrude_group)
Ok(solid)
}