-
Notifications
You must be signed in to change notification settings - Fork 96
Codemod for surface extrude #9151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces an optional bodyType argument to the addExtrude codemod, allowing specification of body type in the extrude operation. Updates the function signature and call expression to handle the new parameter.
Introduces a new test case to verify that an extrude call with the bodyType parameter set to 'surface' is correctly added. The runtime check is commented out pending KCL stdlib support for the bodyType parameter.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| ? [createLabeledArg('method', createLocalName(method))] | ||
| : [] | ||
| const bodyTypeExpr = bodyType | ||
| ? [createLabeledArg('bodyType', createLocalName(bodyType))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a constant here? Like sweep::SKETCH_PLANE for addSweep?
Will check if it exists in Rust in KCL already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmh looks like it doesn't. We should add something like rust/kcl-lib/std/sweep.kcl for extrude @adamchalmers I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once that's done we should change bodyType?: string to be bodyType?: ExtrudeBodyType and have that explicitiy typed as the allowed values here I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry didn't realize that this isn't in KCL yet, my bad!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pierremtb Thank you, I will add it to todo list in the parent issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw @pierremtb do you think we would need the same for method?: string ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah totally! Those should be KCL constants
Add a new parameter to the codemod to enable surface extrude, alongside the existing solid extrude. This updates
addExtrudeto accept bodyTypeand generates extrude(..., bodyType = surface). Test validation is temporarily disabled until KCL stdlib supports bodyType.part of ZDS support for Extrude Surface