CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

new PEmbroiderGraphics width height #38

Closed tatyanade closed 4 years ago

tatyanade commented 4 years ago

2020-06-19_19h51_06 2020-06-19_19h51_16

There is weird machine behavior if you make the width height in E = new PEmbroiderGraphics(this, width, height); smaller than the canvas dimensions; same file above viewed on 80x80 and 240x150; it has all the stitch information regardless of it going off canvas (didn't try running on the 80x80 in case it acts weirdly)

is there any reason to have the user manually set the dimensions for the output instead of having it match the canvas automatically?

LingDong- commented 4 years ago

I was thinking user can create multiple instances of PEmbroiderGraphics and E.visualize() them on different parts of the Processing canvas. They can also only use part of the Processing canvas for visualizing the embroidery and other part for drawing whatever.

But now I can see that it's inconvenient for people (@golanlevin was passing a wrong size earlier today and it was causing culling problems too). So I think I'll overload the constructor to use canvas width and height automatically by default if they're not passed.

LingDong- commented 4 years ago

Added PEmbroiderGraphics constructor for single argument: 946609f67f4c91cf0557491494fedf6f9d10da8b

    public PEmbroiderGraphics(PApplet _app) {
        this(_app,_app.width,_app.height);
    }