Skip to content

Commit e9c25a1

Browse files
committed
doc update
1 parent e83dc3d commit e9c25a1

File tree

1 file changed

+65
-20
lines changed

1 file changed

+65
-20
lines changed

docs/README.md

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -442,33 +442,36 @@ Then we have the standard representation set or properties with their defaults:
442442

443443
The __PointCloudRepresentation__ is just a helper using the following structure to streamline rendering a point cloud dataset.
444444

445-
```html
446-
<GeometryRepresentation
447-
colorMapPreset={props.colorMapPreset}
448-
colorDataRange={props.colorDataRange}
449-
property={props.property}
450-
>
451-
<PolyData points={props.xyz} connectivity='points'>
452-
{nbComponents && (
453-
<PointData>
454-
<DataArray
455-
registration='setScalars'
456-
numberOfComponents={nbComponents}
457-
values={values}
458-
type={type}
459-
/>
460-
</PointData>
461-
)}
462-
</PolyData>
463-
</GeometryRepresentation>
445+
```python
446+
def PointCloudRepresentation(**kwargs):
447+
return dash_vtk.GeometryRepresentation(
448+
id=kwargs.get('id'),
449+
colorMapPreset=kwargs.get('colorMapPreset'),
450+
colorDataRange=kwargs.get('colorDataRange'),
451+
property=kwargs.get('property'),
452+
children=[
453+
dash_vtk.PolyData(
454+
points=kwargs.get('xyz'),
455+
connectivity='points',
456+
children=[
457+
dash_vtk.PointData([
458+
dash_vtk.DataArray(
459+
registration='setScalars',
460+
values={kwargs.get('scalars')}
461+
)
462+
])
463+
],
464+
)
465+
],
466+
)
464467
```
465468

466469
The set of convinient properties are as follow:
467470
- __xyz__ = list of xyz of each point inside a flat array
468471
- __colorMapPreset__ = color preset name to use
469472
- __colorDataRange__ = rescale color map to provided that range
470473
- __property__ = {} # Same as GeometryRepresentation/property
471-
- __rgb__ / __rgba__ / __scalars__ = [...] let you define the field you want to color your point cloud with.
474+
- __rgb__ / __rgba__ / __scalars__ = [...] let you define the field you want to color your point cloud with. The rgb(a) expect numbers up to 255 for each component of Red Green Blue Alpha.
472475

473476
### VolumeDataRepresentation
474477

@@ -781,3 +784,45 @@ app.layout = html.Div(
781784
if __name__ == "__main__":
782785
app.run_server(debug=True)
783786
```
787+
788+
## More advanced demos
789+
790+
__dash_vtk__ provides several advanced examples that should re-enforce what has been described so far.
791+
792+
We've converted several examples from [PyVista](https://docs.pyvista.org/) to show you how to enable rendering on the client side using __dash_vtk__.
793+
794+
Then we made several example using plain VTK for both a CFD example and some medical ones.
795+
796+
### Point Cloud creation
797+
798+
[dash_vtk](https://github.com/plotly/dash-vtk/blob/master/demos/pyvista-point-cloud/app.py) | [PyVista](https://docs.pyvista.org/examples/00-load/create-point-cloud.html)
799+
800+
![Preview](../../demos/pyvista-point-cloud/demo.jpg)
801+
802+
### Terrain following mesh
803+
804+
[dash_vtk](https://github.com/plotly/dash-vtk/blob/master/demos/pyvista-terrain-following-mesh/app.py) | [PyVista](https://docs.pyvista.org/examples/00-load/terrain-mesh.html)
805+
![Preview](../../demos/pyvista-terrain-following-mesh/demo.jpg)
806+
807+
### VTK dynamic streamlines Example
808+
809+
This example leverage plain VTK on the server side while providing UI controls in __dash__ and leverage __dash_vtk__ to enable local rendering of dynamically computed streamlines inside a wind-tunnel.
810+
811+
[dash_vtk](https://github.com/plotly/dash-vtk/blob/master/demos/usage-vtk-cfd/app.py)
812+
813+
![CFD Preview](../../demos/usage-vtk-cfd/demo.jpg)
814+
815+
### Medical examples
816+
817+
[Real medical image](https://github.com/plotly/dash-vtk/blob/master/demos/volume-rendering/app.py)
818+
819+
![Real medical image](../../demos/volume-rendering/demo.jpg)
820+
821+
822+
[Randomly generated volume](https://github.com/plotly/dash-vtk/blob/master/demos/synthetic-volume-rendering/app.py)
823+
824+
![Randomly generated volume](../../demos/synthetic-volume-rendering/demo.jpg)
825+
826+
[Multi-View with slicing](https://github.com/plotly/dash-vtk/blob/master/demos/slice-rendering/app.py)
827+
828+
![Multi-View with slicing](../../demos/slice-rendering/demo.jpg)

0 commit comments

Comments
 (0)