Skip to content

Commit

Permalink
more demos
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
rdeits committed Mar 12, 2018
1 parent 04a4a1f commit f828f70
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ setobject!(vis, PointCloud(verts, colors))

![demo-points](https://user-images.githubusercontent.com/591886/36703986-3d18e232-1b2c-11e8-8c40-a73e55cc93b6.png)

### Complex Geometries
### Contours

```julia
# Visualize a mesh from the level set of a function
Expand All @@ -83,6 +83,28 @@ setobject!(vis, mesh,

![demo-contour](https://user-images.githubusercontent.com/591886/36703981-37b62ba6-1b2c-11e8-90aa-4c38486732e7.png)

### Polyhedra

```
# Visualize a polyhedron from Polyhedra.jl
using Polyhedra
using CDDLib
# Construct a polyhedron in 4 dimensions
ext1 = SimpleVRepresentation([0 1 2 3;0 2 1 3; 1 0 2 3; 1 2 0 3; 2 0 1 3; 2 1 0 3;
0 1 3 2;0 3 1 2; 1 0 3 2; 1 3 0 2; 3 0 1 2; 3 1 0 2;
0 3 2 1;0 2 3 1; 3 0 2 1; 3 2 0 1; 2 0 3 1; 2 3 0 1;
3 1 2 0;3 2 1 0; 1 3 2 0; 1 2 3 0; 2 3 1 0; 2 1 3 0])
poly1 = CDDPolyhedron{4,Rational{BigInt}}(ext1)
# Project that polyhedron down to 3 dimensions for visualization
poly2 = project(poly1, [1 1 1; -1 1 1; 0 -2 1; 0 0 -3])
# Show the result
setobject!(vis, poly2)
```

![polyhedron](https://user-images.githubusercontent.com/591886/37313984-fa3b20c2-2627-11e8-8238-71607a7f16e7.png)

### Mechanisms

Using https://github.com/rdeits/MeshCatMechanisms.jl
Expand Down

0 comments on commit f828f70

Please sign in to comment.