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

log_line_strips_3d with no stroke_widths argument shows no lines #3711

Closed
jleibs opened this issue Oct 5, 2023 · 1 comment
Closed

log_line_strips_3d with no stroke_widths argument shows no lines #3711

jleibs opened this issue Oct 5, 2023 · 1 comment
Assignees
Labels
🪳 bug Something isn't working
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented Oct 5, 2023

To Reproduce

import rerun as rr

rr.init("rerun_example_line_strip3d", spawn=True)

points = [
    [0, 0, 0],
    [0, 0, 1],
    [1, 0, 0],
    [1, 0, 1],
    [1, 1, 0],
    [1, 1, 1],
    [0, 1, 0],
    [0, 1, 1],
]

rr.log_line_strips_3d("strip", [points])

Expected behavior
Line strip shows up with the default width.

Additional Info
It looks two issues:

  1. We end up logging an empty list for the radii (though not for any of the other components)
  2. This empty list causes things to fail rather than being treated as "use the default radii"
@jleibs jleibs added 🪳 bug Something isn't working 👀 needs triage This issue needs to be triaged by the Rerun team labels Oct 5, 2023
@jleibs jleibs added this to the 0.9.1 milestone Oct 5, 2023
@jleibs jleibs removed the 👀 needs triage This issue needs to be triaged by the Rerun team label Oct 5, 2023
abey79 added a commit that referenced this issue Oct 6, 2023
…bbs` (#3720)

### What

Fixes:
- #3711 

Tested with:

```python
import rerun as rr

rr.init("rerun_example_line_strip3d", spawn=True)

points_3d = [
    [0, 0, 0],
    [0, 0, 1],
    [1, 0, 0],
    [1, 0, 1],
    [1, 1, 0],
    [1, 1, 1],
    [0, 1, 0],
    [0, 1, 1],
]

points_2d = [
    [
        [0, 0],
        [1, 0],
        [1, 1],
        [0, 1],
    ],
    [
        [2, 2],
        [3, 3],
        [3, 4],
        [5, 2],
    ],
]

rr.log_line_strips_3d("strip", [points_3d])
rr.log_line_strips_2d("strip2", points_2d)
rr.log_obbs("obb", positions=[[0, 0, 0], [10, 10, 10]], half_sizes=[[1, 1, 1], [2, 2, 2]])

rr.log_transform3d("with_width", rr.Translation3D([3, 3, 3]))
rr.log_line_strips_3d("with_width/strip", [points_3d], stroke_widths=0.2)
rr.log_line_strips_2d("with_width/strip2", points_2d, stroke_widths=[0.2, 0.3])
rr.log_obbs("with_width/obb", positions=[[0, 0, 0], [10, 10, 10]], half_sizes=[[1, 1, 1], [2, 2, 2]], stroke_widths=[0.2, 0.3])
```

<img width="1137" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/44190351-bde5-4103-b2f5-e7f8c51444da">


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] ~~I have tested [demo.rerun.io](https://demo.rerun.io/pr/3720) (if
applicable)~~

- [PR Build Summary](https://build.rerun.io/pr/3720)
- [Docs
preview](https://rerun.io/preview/d4a3314f43e1e62547478362cc04b157a34b462c/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/d4a3314f43e1e62547478362cc04b157a34b462c/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
@jleibs jleibs self-assigned this Oct 6, 2023
@teh-cmc
Copy link
Member

teh-cmc commented Oct 9, 2023

@teh-cmc teh-cmc closed this as completed Oct 9, 2023
jleibs added a commit that referenced this issue Oct 9, 2023
### What
Resolves the second issue identified from:
 - #3711
 
Even with the fix from:
 - #3720
 
We could still reproduce an error with code such as:
```
"""Log a simple line strip."""
import rerun as rr

rr.init("rerun_example_line_strip3d", spawn=True)

points = [
    [0, 0, 0],
    [0, 0, 1],
    [1, 0, 0],
    [1, 0, 1],
    [1, 1, 0],
    [1, 1, 1],
    [0, 1, 0],
    [0, 1, 1],
]

rr.log("strip", rr.LineStrips3D([points], radii=[]))
```

Which would still display no lines.

It turns out the single-row joining iterator introduced a bug when a
component is cleared. This yields an empty cell for the component, but
still passes the key-based check that was being done, and then
subsequently yields no items.

This PR adds a unit-test reproing the issue, a debug_assertion where we
were previously violating an assumption, and now guards against the
condition.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3726) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3726)
- [Docs
preview](https://rerun.io/preview/7434604b10e7fb047e289dfd5ff1352ba23eadef/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/7434604b10e7fb047e289dfd5ff1352ba23eadef/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants