You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+65-20Lines changed: 65 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -442,33 +442,36 @@ Then we have the standard representation set or properties with their defaults:
442
442
443
443
The __PointCloudRepresentation__ is just a helper using the following structure to streamline rendering a point cloud dataset.
444
444
445
-
```html
446
-
<GeometryRepresentation
447
-
colorMapPreset={props.colorMapPreset}
448
-
colorDataRange={props.colorDataRange}
449
-
property={props.property}
450
-
>
451
-
<PolyDatapoints={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
+
defPointCloudRepresentation(**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
+
)
464
467
```
465
468
466
469
The set of convinient properties are as follow:
467
470
-__xyz__ = list of xyz of each point inside a flat array
468
471
-__colorMapPreset__ = color preset name to use
469
472
-__colorDataRange__ = rescale color map to provided that range
470
473
-__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.
472
475
473
476
### VolumeDataRepresentation
474
477
@@ -781,3 +784,45 @@ app.layout = html.Div(
781
784
if__name__=="__main__":
782
785
app.run_server(debug=True)
783
786
```
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.
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.
0 commit comments