Mesh: remove py2 code

This commit is contained in:
luz paz
2021-04-23 16:32:11 -04:00
committed by wwmayer
parent 1e795e869c
commit 086063f75e
3 changed files with 0 additions and 100 deletions

View File

@@ -1597,11 +1597,7 @@ MeshObject* MeshObject::createSphere(float radius, int sampling)
Py::Callable call(dict.getItem("Sphere"));
Py::Tuple args(2);
args.setItem(0, Py::Float(radius));
#if PY_MAJOR_VERSION >= 3
args.setItem(1, Py::Long(sampling));
#else
args.setItem(1, Py::Int(sampling));
#endif
Py::List list(call.apply(args));
return createMeshFromList(list);
}
@@ -1625,11 +1621,7 @@ MeshObject* MeshObject::createEllipsoid(float radius1, float radius2, int sampli
Py::Tuple args(3);
args.setItem(0, Py::Float(radius1));
args.setItem(1, Py::Float(radius2));
#if PY_MAJOR_VERSION >= 3
args.setItem(2, Py::Long(sampling));
#else
args.setItem(2, Py::Int(sampling));
#endif
Py::List list(call.apply(args));
return createMeshFromList(list);
}
@@ -1653,15 +1645,9 @@ MeshObject* MeshObject::createCylinder(float radius, float length, int closed, f
Py::Tuple args(5);
args.setItem(0, Py::Float(radius));
args.setItem(1, Py::Float(length));
#if PY_MAJOR_VERSION >= 3
args.setItem(2, Py::Long(closed));
args.setItem(3, Py::Float(edgelen));
args.setItem(4, Py::Long(sampling));
#else
args.setItem(2, Py::Int(closed));
args.setItem(3, Py::Float(edgelen));
args.setItem(4, Py::Int(sampling));
#endif
Py::List list(call.apply(args));
return createMeshFromList(list);
}
@@ -1686,15 +1672,9 @@ MeshObject* MeshObject::createCone(float radius1, float radius2, float len, int
args.setItem(0, Py::Float(radius1));
args.setItem(1, Py::Float(radius2));
args.setItem(2, Py::Float(len));
#if PY_MAJOR_VERSION >= 3
args.setItem(3, Py::Long(closed));
args.setItem(4, Py::Float(edgelen));
args.setItem(5, Py::Long(sampling));
#else
args.setItem(3, Py::Int(closed));
args.setItem(4, Py::Float(edgelen));
args.setItem(5, Py::Int(sampling));
#endif
Py::List list(call.apply(args));
return createMeshFromList(list);
}
@@ -1718,11 +1698,7 @@ MeshObject* MeshObject::createTorus(float radius1, float radius2, int sampling)
Py::Tuple args(3);
args.setItem(0, Py::Float(radius1));
args.setItem(1, Py::Float(radius2));
#if PY_MAJOR_VERSION >= 3
args.setItem(2, Py::Long(sampling));
#else
args.setItem(2, Py::Int(sampling));
#endif
Py::List list(call.apply(args));
return createMeshFromList(list);
}