diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm index f4d55cb68..4adf9366e 100644 --- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm +++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm @@ -344,12 +344,12 @@ sub on_btn_lambda { my $params = $dlg->ObjectParameter; my $type = "".$params->{"type"}; my $name = "lambda-".$params->{"type"}; - my $mesh = Slic3r::TriangleMesh->new(); + my $mesh; if ($type eq "box") { - $mesh = $mesh->cube($params->{"dim"}[0], $params->{"dim"}[1], $params->{"dim"}[2]); + $mesh = Slic3r::TriangleMesh::cube($params->{"dim"}[0], $params->{"dim"}[1], $params->{"dim"}[2]); } elsif ($type eq "cylinder") { - $mesh = $mesh->cylinder($params->{"cyl_r"}, $params->{"cyl_h"}); + $mesh = Slic3r::TriangleMesh::cylinder($params->{"cyl_r"}, $params->{"cyl_h"}); } else { return; } diff --git a/xs/xsp/TriangleMesh.xsp b/xs/xsp/TriangleMesh.xsp index 32425d6d4..7f2e71bcb 100644 --- a/xs/xsp/TriangleMesh.xsp +++ b/xs/xsp/TriangleMesh.xsp @@ -37,10 +37,7 @@ %code{% RETVAL = THIS->bounding_box().center(); %}; int facets_count(); void reset_repair_stats(); - Clone cube(double x, double y, double z) - %code{% RETVAL = make_cube(x, y, z); %}; - Clone cylinder(double r, double h) - %code{% RETVAL = make_cylinder(r, h); %}; + %{ void @@ -228,6 +225,21 @@ TriangleMesh::bb3() OUTPUT: RETVAL + +Clone +cube(double x, double y, double z) + CODE: + RETVAL = make_cube(x,y,z); + OUTPUT: + RETVAL + +Clone +cylinder(double r, double h) + CODE: + RETVAL = make_cylinder(r, h); + OUTPUT: + RETVAL + %} };