Skip to content

Conversation

@Irev-Dev
Copy link
Contributor

No description provided.

jtran added 30 commits October 24, 2025 20:39
This reverts commit 1cfb766321e5f81864ed20575715ab8ea70283e8.
This reverts commit 900fa49d53715f7106a017869160b9a6b43732dc.
See rust-lang/rust issue 37748. I'm avoiding using a real link to stop making backlinks on the Rust issue.
@vercel
Copy link

vercel bot commented Nov 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Nov 18, 2025 5:35am

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 17, 2025

CodSpeed Performance Report

Merging #8935 will not alter performance

Comparing sketch-revamp (0a82a9b) with main (076725d)1

Summary

✅ 142 untouched
⏩ 92 skipped2

Footnotes

  1. No successful run was found on main (3a7f58d) during the generation of this report, so 076725d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 92 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Use delete_objects() instead.
Comment on lines +568 to +603

// Call newSketch API
try {
const project = theProject.current
if (!project) {
console.warn('No project available for newSketch call')
} else {
// Construct SketchArgs based on the result
let sketchArgs: SketchArgs

// Determine the plane type from the result
if (result.type === 'defaultPlane') {
sketchArgs = {
on: { default: toPlaneName(result.plane) },
}
} else {
sketchArgs = { on: { default: 'xy' } }
}

await rustContext.hackSetProgram(
kclManager.ast,
await jsAppSettings()
)
const newSketchResult = await rustContext.newSketch(
0, // projectId - using 0 as placeholder
0, // fileId - using 0 as placeholder
0, // version - using 0 as placeholder
sketchArgs,
{ settings: { modeling: { base_unit: defaultUnit.current } } }
)
codeManager.updateCodeEditor(newSketchResult.kclSource.text)
}
} catch (error) {
console.error('Error calling newSketch:', error)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Long term because we want rust to be in charge of code-mods, than the code state needs to live in rust, and as the UI fires code-mods in the rust side, we'll update the editor or what have you, so there needs to be a lifecycle api for updating files either way.

But since the sketch-revamp is first time that we're implementing code-mods in rust, there needs to be a handover to tell rust what the current AST is, for it to continue to modify from there, and that's what hackSetProgram is.

Also newSketch has a number of place holder params we're not using yet (i.e. all set to 0)

Comment on lines +19 to +39
export function forceSuffix(unitStr: string): NumericSuffix {
switch (unitStr) {
case 'None':
case 'Count':
case 'Length':
case 'Angle':
case 'Mm':
case 'Cm':
case 'M':
case 'Inch':
case 'Ft':
case 'Yd':
case 'Deg':
case 'Rad':
case 'Unknown':
return unitStr
default:
return 'Mm' // default to Mm if unknown
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this to make TS happy.

}),
},
actors: {
modAndSolveFirstPoint: fromPromise(
Copy link
Contributor

Choose a reason for hiding this comment

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

This name is a little misleading. It is mentioning modAndsolveFirstPoint.

The input to this function is a pointData and it creates a segment with the same position for start and end? Is a point a segment with the same positions?

Also why is this called firstPoint? What does first mean?

coincident: {
actions: async ({ self, context }) => {
// TODO this is not how coincident should operate long term, as it should be an equipable tool
const result = await context.rustContext.addConstraint(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be fire and forget?

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.

4 participants