#11766 New angle dimension, PointsAtAngle#11977
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merging this PR will not alter performance
Comparing Footnotes
|
|
Just one bit of UX feedback: selecting segments before equipping the Dimension tool should not fully auto-submit anymore, but instead halt the user on the "sector" selection step, I believe. Screenshare.-.2026-06-10.1_38_14.PM-compressed.mp4 |
@Irev-Dev I've updated this PR since our last discussion with these items:
|
| discovered_findings = discovered_findings.filter( | ||
| (lint) => | ||
| lint.finding.code !== 'Z0007' || | ||
| legacyAngleRefactorMetadata.some((metadata) => | ||
| sourceRangesEqual(metadata.sourceRange, lint.pos) | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Does filtering it out mean that it doesn't show up at all if there's an execution error that stops the metadata from being populated?
Or is it more the refactor button doesn't show up in that case but there's still the lint warning?
I ask because might still be good to show there's a problem in cases where we can't actually do the refactor, but even if you prefer the other maybe having a test for this?
Not sure how? maybe a kcl file with a syntax error after the old angle constraint?
Screenshare.-.2026-07-15.3_39_46.PM.mp4 |
|
I fixed the issue I left the video about The sketch-solve update path can change or restore KCL without doing a fresh full execute, so the old lint/code-action state could get stale. That meant the refactor button could either disappear after checkpoint undo, or hang around after label edits but do nothing because it was still pointing at an old source range. Now when we sync a sketch-solve outcome, we clear stale diagnostics and rebuild the lint diagnostics from the synced source plus the refactor metadata from Rust. |
Implements the new
PointsAtAngleconstraint for lines with the new UX where users can define the "sector" to apply the angle constraint to:Screenshare.-.2026-06-26.9_44_15.AM.mp4
There is a long conversation on Slack with @davreev about implementation details if you're interested in the details.
1. Old syntax uses the existing lines ezpz constraint:
P&C: not available. KCL still supported to not break KCL.
2. New syntax uses the new PointsAtAngle constraint.
P+C: select dimension tool, and click on the 2 lines, or select 2 lines, then click on the dimension tool.
It does matter which part of the line you click on!
KCL syntax
inverse is true to use the “inverse angle” of the specified sector so the angle which completes the full circle (inverse of the arc)
Alternative names would be outer / opposite / reflex.
labelPosition is the rendered position for the angle label (the numeric value displayed in the sketch rendering).
Implementation details
PointsAtAngle(vertex, ray0, ray1, angle_kind)requires a vertex point and 2 rays between which we want to constraint the angle for, so this is what we do:sectorandinversePointsAtAngle:*** Examples for mapping:
Sector 3 is where we take the reversed direction for both lines from the intersection vertex. The lines are not going into the negative direction because they both start at the origin, but in this case this is the same as enforcing 60deg between the two forward directions:
In other cases, the angle needs to be mapped too, for example:
Sector 2 means
line2 forward→line1 reverse.Now we can only use the lines’
endpoints, meaning the forward directions of the lines, because the start points are exactly at the intersection vertex. In general, we take the furthest endpoints from the intersection vertex.So we want
line2 forward→line1 reverseto be180 - 60 = 120deg. Since we can only use the forward directions, we map that toline1 forward→line2 forward=60deg:Both examples map to the same underlying constraint, which makes sense because they use the same lines and the same angle between them, just defined via a different sector.