Skip to content

Commit

Permalink
Add README, LICENSE, captures images.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattatz committed Sep 10, 2016
1 parent 48bfe08 commit 0374c76
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
Binary file added Captures/Demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Captures/Demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 mattatz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
unity-teddy
=====================

Teddy algorithm (converting 2D polygon into 3D model) implementation in Unity.

<img src="https://raw.githubusercontent.com/mattatz/unity-teddy/master/Captures/Demo.gif" width="350px">

## Usage

```cs
// input points for a Polygon2D contor
List<Vector2> points = new List<Vector2>();

// Add Vector2 to points
points.Add(new Vector2(-2.5f, -2.5f));
points.Add(new Vector2(2.5f, -2.5f));
points.Add(new Vector2(4.5f, 2.5f));
points.Add(new Vector2(0.5f, 4.5f));
points.Add(new Vector2(-3.5f, 2.5f));

// construct Teddy
Teddy teddy = new Teddy(points);

Mesh mesh = teddy.Build(
MeshSmoothingMethod.HC, // select mesh smoothing methods : None, Laplacian, HC
5, // count of smoothing
0.25f, // alpha value for smoothing
0.5f // beta value for smoothing
);
// GetComponent<MeshFilter>().sharedMesh = mesh;
```

## Demo

[Demo](https://mattatz.github.io/unity/teddy)

## Sources

- Teddy: A Sketching Interface for 3D Freeform Design - http://www-ui.is.s.u-tokyo.ac.jp/~takeo/papers/siggraph99.pdf
- mattatz/unity-triangulation2D - https://github.com/mattatz/unity-triangulation2D
- mattatz/unity-mesh-smoothing - https://github.com/mattatz/unity-mesh-smoothing

0 comments on commit 0374c76

Please sign in to comment.