Add edit flow for point-and-click Chamfer and Fillet (#5946)

* WIP: Add edit flow for Fillet
Fixes #5521

* Support sweepedge fillet and add edit tests

* A snapshot a day keeps the bugs away! 📷🐛

* Lint and cleanup

* Add edit flow for Chamfer
Fixes #5950

* Change to shared prepareToEdit function

* Clean up

* Lint

* Clean up of types and use of getEdgeCutConsumedCodeRef

* Find pipeIndex instead of hardcode

* Add error for non-pipe fillet and test it

* A snapshot a day keeps the bugs away! 📷🐛

* Fix lint

* A snapshot a day keeps the bugs away! 📷🐛

* Utility function to reduce code reuse across fillet and chamfer

* Clean up test diff

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Lint

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Remove change not needed

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Fix typo in toast

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Remove ['segment', 'sweepEdge'] const as it was causing some sort of circ dep

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Pierre Jacquier
2025-03-26 07:57:08 -04:00
committed by GitHub
parent c53fa421ad
commit b6fe660b84
8 changed files with 356 additions and 7 deletions

View File

@ -52,6 +52,7 @@ import {
addSweep,
createLiteral,
createLocalName,
deleteNodeInExtrudePipe,
extrudeSketch,
insertNamedConstant,
loftSketches,
@ -2335,7 +2336,14 @@ export const modelingMachine = setup({
// Extract inputs
const ast = kclManager.ast
const { selection, radius } = input
const { nodeToEdit, selection, radius } = input
// If this is an edit flow, first we're going to remove the old node
if (nodeToEdit) {
const oldNodeDeletion = deleteNodeInExtrudePipe(nodeToEdit, ast)
if (err(oldNodeDeletion)) return oldNodeDeletion
}
const parameters: FilletParameters = {
type: EdgeTreatmentType.Fillet,
radius,
@ -2490,7 +2498,14 @@ export const modelingMachine = setup({
// Extract inputs
const ast = kclManager.ast
const { selection, length } = input
const { nodeToEdit, selection, length } = input
// If this is an edit flow, first we're going to remove the old node
if (nodeToEdit) {
const oldNodeDeletion = deleteNodeInExtrudePipe(nodeToEdit, ast)
if (err(oldNodeDeletion)) return oldNodeDeletion
}
const parameters: ChamferParameters = {
type: EdgeTreatmentType.Chamfer,
length,