Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Stacks are not properly getting anchored #6000

Open
BenJamesBen opened this issue Feb 10, 2024 · 5 comments
Open

[bug]: Stacks are not properly getting anchored #6000

BenJamesBen opened this issue Feb 10, 2024 · 5 comments
Labels
馃悰 bug Something isn't working 馃摝 core Core library

Comments

@BenJamesBen
Copy link
Contributor

What seems to be the problem? 馃

From #5991 (comment):

...I seem to remember that stacks are not properly getting anchored, and I suspect that's something we need to look into.
Then again, it's a bit niche, so not urgent.

(I don't know anything else about this possible problem.)

Design / Plugin / Package 馃

packages/core

Additional context

No response

@joostdecock
Copy link
Member

You can see here how one of the parts of Lumina is trending away when sampling the seat circumference measurements.

Setting points.anchor in the design should make that point the anchor point for sampling, but that does not seem to work.

That's the bug :)

Screenshot from 2024-02-10 17-20-23

@BenJamesBen
Copy link
Contributor Author

Is this issue seen only with Lumina? I suspect that Lumina is actually shifting the location of the Waistband part relative to (0,0) based on Seat Circumference.

Screenshot 2024-02-10 at 11 06 28鈥疉M
Screenshot 2024-02-10 at 11 07 05鈥疉M

@BenJamesBen
Copy link
Contributor Author

--- a/designs/lumina/src/waistband.mjs
+++ b/designs/lumina/src/waistband.mjs
@@ -70,6 +70,16 @@ export const waistband = {
       return part.hide()
     }
 
+    // Normalize part location relative to anchor
+    const ydiff = points.waistBack.y
+    points.waistBack = points.waistBack.shift(90, ydiff)
+    points.waistFront = points.waistFront.shift(90, ydiff)
+    points.waistFrontCP = points.waistFrontCP.shift(90, ydiff)
+    points.waistBackCP = points.waistBackCP.shift(90, ydiff)
+    paths.waist = new Path()
+      .move(points.waistBack)
+      .curve(points.waistBackCP, points.waistFrontCP, points.waistFront)
+
     points.waistbandFront = points.waistFront.shift(270 + angle, waistbandSize)
     points.waistbandBack = points.waistBack.shift(270 - angle, waistbandSize)

Screenshot 2024-02-10 at 3 02 33鈥疨M

@BenJamesBen
Copy link
Contributor Author

points.anchor and points.gridAnchor functionality is currently disabled in package/core/src/stack.mjs. Instead of using Stack.getAnchor(), the anchor is hardcoded to new Point(0, 0).

  // Add transform
  //this.anchor = this.getAnchor()
  // FIXME: Can we be certain this is always (0,0) /
  this.anchor = new Point(0, 0)

The change to hardcoded (0, 0) was made on 2023-09-17 via #2827 and 0b18d81.

@joostdecock
Copy link
Member

Yes, that's the bug, or rather, it was never fully implemented.
September 2022 was when I was making sweeping changes to core since we had just decided a few weeks prior to start working on v3.
It would take another year for v3 to be released, and this is something that was never implemented. Overlooked, forgotten, or just not deemed critical to block the v3 release.

So, I think that we should fix that and implement proper anchor support in stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug Something isn't working 馃摝 core Core library
Projects
None yet
Development

No branches or pull requests

2 participants