| 249 | } ) |
| 250 | |
| 251 | MR::PointCloud pointCloudFromNP( const pybind11::buffer& points, const pybind11::buffer& normals ) |
| 252 | { |
| 253 | pybind11::buffer_info infoPoints = points.request(); |
| 254 | pybind11::buffer_info infoNormals = normals.request(); |
| 255 | if ( infoPoints.ndim != 2 || infoPoints.shape[1] != 3 ) |
| 256 | throw std::runtime_error( "shape of input python vector 'points' should be (n,3)" ); |
| 257 | if ( infoNormals.size != 0 && ( infoNormals.ndim != 2 || infoNormals.shape[1] != 3 ) ) |
| 258 | throw std::runtime_error( "shape of input python vector 'normals' should be (n,3) or empty" ); |
| 259 | |
| 260 | MR::PointCloud res; |
| 261 | |
| 262 | // verts to points part |
| 263 | res.points = fromNumpyArrayInfo( infoPoints ); |
| 264 | if ( infoNormals.size > 0 ) |
| 265 | res.normals = fromNumpyArrayInfo( infoNormals ); |
| 266 | |
| 267 | res.validPoints = MR::VertBitSet( res.points.size() ); |
| 268 | res.validPoints.flip(); |
| 269 | |
| 270 | return res; |
| 271 | } |
| 272 | |
| 273 | MR::Polyline2 polyline2FromNP( const pybind11::buffer& points ) |
| 274 | { |
nothing calls this directly
no test coverage detected