Skip to content

Subtract bug #21

@galharth

Description

@galharth

this is the situation Im trying to stimulate:
https://cloud.githubusercontent.com/assets/236678/18207503/b61342e2-712b-11e6-881c-bb1970ab24bb.PNG
the data:

[
    [
        [
            [
                [0, 0],
                [0, 4],
                [4, 4],
                [4, 0],
                [0, 0]
            ]
        ]
    ],
    [
        [
            [
                [2, -2],
                [2, 5],
                [3, -2],
                [3, 5],
                [2, -2]
            ]
        ]
    ]
]

the code:

var subtract = require('gh-clipping-algorithm').subtract;
var json = require('./clippingtest.json');

console.log(JSON.stringify(subtract(json[0], json[1]),null,"  "));

output:
[[[[2.857142857142857,4],[2.142857142857143,4],[2,4],[0,4],[0,0],[2,0],[2.2857142857142856,0],[2.857142857142857,4]]],[[[3,4],[4,4],[4,0],[3,0],[3,4]]]]

The output is invalid..

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