Skip to content

thanks for this great work! #15

@gary-dgc

Description

@gary-dgc

Hi, Michael

I'm writing a OCR application, this repo help a lot in calculating polygon offset. but i find that there is bug in 1.2.2, so I leave message here.
finally thanks for your great work.

following code works in 1.2.4 but not work in 1.2.2

import clipper2.core.Path64;
import clipper2.core.Paths64;
import clipper2.core.Point64;
import clipper2.offset.ClipperOffset;
import clipper2.offset.EndType;
import clipper2.offset.JoinType;

public class DemoOffset {

    public static void main(String[] args){

        Path64 subject = new Path64();
//(348, 257), (364, 148), (362, 148), (326, 241), (295, 219), (258, 88), (440, 129), (370, 196), (372, 275)
        subject.add(new Point64(348, 257));
        subject.add(new Point64(364, 148));
        subject.add(new Point64(326, 241));
        subject.add(new Point64(295, 219));
        subject.add(new Point64(258, 88));
        subject.add(new Point64(440, 129));
        subject.add(new Point64(370, 196));
        subject.add(new Point64(372, 275));

        ClipperOffset offset = new ClipperOffset();

        // Paths64 paths = new Paths64();
        // paths.add(subject);
        offset.AddPath(subject, JoinType.Round, EndType.Polygon);

        Paths64 solution = new Paths64();
        offset.Execute(7.0, solution);

        solution.forEach(path -> {
            System.out.println(path.toString());
        });
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions