Skip to content

Commit 789cc49

Browse files
Multiple changes for TileDB-Viz 1.0.0 (#53)
* sps added * sps added * gui removed * pointScale removed * updated parameters * sps added * sps added * gui removed * pointScale removed * updated parameters * package.json updated * parameters removed * Update yarn.lock * gltf parameters updated * updated to viz-core 0.1.2-beta.11 * readme and notebooks updated * update to TileDB-Viz 1.0.0
1 parent 91833eb commit 789cc49

14 files changed

+825
-358
lines changed

README.md

Lines changed: 77 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
The TileDB-PyBabylonJS library is a geospatial data visualization Python library that interactively visualizes TileDB arrays with [Babylon.js](https://www.babylonjs.com) in a Jupyter notebook widget.
99

10-
The package is under development and currently contains:
11-
12-
* point cloud visualizations with the option to stream all data from a TileDB array or define a bounding box to load a slice of the array
13-
* MBRS visualization showing the minimum bounding rectangles of the [fragments](https://docs.tiledb.com/main/background/key-concepts-and-data-format#fragments) in the sparse array containing point cloud data
10+
The package is under development and currently contains point cloud visualizations with the option to stream all data from a TileDB array or define a bounding box to load a slice of the array
1411

1512
## Installation
1613

@@ -30,9 +27,7 @@ jupyter nbextension enable --py [--sys-prefix|--user|--system] pybabylonjs
3027
Create and activate a development environment:
3128

3229
```bash
33-
conda install -c conda-forge mamba
34-
35-
mamba create -n pybabylonjs-dev -c conda-forge nodejs yarn python=3.7.10 tree scipy 'pyarrow>2' numpy pandas tiledb-py rasterio gdal pdal python-pdal jupyter-packaging jupyterlab
30+
conda create -n pybabylonjs-dev -c conda-forge nodejs yarn python tree scipy 'pyarrow>2' numpy pandas tiledb-py jupyter-packaging jupyterlab
3631

3732
conda activate pybabylonjs-dev
3833

@@ -45,7 +40,7 @@ Fork or clone the repo and go to the main directory. Install the TileDB-PyBabylo
4540
pip install -e ".[test, examples]"
4641
```
4742

48-
When developing your extensions you need to manually enable your extensions with the notebook / lab frontend. For jupyter lab this is done by the command:
43+
When developing extensions you need to manually enable the extensions with the notebook / lab frontend. For jupyter lab this is done by the command:
4944

5045
```bash
5146
jupyter labextension install @jupyter-widgets/jupyterlab-manager
@@ -86,15 +81,16 @@ When you make a change to the Python code rebuild the package and restart the no
8681

8782
## Usage
8883

89-
### Point clouds
90-
9184
Jupyter notebooks are provided in the [examples folder](https://github.com/TileDB-Inc/TileDB-PyBabylonJS/tree/main/examples) for the following visualizations:
9285

93-
* [Slice of the Autzen point cloud](/examples/autzen_slice.ipynb)
94-
* [Streaming the Autzen point cloud](/examples/autzen-streaming.ipynb)
95-
* [Slice of the Boulder point cloud](/examples/point-cloud-boulder.ipynb)
86+
* [Point cloud visualization parameters](examples/point-cloud-parameters.ipynb) contains a description of all parameters
87+
* [Slice of the Autzen point cloud](examples/autzen-slice.ipynb)
88+
* [Slice of the Boulder point cloud](examples/boulder-slice.ipynb)
89+
* [Streaming the Autzen point cloud](examples/autzen-streaming.ipynb)
90+
* [Streaming the Bristol point cloud](examples/bristol-streaming.ipynb)
91+
* [Streaming the Santorini point cloud](examples/santorini-streaming.ipynb)
9692

97-
Display a point cloud visualization from a TileDB cloud sparse array by specifying the bounding box of a slice of the data:
93+
[Sign up for a TileDB account](https://cloud.tiledb.com/auth/signup) and display a point cloud visualization from a TileDB cloud sparse array by specifying the bounding box of a slice of data:
9894

9995
```python
10096
from pybabylonjs import Show as show
@@ -109,28 +105,80 @@ lidar_array = "autzen-classified"
109105

110106
show.point_cloud(source="cloud",
111107
uri = "tiledb://TileDB-Inc/autzen_classified_tiledb",
112-
token = "***",
108+
token=token,
113109
bbox = bbox,
114-
particle_size = 2.5,
115-
width = 1000,
116-
height = 900,
110+
point_size = 3,
117111
rgb_max = 65535,
118-
camera_radius = 700)
112+
camera_up = 25,
113+
camera_location = 2,
114+
camera_zoom = [2,2,2],
115+
point_type = 'fixed_screen_size',
116+
width=1000,
117+
height=600)
119118
```
120119

121-
Or stream all data from a group of arrays:
120+
Or stream all data from a group of arrays:
122121

123122
```python
124123
show.point_cloud(streaming=True,
125-
uri="***",
126-
token="***",
127-
max_levels=6,
128-
particle_size = 3,
129-
color_scheme = 'light',
130-
width = '1200px',
131-
height = '800px',
124+
uri="tiledb://TileDB-Inc/bristol",
125+
token=token,
126+
point_size = 4,
127+
wheel_precision = 0.2,
128+
color_scheme = 'dark',
129+
width = 1200,
130+
height = 800,
132131
rgb_max = 255,
133-
camera_radius = 800,
134-
particle_budget = 8000000)
132+
point_budget = 3500000,
133+
camera_location = 8,
134+
camera_zoom = [1, 1, 2],
135+
camera_up = 50,
136+
move_speed = 8,
137+
point_type = 'fixed_world_size')
135138
```
136139

140+
### Parameters
141+
142+
The following parameters can be set for a point cloud visualization:
143+
144+
* `camera_location` is the location of the arcRotateCamera in relation to the centre of the point cloud. 1: south, 2: south-east, 3: east, 4: north-east, 5: north, 6: north-west, 7: west, 8: south-west and 9: looking down from above the centre of the point cloud
145+
* `camera_up` is the height of the initial location of the freeCamera
146+
* `camera_zoom` scales the camera position relative to the centre of the point cloud with `[1,1,1]` being in the default position and `[2,2,2]` is then twice a far away from the centre in the X, Y and Z direction
147+
* `color_scheme` is the initial background color: `dark` (default), `light` or ` blue`
148+
* `data` is the dictionary with the point cloud data when `source = dict`. This dictionary needs to contain values for the location `X`, `Y` and `Z` and the RGB color for each point `Red`, `Green` and `Blue`
149+
* `height` is the height of the display window in pixels
150+
* `point_size` is the size of the points
151+
* `point_type` is the interactive point size type
152+
* `fixed_screen_size` (default): each point has a constant size in pixels regardless of its distance to the camera
153+
* `fixed_world_space`: each point has a constant size in world space. This value should be set accordingly to the spacing of the points in world space
154+
* `adaptive_world_space`: the same as `fixed_world_space` for the below example. But when streaming point cloud data, the point size depends on the locally loaded LODs at each point. The point density across all blocks of the same LOD should be the same and the point density should double at each LOD
155+
* `source` is the data source (`cloud` (default), `local` or `dict`)
156+
* `use_sps=True` displays the points as 3D blocks using a [Solid Particle System](https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_intro)
157+
* `use_shader=True` adds the EDL shading
158+
* `edl_strength` is the strenght of the shader
159+
* `wheel_precision` gives control over how fast to zoom with the mouse wheel
160+
* `width` is the width of the display window in pixels
161+
162+
### Navigating the point cloud
163+
164+
There are two different cameras available to navigate the point cloud, the arcRotateCamera and freeCamera. Toggle between them with `c`. The initial camera is always the arcRotateCamera
165+
166+
**arcRotateCamera**
167+
* Zoom in and out with the scroll wheel
168+
* Rotate by dragging the mouse with left button down
169+
* The parameter `wheel_precision` gives control over how fast to zoom with the mouse wheel
170+
* The camera location and distance from the centre of the points can be changed with `camera_location` and `camera_zoom`
171+
* Rotate through the `camera_locations` with `v`
172+
* Change the background color between dark and light with `b`
173+
174+
**freeCamera**
175+
* Move forward: `w` or `up`
176+
* Move backward: `s` or `down`
177+
* Move up: `e`
178+
* Move down: `q`
179+
* Move to the left: `a` or `left`
180+
* Move to the right: `d` or `right`
181+
* Rotate by dragging the mouse with left button down
182+
* The initial camera position is the centre of the point cloud, the height of the location can be changed with the parameter `camera_up`
183+
* The camera speed can be changed with the parameter `move_speed`
184+
* Change the background color between dark and light with `b`

0 commit comments

Comments
 (0)