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

Deprecated error - square_pyramid #77

Open
Dorro101 opened this issue Dec 29, 2020 · 1 comment
Open

Deprecated error - square_pyramid #77

Dorro101 opened this issue Dec 29, 2020 · 1 comment

Comments

@Dorro101
Copy link

Dorro101 commented Dec 29, 2020

//WARNING: variable triangles not specified as parameter, in file regular_shapes.scad, line 249
//DEPRECATED: polyhedron(triangles=[]) will be removed in future releases. Use polyhedron(faces=[]) instead.

//Old code

module square_pyramid(base_x, base_y,height)
{
w=base_x/2;
h=base_y/2;
polyhedron(points=[[-w,-h,0],[-w,h,0],[w,h,0],[w,-h,0],[0,0,height]],triangles=[[0,3,2,1], [0,1,4], [1,2,4], [2,3,4], [3,0,4]]);
}

//My fix?

module square_pyramid(base_x, base_y,height)
{
w=base_x/2;
h=base_y/2;
polyhedron(points=[[-w,-h,0],[-w,h,0],[w,h,0],[w,-h,0],[0,0,height]],faces=[[0,3,2,1], [0,1,4], [1,2,4], [2,3,4], [3,0,4]]);
}

// Tests:

Also removed...

// Tests:

test_square_pyramid(){square_pyramid(10, 20, 30);}

Because...

//WARNING: Ignoring unknown module 'test_square_pyramid', in file regular_shapes.scad, line 262


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@rockstorm101
Copy link

Hi @Dorro101, the change seems sound, I would suggest you submit a PR against the 'dev' branch. Leave the test though.

For reference, 'triangles' parameter is now deprecated and 'faces' is valid since version 2014.03 [1].

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

No branches or pull requests

2 participants