Skip to content

Deprecated error - square_pyramid #77

@Dorro101

Description

@Dorro101

//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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions