-
Notifications
You must be signed in to change notification settings - Fork 394
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
Flesh out archetype docs and simple code examples fo rmore types #2467
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1985d37
Arrow3D Archetype
jleibs 22aa211
Box3d Archetype
jleibs 81940b3
Rect2D Archetype
jleibs 7543b07
Linestrip2D Archetype
jleibs b7229c4
Linestrip3D Archetype
jleibs 2e66d11
Mesh Archetype
jleibs 524b008
Point3D Archetype
jleibs a717603
Fixes
jleibs d8294b0
Spelling
jleibs fb697fd
Fix the rect formats
jleibs 01ecb27
Ignore XYWH in spell check
nikolausWest de16733
Remove XYWY from accepted spelling
nikolausWest 5eba986
Update Box3D language around vec3d and quaternion
nikolausWest d8d222a
Collapse blueprint where possible in screenshots
nikolausWest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Log a single arrow.""" | ||
import rerun as rr | ||
|
||
rr.init("arrow", spawn=True) | ||
|
||
rr.log_arrow("simple", origin=[0, 0, 0], vector=[1, 0, 1], width_scale=0.05) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Log a single oriented bounding box.""" | ||
import rerun as rr | ||
|
||
rr.init("box3d", spawn=True) | ||
|
||
rr.log_obb("simple", half_size=[2.0, 2.0, 1.0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Log a simple set of line segments.""" | ||
import rerun as rr | ||
|
||
rr.init("linesegments2d", spawn=True) | ||
|
||
rr.log_line_segments( | ||
"simple", | ||
[[0, 0], [2, 1], [4, -1], [6, 0]], | ||
) | ||
|
||
# Log an extra rect to set the view bounds | ||
rr.log_rect("bounds", [3, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Log a simple set of line segments.""" | ||
import rerun as rr | ||
|
||
rr.init("linesegments3d", spawn=True) | ||
|
||
rr.log_line_segments( | ||
"simple", | ||
[ | ||
[0, 0, 0], | ||
[0, 0, 1], | ||
[1, 0, 0], | ||
[1, 0, 1], | ||
[1, 1, 0], | ||
[1, 1, 1], | ||
[0, 1, 0], | ||
[0, 1, 1], | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Log a simple line strip.""" | ||
import rerun as rr | ||
|
||
rr.init("linestrip2d", spawn=True) | ||
|
||
rr.log_line_strip( | ||
"simple", | ||
[[0, 0], [2, 1], [4, -1], [6, 0]], | ||
) | ||
|
||
# Log an extra rect to set the view bounds | ||
rr.log_rect("bounds", [3, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Log a simple line strip.""" | ||
import rerun as rr | ||
|
||
rr.init("linestrip3d", spawn=True) | ||
|
||
rr.log_line_strip( | ||
"simple", | ||
[ | ||
[0, 0, 0], | ||
[0, 0, 1], | ||
[1, 0, 0], | ||
[1, 0, 1], | ||
[1, 1, 0], | ||
[1, 1, 1], | ||
[0, 1, 0], | ||
[0, 1, 1], | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Log a simple colored triangle.""" | ||
import rerun as rr | ||
|
||
rr.init("mesh", spawn=True) | ||
|
||
rr.log_mesh( | ||
"triangle", | ||
positions=[ | ||
[0.0, 0.0, 0.0], | ||
[1.0, 0.0, 0.0], | ||
[0.0, 1.0, 0.0], | ||
], | ||
indices=[0, 1, 2], | ||
normals=[ | ||
[0.0, 0.0, 1.0], | ||
[0.0, 0.0, 1.0], | ||
[0.0, 0.0, 1.0], | ||
], | ||
vertex_colors=[ | ||
[255, 0, 0], | ||
[0, 255, 0], | ||
[0, 0, 255], | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Log a simple rectangle.""" | ||
import rerun as rr | ||
|
||
rr.init("rect2d", spawn=True) | ||
|
||
rr.log_rect("simple", [-1, -1, 2, 2], rect_format=rr.RectFormat.XYWH) | ||
|
||
# Log an extra rect to set the view bounds | ||
rr.log_rect("bounds", [0, 0, 4, 3], rect_format=rr.RectFormat.XCYCWH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,20 @@ | |
title: Linestrip2D | ||
order: 4 | ||
--- | ||
`Linestrip2D` represents a series of connected line segments in two-dimensional space. The `linestrip2d` component is | ||
defined by a list of 2d points, which are connected sequentially. Additionally, linestrips can be drawn with color and | ||
radius. The radius controls the thickness of the line segments. | ||
|
||
There are currently two python APIs that both use the same underlying `Linestrip2D` archetype. | ||
* [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip) outputs a single linestrip from the provided points. | ||
* [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) outputs a batch of linestrips each made up of a single line. | ||
|
||
`draw_order` can be used to control how the `Linestrip2D` entities are drawn relative to other objects within the scene. | ||
Higher values are drawn on top of lower values. | ||
|
||
Notes: | ||
* There is not currently a python API for logging a batch of linestrips. | ||
* In the python APIs `radius` is currently derived from `stroke_width` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jleibs I'll merge this now but we should explain how it's derived in the future |
||
|
||
## Components and APIs | ||
Primary component: `linestrip2d` | ||
|
@@ -11,3 +25,25 @@ Secondary components: `colorrgba`, `radius`, `draw_order` | |
Python APIs: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) | ||
|
||
Rust API: [LineStrip2D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip2D.html) | ||
|
||
## Simple Examples | ||
|
||
code-example: line_strip2d_simple | ||
|
||
<picture> | ||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/53513e074a1d01388ac6ac9664ff9d452813870d_line_strip2d_simple_480w.png"> | ||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/669c61837dc3464090945f6ade96f0205006e202_line_strip2d_simple_768w.png"> | ||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/81cf822ebaa5faff8d129f2705872621835acc95_line_strip2d_simple_1024w.png"> | ||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/e549c9d69a19754803c648b665be5afbff9b7cad_line_strip2d_simple_1200w.png"> | ||
<img style="width: 75%;" src="https://static.rerun.io/c4e6ce937544e66b497450fd64ac3ac2f244f0e1_line_strip2d_simple_full.png" alt=""> | ||
</picture> | ||
|
||
code-example: line_segments2d_simple | ||
|
||
<picture> | ||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/3c3604e215d461340ffc8dd53223406d732b44ac_line_segment2d_simple_480w.png"> | ||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/7b0a8e60b0d6f005618c0ac09113ce84a08fb778_line_segment2d_simple_768w.png"> | ||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/3ee262f61cb74aaffd7fd0b506754ee11cab3c12_line_segment2d_simple_1024w.png"> | ||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/196e0f2fe2222526e9eba87fa39440ada08e273d_line_segment2d_simple_1200w.png"> | ||
<img style="width: 75%;" src="https://static.rerun.io/53df596662dd9ffaaea5d09d091ef95220346c83_line_segment2d_simple_full.png" alt=""> | ||
</picture> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go ahead and merge without fixing this but we should really say what this relationship is @jleibs