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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Charlie Chino Error #6271

Open
freesewing-bot opened this issue Mar 3, 2024 · 3 comments
Open

[bug]: Charlie Chino Error #6271

freesewing-bot opened this issue Mar 3, 2024 · 3 comments
Labels
🐛 bug Something isn't working needs-triage Issues that need to be triaged/labeled 🤖 robot Auto-generated issues

Comments

@freesewing-bot
Copy link
Collaborator

Hi. I get this error (amongst others) when creating a new design.

Unable to draft part charlie.front (set 0) TypeError: y.split(...)[0].clone is not a function
at Object.l [as draft] (8663-249b18213c972355.js:1:418700)
at sq.draftPartForSet (_app-853501a72d09c022.js:1:259265)
at sq.draft (_app-853501a72d09c022.js:1:258552)
at sM.draft (_app-853501a72d09c022.js:1:278771)
at sL (8298-c4c65e54a44d3131.js:1:129261)
at lk (framework-aaff1786eadd4e8b.js:25:60902)
at op (framework-aaff1786eadd4e8b.js:25:72784)
at i (framework-aaff1786eadd4e8b.js:25:120316)
at uD (framework-aaff1786eadd4e8b.js:25:99072)
at framework-aaff1786eadd4e8b.js:25:98939

User 15059

@freesewing-bot freesewing-bot added 🐛 bug Something isn't working 🤖 robot Auto-generated issues needs-triage Issues that need to be triaged/labeled labels Mar 3, 2024
@BenJamesBen
Copy link
Contributor

Without having the original measurements used, it is difficult to analyze this error. However, I think I am able to reproduce the issue via:

  1. Create a Charlie with the following measurements:
measurements:
  crossSeam: 770
  crossSeamFront: 360
  knee: 370
  seat: 1020
  seatBack: 550
  waist: 950
  waistBack: 460
  waistToFloor: 1110
  waistToKnee: 570
  waistToHips: 60
  waistToSeat: 230
  waistToUpperLeg: 250
units: metric
  1. Note that the pattern generates just fine.
  2. Change crossSeam to 780 mm.
  3. Note that the pattern produces an error.

The first errors are (entries are from bottom to top):

ERROR | Called Path.shiftAlong(distance) but distance is not a number
ERROR | TypeError: JseamCurve.split(points.flyBottomSeamLine)[0].clone is not a function. (In 
‘JseamCurve.split(points.flyBottomSeamLine)[0].clone()’, 
‘JseamCurve.split(points.flyBottomSeamLine)[0].clone’ is undefined)
We have also logged this error to the console of your browser so you can inpect it further.
ERROR | Unable to draft part charlie.front (set 0)

The first warnings are (entries are from bottom to top):

WARN | Store.get(key) on key waistbandBack, which is undefined
WARN | points.slantBottom was set with a value that is not a Point object
WARN | Store.get(key) on key slantLength, which is undefined

@BenJamesBen
Copy link
Contributor

points.flyBottomSeamLine is calculated where the fly curve crosses a certain Y-axis. However, this means that under certain measurements and options points.flyBottomSeamLine ends up not lying on the offset JseamCurve as expected and the Path.split() fails. (The point comes very close to being on the path, but slightly off.) A better solution might be to calculate points.flyBottomSeamLine exactly where the fly curve and JseamCurve intersect.

-- a/designs/charlie/src/front.mjs
+++ b/designs/charlie/src/front.mjs
@@ -99,14 +99,6 @@ function draftCharlieFront({
 
   points.flyTopSeamline = points.flyTop.shiftTowards(points.styleWaistIn, topStitchDist)
 
-  points.flyBottomSeamLine = utils.curveIntersectsY(
-    points.crotchSeamCurveStart,
-    points.crotchSeamCurveCp2,
-    points.crotchSeamCurveCp1,
-    points.fork,
-    points.flyBottom.shiftTowards(points.crotchSeamCurveStart, topStitchDist).y
-  )
-
   paths.flyFacingLine = new Path()
     .move(points.flyTop)
     .line(points.flyCurveStart)
@@ -114,6 +106,12 @@ function draftCharlieFront({
     .setClass('lining dashed')
 
   let JseamCurve = paths.flyFacingLine.offset(-topStitchDist)
+  let flyCurve = new Path()
+    .move(points.crotchSeamCurveStart)
+    .curve( points.crotchSeamCurveCp2, points.crotchSeamCurveCp1, points.fork)
+  let intersects = JseamCurve.intersects(flyCurve)
+  if (intersects.length > 0) points.flyBottomSeamLine = intersects[0]
+  else log.error('Unable to locate the fly bottom seam line. This draft will fail.')
 
   // Too small to draw for dolls
   if (measurements.waist > 500) {

@HaasJona
Copy link
Contributor

This discord discussion might also be relevant: https://discord.com/channels/698854858052075530/1217454808152277002

There the problem happens because of a very low hip line measurement and the root problem appears to be in Titan.

Suggested simple fix:

diff --git a/designs/titan/src/front.mjs b/designs/titan/src/front.mjs
--- a/designs/titan/src/front.mjs    (revision 67fa4b8d651bf567bea56bff8cc8bc900a21ac63)
+++ b/designs/titan/src/front.mjs    (date 1710337880593)
@@ -304,6 +304,9 @@
       points.waistIn,
       points.crotchSeamCurveStart
     )
+    if(points.styleWaistIn.y >= points.crotchSeamCurveStart.y) {
+      points.crotchSeamCurveStart = points.styleWaistIn.shiftFractionTowards(points.cfSeat,0.1);
+    }
   } else {
     points.styleWaistIn = points.waistIn.clone()
     points.styleWaistOut = points.waistOut.clone()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working needs-triage Issues that need to be triaged/labeled 🤖 robot Auto-generated issues
Projects
None yet
Development

No branches or pull requests

3 participants