Skip to content

Commit 959760e

Browse files
authored
Create README.md
1 parent e42cace commit 959760e

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Unity Ply Export
2+
Export ASCII [.ply files](https://en.wikipedia.org/wiki/PLY_(file_format)) from Unity3d editor or runtime.
3+
4+
Supports both pointclouds and polygonal meshes.
5+
6+
## Setup
7+
You can install this package using **Package Manager**. Add it by this git URL:
8+
```
9+
https://github.com/Macoron/Unity-Ply-Export.git
10+
```
11+
12+
**Alternatively** just clone or download zip ot this repo and place it somewhere in your Assets folder.
13+
14+
## Examples
15+
Export mesh model into .ply file:
16+
```csharp
17+
var meshFilter = GetComponent<MeshFilter>();
18+
var ply = PlyExport.ToPly(meshFilter);
19+
File.WriteAllText("mesh.ply", ply);
20+
```
21+
22+
Export pointcloud into .ply file:
23+
```csharp
24+
var points = new List<Vector3>();
25+
for (int i = 0; i < 1000; i++)
26+
points.Add(Random.insideUnitSphere);
27+
28+
var ply = PlyExport.ToPlyPointcloud(points.ToArray());
29+
File.WriteAllText("pointcloud.ply", ply);
30+
```
31+
32+
## Limitations
33+
Keep in mind that not all data is supported for export:
34+
- [x] Colored pointclouds
35+
- [x] Polygonal mesh
36+
- [x] Mesh vertex colors
37+
- [ ] Mesh vertex normals
38+
- [ ] Mesh materials
39+
- [ ] Mesh UV
40+
41+
## License
42+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)