Skip to content

Clipper2 SimplifyPath do the thing of simplifyPolygon and cleanPolygon in Clipper1? #783

@rabbitLove520

Description

@rabbitLove520

Clipper1 Java code:

Paths simple = DefaultClipper.simplifyPolygon(path, Clipper.PolyFillType.NON_ZERO);
if(simple.size() == 0 ){
    return null;
}
// get the biggest area Path
Path biggest = simple.get(0);
double biggestArea = Math.abs(biggest.area());
for(int i = 0; i <simple.size();i++){
    double area = Math.abs(simple.get(i).area());
    if(area > biggestArea ){
        biggest = simple.get(i);
        biggestArea = area;
    }
}
Path clean = biggest.cleanPolygon(srcPath.config.CURVE_TOLERANCE * Config.CLIIPER_SCALE);
if(clean.size() == 0 ){
    return null ;
}

It seems I can do the same thing via

Path64 clean = Clipper.SimplifyPath(path, srcPath.config.CURVE_TOLERANCE * Config.CLIIPER_SCALE);

??

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