Skip to content

Conversation

@jtran
Copy link
Contributor

@jtran jtran commented Jan 9, 2026

Extracted from #9557.

Motivation

Problem 1. Right now, when you sketch a profile and tag an edge, then extrude, the tag is ambiguous. Does it refer to the edge or the wall face that it becomes? Our docs say that extruding morphs one into the other 🤦 So what happens to the edge? You can't refer to it anymore? This specifically came up in the design for GD&T where users may want to annotate arbitrary geometry, so we can't infer that they mean one or the other.

Problem 2. If you want to use the face for anything significant like sketching on it, the tag is lacking information. Ever notice how you must do startSketchOn(mySolid, face = myTag)? Why isn't it just startSketchOn(myTag)? Shouldn't that be enough to know what face you mean?

Proposal: A new function that bundles up all the relevant information of a face on a solid. The signature looks like this: fn faceOf(@solid: Solid, face: TaggedFace): Face. Basically, I'm trying to prevent new sketch blocks from inheriting the wonkiness of sketch v1. And for that, I'd like to be able to say sketch(on = something), where something is a face, not sketch(on = mySolid, face = myTag). But I also see this as a general way to disambiguate a face from an edge because we could make myTag default to the edge. OTOH, if you want the face, then you can say faceOf(mySolid, face = myTag).

In the future, we can make tags actually know about the solid they came from, and we could extend the function with an overload to allow faceOf(myTag). It disambiguates from the edge. No breaking change.

Implementation

The implementation already exists as a specific case of the legacy startSketchOn(). Ever notice how that function returns a Plane or Face? Weird, considering the name of the function. But it's exactly what we need for a sketch surface.

The parameter naming is unfortunate. faceOf(..., face = ...) We try to avoid the duplication. But we also try to follow the convention that a parameter named tag is only for creating a tag. This mirrors the signature of the legacy startSketchOn(solid1, face = tag1).

@vercel
Copy link

vercel bot commented Jan 9, 2026

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

Project Deployment Review Updated (UTC)
modeling-app Ready Ready Preview, Comment Jan 12, 2026 8:25pm

@jtran jtran added the sketch-solve PRs changing sketch-solve functionality only. label Jan 9, 2026
@jtran jtran marked this pull request as ready for review January 9, 2026 20:22
@jtran jtran requested a review from a team as a code owner January 9, 2026 20:22
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 9, 2026

Merging this PR will not alter performance

✅ 152 untouched benchmarks
⏩ 92 skipped benchmarks1


Comparing jtran/stdlib-face-of (b91df23) with main (53a168c)2

Open in CodSpeed

Footnotes

  1. 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.

  2. No successful run was found on main (efbc779) during the generation of this report, so 53a168c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jtran jtran enabled auto-merge (squash) January 12, 2026 20:25
@jtran jtran merged commit a232037 into main Jan 12, 2026
91 of 92 checks passed
@jtran jtran deleted the jtran/stdlib-face-of branch January 12, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sketch-solve PRs changing sketch-solve functionality only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants