Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/polygone(): params custom paths #104

Merged
merged 6 commits into from Apr 28, 2018
Merged

Fix/polygone(): params custom paths #104

merged 6 commits into from Apr 28, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 23, 2018

function main(params) {
    let roof = [[10,11], [0,11], [5,20]];
    let wall = [[0,0], [10,0], [10,10], [0,10]];
    let door = [[4,0], [6,0], [6,5], [4,5]];
    let win = [[4,6], [6,6], [6,8], [4,8]];
    
    let poly1 = polygon(roof);
    let poly2 = polygon([roof, wall]);
    let poly3 = polygon({ points: roof });
    let poly4 = polygon({ points: [roof, wall] });
    let poly5 = polygon({ points: roof, paths: [0, 1, 2] });
    let poly6 = polygon({ points: [roof, wall], paths: [[0, 1, 2], [3, 4, 5, 6]] });
    let poly7 = polygon({ points: roof.concat(wall), paths: [[0, 1, 2], [3, 4, 5], [3, 6, 5]] });
    
    let poly8 = polygon([roof, wall, door, win]);
    
    return [
        poly1.translate([20, 0, 0]),
        poly2.translate([40, 0, 0]),
        poly3.translate([60, 0, 0]),
        poly4.translate([80, 0, 0]),
        poly5.translate([100, 0, 0]),
        poly6.translate([120, 0, 0]),
        poly7.translate([140, 0, 0]),
        poly8.translate([160, 0, 0])
    ];
}

jscad

@kaosat-dev
Copy link
Contributor

Looking very good ! At a glance & tests it seems to be behaving as expected : do you want to add more changes @lautr3k before I merge?

@z3dev
Copy link
Member

z3dev commented Apr 23, 2018

Just wondering... are the test cases covering all possible combinations of parameters?

@ghost
Copy link
Author

ghost commented Apr 24, 2018

@kaosat-dev no more besides the freshly added tests, @z3dev ;)

@z3dev
Copy link
Member

z3dev commented Apr 24, 2018

Wow! That’s nice. Many thanks.

@kaosat-dev kaosat-dev merged commit 7d93db8 into jscad:master Apr 28, 2018
@ghost ghost deleted the fix/polygone-params-custom-paths branch April 29, 2018 06:39
kaosat-dev pushed a commit that referenced this pull request Aug 15, 2018
* fix polygon with custom path(s)
* clean docs
* allow multiple paths in points list with paths parameter set
* add docs example entry
* fix polygon (object params, with custom paths) test
* add tests : coverage of all authorized combinations

(cherry picked from commit 7d93db8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants