CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
443 stars 28 forks source link

SATIN and PARALLEL are 90° off from each other #74

Closed golanlevin closed 4 years ago

golanlevin commented 4 years ago

hatchAngleDeg() is inconsistent: SATIN and PARALLEL are 90° off from each other. This was not obvious before because the default angle is 45°. This may also explain the 90° bug with AUTO mode, I'm not sure.

Screen Shot 2020-06-29 at 2 48 19 PM

Here's the program:


import processing.embroider.*;
PEmbroiderGraphics E;

void setup() {
  noLoop(); 
  size (800, 800);

  E = new PEmbroiderGraphics(this, width, height);
  E.beginDraw(); 
  E.clear();
  E.setStitch(10, 50, 0); 

  E.noStroke(); 
  E.fill(0, 0, 0); 
  E.hatchSpacing(5.0); 
  E.hatchAngleDeg(0);

  E.hatchMode(PEmbroiderGraphics.SATIN);
  E.circle(200,200, 150); 

  E.hatchMode(PEmbroiderGraphics.PARALLEL);
  E.circle(400,200, 150); 

  E.visualize();
}
golanlevin commented 4 years ago

By the way, I think the default should be the same as Processing, which is (unless I am mistaken): zero degrees is pointing to 3'o'clock (facing East). This would mean that SATIN is correct, PARALLEL is incorrect.... please double-check...

LingDong- commented 4 years ago

Now fixed: 1158a3e431c2615150007e476a798b25194f4955

For PARALLEL, the hatchAngle was the angle of the axis for generating the parallel lines, for SATIN, the hatchAngle was the angle of the parallel lines themselves.

golanlevin commented 4 years ago

Thanks