Skip to content

Conversation

pierremtb
Copy link
Contributor

@pierremtb pierremtb commented Jul 22, 2025

Closes #7555 and #7883
Refactors the codemod the same way we did sweeps, transforms, helix, shell as part of https://github.com/KittyCAD/modeling-app/milestone/4, with non-playwright test cases for default planes, offset plane on offset plane, and offset plane on cap.

Two things to resolve before merging:

  • the rust side could be cleaned up now that we have the plane IDs
  • the pre-selection gotcha for planes listed in the comments

Demo:

Screen.Recording.2025-07-23.at.2.53.37.PM.mov

Edit flows not working yet
Will eventually close #7555
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Preview Comment Aug 14, 2025 6:22pm

@@ -381,26 +381,23 @@ test.describe('Feature Tree pane', () => {
await cmdBar.expectState({
commandName: 'Offset plane',
stage: 'arguments',
currentArgKey: 'distance',
currentArgKey: 'offset',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed this to be more in line with KCL

Comment on lines +1103 to +1104
const xz = await toolbar.getFeatureTreeOperation('Front plane', 0)
await xz.click()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And would like to keep these two tests as they aren't px dependent anymore

/**
* Append an offset plane to the AST
*/
export function addOffsetPlane({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to faces.ts with the addShell codemod since they will share a few utils

ast: modifiedAst,
call,
pathToEdit: nodeToEdit,
pathIfNewPipe: undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pipe expr for offset planes for now

Comment on lines 62 to 64
const result = buildSolidsAndFacesExprs(
faces,
artifactGraph,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making it a lil nicer for shell as well


console.log('Offset plane operation:', operation)

// TODO: replace with util function when available
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function from #7819

@pierremtb pierremtb changed the title WIP: Offset Plane point-and-click for sweep faces Offset Plane point-and-click for sweep faces Jul 23, 2025
@pierremtb pierremtb changed the title Offset Plane point-and-click for sweep faces Offset Plane point-and-click from sweep face Jul 23, 2025
@max-mrgrsk
Copy link
Contributor

amazing work mate!
2 things (probably separate pr)

  • being able to select the face after you enter the ui would be nice
  • offset plane from the chamfer would be dope too

@pierremtb
Copy link
Contributor Author

@max-mrgrsk Thank you!

I fixed the first bullet, and for the second one I created #8068 to track it

@pierremtb pierremtb marked this pull request as ready for review August 14, 2025 16:14
Copy link
Contributor

@franknoirot franknoirot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for me, aside from chamfer faces, which you've already captured an issue for. Great job, the code looks clean and well-thought through. I had a slight urge to suggest more generic approaches to the utility functions in faces.test.ts but I think it's good to hold off on that until it's actually used.

Big unlock for users, way to go!

// 2. Prepare unlabeled and labeled arguments
let planeExpr: Expr | undefined
const hasFaceToOffset = plane.graphSelections.some(
(sel) => sel.artifact?.type === 'cap' || sel.artifact?.type === 'wall'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I thought I had you noticing that chamfer faces weren't working! Nice

@pierremtb pierremtb merged commit 66ee258 into main Aug 14, 2025
78 checks passed
@pierremtb pierremtb deleted the pierremtb/issue7555-Add-ability-to-define-plane-offset-from-a-face-in-point-and-click branch August 14, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add planeOf artifacts to the graph Add ability to define plane offset from a face in point-and-click
5 participants