(
py: Python<'py>,
mesh: &TriMesh3d<R>,
)
| 33 | } |
| 34 | |
| 35 | fn compute_normals_generic<'py, R: Real + Element>( |
| 36 | py: Python<'py>, |
| 37 | mesh: &TriMesh3d<R>, |
| 38 | ) -> PyResult<Bound<'py, PyUntypedArray>> { |
| 39 | let normals_vec = mesh.par_vertex_normals(); |
| 40 | let normals_vec = bytemuck::allocation::cast_vec::<Unit<Vector3<R>>, R>(normals_vec); |
| 41 | |
| 42 | Ok(PyArray::from_vec(py, normals_vec) |
| 43 | .reshape([mesh.vertices().len(), 3])? |
| 44 | .cast_into::<PyUntypedArray>() |
| 45 | .expect("cast should not fail")) |
| 46 | } |
| 47 | |
| 48 | pub fn get_triangle_mesh_generic<'py>(mesh: &Bound<'py, PyAny>) -> Option<Py<PyTriMesh3d>> { |
| 49 | let py = mesh.py(); |
no test coverage detected