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

Fix default stroke width handling in log_line_strip_Xd and log_obbs #3720

Merged
merged 2 commits into from Oct 6, 2023

Conversation

abey79
Copy link
Contributor

@abey79 abey79 commented Oct 6, 2023

What

Fixes:

Tested with:

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])
image

Checklist

@abey79 abey79 added 🪳 bug Something isn't working 🐍 Python API Python logging API include in changelog labels Oct 6, 2023
@abey79 abey79 merged commit 2f4e78d into main Oct 6, 2023
30 checks passed
@abey79 abey79 deleted the antoine/fix-stroke-width-to-radii-conversion-3711 branch October 6, 2023 14:27
@jleibs jleibs added this to the 0.9.1 milestone Oct 6, 2023
jleibs added a commit that referenced this pull request 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 include in changelog 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants