Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List intersections #6442

Merged
merged 15 commits into from
Nov 3, 2023
Prev Previous commit
Next Next commit
correcting ray_splits, reversing
  • Loading branch information
dmitrishastin committed Nov 2, 2023
commit 767ea352f4875e0ead1f78505d5eac66122444e5
6 changes: 3 additions & 3 deletions cpp/open3d/t/geometry/RaycastingScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,10 @@ RaycastingScene::ListIntersections(const core::Tensor& rays,
shape.push_back(num_rays + 1);
result["ray_splits"] = core::Tensor(shape, core::UInt32);
uint32_t* ptr = result["ray_splits"].GetDataPtr<uint32_t>();
ptr[0] = 0;
for (int i = 1; i < cumsum.size() + 1; ++i) {
ptr[i] = cumsum[i - 1];
for (int i = 0; i < cumsum.size(); ++i) {
ptr[i] = cumsum[i];
}
ptr[num_rays] = num_intersections;
shape[0] = intersections_vector.sum();
result["ray_ids"] = core::Tensor(shape, core::UInt32);
result["geometry_ids"] = core::Tensor(shape, core::UInt32);
Expand Down
12 changes: 5 additions & 7 deletions cpp/open3d/t/geometry/RaycastingScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,11 @@ class RaycastingScene {
const int nthreads = 0);

/// \brief Computes the closest points on the surfaces of the scene.
/// \param rays A tensor with >=2 dims, shape {.., 6}, and Dtype Float32
/// describing the rays.
/// {..} can be any number of dimensions, e.g., to organize rays for
/// creating an image the shape can be {height, width, 6};
/// The last dimension must be 6 and has the format [ox, oy, oz, dx, dy, dz]
/// with [ox,oy,oz] as the origin and [dx,dy,dz] as the direction. It is not
/// necessary to normalize the direction.
/// \param query_points A tensor with >=2 dims, shape {.., 3} and Dtype
/// Float32 describing the query points. {..} can be any number of
/// dimensions, e.g., to organize the query_point to create a 3D grid the
/// shape can be {depth, height, width, 3}. The last dimension must be 3 and
/// has the format [x, y, z].
/// \param nthreads The number of threads to use. Set to 0 for automatic.
/// \return The returned dictionary contains:
/// - \b points A tensor with the closest surface points. The shape
Expand Down