-
Notifications
You must be signed in to change notification settings - Fork 51
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
KCL: Patterns of patterns can use the original sketch/solid as target #5284
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
632f661
to
b3a08ce
Compare
4d788e2
to
2cc2328
Compare
017f5e8
to
776c87b
Compare
776c87b
to
43a3465
Compare
43a3465
to
445e5fb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5284 +/- ##
==========================================
- Coverage 86.05% 86.04% -0.02%
==========================================
Files 92 92
Lines 33204 33251 +47
==========================================
+ Hits 28575 28610 +35
- Misses 4629 4641 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
If I were reading code that uses useOriginal
, I think I'd always need to look up the docs. I was trying to think of another name that might make it clearer what the option does. useSketch
? Not sure. I can't think of something better.
/// The original id of the sketch. This stays the same even if the sketch is | ||
/// is sketched on face etc. | ||
pub artifact_id: ArtifactId, | ||
#[ts(skip)] | ||
pub original_id: uuid::Uuid, |
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.
These two fields are technically a duplicate of each other. That's why I renamed it in #5205. I guess it's fine, though, because they're semantically representing two different things.
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.
Hmm. Yeah I'm OK leaving it because one might change in the future, but we could also come back and remove it. Whatever you'd prefer.
Right now, if you model something like this box with a button:
Let's say you want to pattern the button, and repeat it a second time. If you try, you'll actually pattern the entire model (box + button).
Why? Because right now, when you sketch on a face (like the button was), both the box and the button share the same ID. All extrusions from a solid will share the same ID, because they all refer to the same composite solid.
This is helpful in some ways -- arguably the solid is just one big complex shape now -- but it's not helpful in other ways. What if I want to only pattern the button? Luckily there's an original ID for the button part, which is still stored. So we just need a way to tell the pattern stdlib functions whether to use the target's main ID or its original ID. This PR adds a new optional bool,
useOriginal
, to patterns. It's false by default, to keep backwards-compatibility (make sure that old KCL code doesn't change).This PR is based on #3914. It's based on work Serena and I are doing to fix a bug (engine does not allow patterning a 3D solid which was sketched on a face of another solid). @gserena01 our test program is now:
If you change the
useOriginal = true
tofalse
you can see the difference.