Skip to content

Commit 6cf875c

Browse files
committed
Fix unit vectors for ProjectPolygon and fix unit tests.
1 parent 4412ea6 commit 6cf875c

30 files changed

+42038
-41992
lines changed

LibTessDotNet/Sources/Dict.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/*
2-
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3-
** Copyright (C) 2011 Silicon Graphics, Inc.
4-
** All Rights Reserved.
5-
**
6-
** Permission is hereby granted, free of charge, to any person obtaining a copy
7-
** of this software and associated documentation files (the "Software"), to deal
8-
** in the Software without restriction, including without limitation the rights
9-
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10-
** of the Software, and to permit persons to whom the Software is furnished to do so,
11-
** subject to the following conditions:
12-
**
13-
** The above copyright notice including the dates of first publication and either this
14-
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15-
** included in all copies or substantial portions of the Software.
16-
**
17-
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18-
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19-
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20-
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
** OR OTHER DEALINGS IN THE SOFTWARE.
23-
**
24-
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25-
** be used in advertising or otherwise to promote the sale, use or other dealings in
26-
** this Software without prior written authorization from Silicon Graphics, Inc.
1+
/*
2+
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3+
** Copyright (C) 2011 Silicon Graphics, Inc.
4+
** All Rights Reserved.
5+
**
6+
** Permission is hereby granted, free of charge, to any person obtaining a copy
7+
** of this software and associated documentation files (the "Software"), to deal
8+
** in the Software without restriction, including without limitation the rights
9+
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
** of the Software, and to permit persons to whom the Software is furnished to do so,
11+
** subject to the following conditions:
12+
**
13+
** The above copyright notice including the dates of first publication and either this
14+
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15+
** included in all copies or substantial portions of the Software.
16+
**
17+
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18+
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19+
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20+
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22+
** OR OTHER DEALINGS IN THE SOFTWARE.
23+
**
24+
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25+
** be used in advertising or otherwise to promote the sale, use or other dealings in
26+
** this Software without prior written authorization from Silicon Graphics, Inc.
2727
*/
28-
/*
29-
** Original Author: Eric Veach, July 1994.
30-
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31-
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
28+
/*
29+
** Original Author: Eric Veach, July 1994.
30+
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31+
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
3232
*/
3333

3434
namespace LibTessDotNet

LibTessDotNet/Sources/Geom.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/*
2-
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3-
** Copyright (C) 2011 Silicon Graphics, Inc.
4-
** All Rights Reserved.
5-
**
6-
** Permission is hereby granted, free of charge, to any person obtaining a copy
7-
** of this software and associated documentation files (the "Software"), to deal
8-
** in the Software without restriction, including without limitation the rights
9-
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10-
** of the Software, and to permit persons to whom the Software is furnished to do so,
11-
** subject to the following conditions:
12-
**
13-
** The above copyright notice including the dates of first publication and either this
14-
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15-
** included in all copies or substantial portions of the Software.
16-
**
17-
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18-
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19-
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20-
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
** OR OTHER DEALINGS IN THE SOFTWARE.
23-
**
24-
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25-
** be used in advertising or otherwise to promote the sale, use or other dealings in
26-
** this Software without prior written authorization from Silicon Graphics, Inc.
1+
/*
2+
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3+
** Copyright (C) 2011 Silicon Graphics, Inc.
4+
** All Rights Reserved.
5+
**
6+
** Permission is hereby granted, free of charge, to any person obtaining a copy
7+
** of this software and associated documentation files (the "Software"), to deal
8+
** in the Software without restriction, including without limitation the rights
9+
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
** of the Software, and to permit persons to whom the Software is furnished to do so,
11+
** subject to the following conditions:
12+
**
13+
** The above copyright notice including the dates of first publication and either this
14+
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15+
** included in all copies or substantial portions of the Software.
16+
**
17+
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18+
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19+
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20+
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22+
** OR OTHER DEALINGS IN THE SOFTWARE.
23+
**
24+
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25+
** be used in advertising or otherwise to promote the sale, use or other dealings in
26+
** this Software without prior written authorization from Silicon Graphics, Inc.
2727
*/
28-
/*
29-
** Original Author: Eric Veach, July 1994.
30-
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31-
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
28+
/*
29+
** Original Author: Eric Veach, July 1994.
30+
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31+
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
3232
*/
3333

3434
using System;

LibTessDotNet/Sources/MeshUtils.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static void Dot(ref Vec3 u, ref Vec3 v, out float dot)
7878
{
7979
dot = u.X * v.X + u.Y * v.Y + u.Z * v.Z;
8080
}
81+
8182
public static void Normalize(ref Vec3 v)
8283
{
8384
float len = v.X * v.X + v.Y * v.Y + v.Z * v.Z;
@@ -87,13 +88,19 @@ public static void Normalize(ref Vec3 v)
8788
v.Y *= len;
8889
v.Z *= len;
8990
}
91+
9092
public static int LongAxis(ref Vec3 v)
9193
{
9294
int i = 0;
9395
if (Math.Abs(v.Y) > Math.Abs(v.X)) i = 1;
9496
if (Math.Abs(v.Z) > Math.Abs(i == 0 ? v.X : v.Y)) i = 2;
9597
return i;
9698
}
99+
100+
public override string ToString()
101+
{
102+
return string.Format("{0}, {1}, {2}", X, Y, Z);
103+
}
97104
}
98105

99106
internal static class MeshUtils

LibTessDotNet/Sources/PriorityHeap.cs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/*
2-
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3-
** Copyright (C) 2011 Silicon Graphics, Inc.
4-
** All Rights Reserved.
5-
**
6-
** Permission is hereby granted, free of charge, to any person obtaining a copy
7-
** of this software and associated documentation files (the "Software"), to deal
8-
** in the Software without restriction, including without limitation the rights
9-
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10-
** of the Software, and to permit persons to whom the Software is furnished to do so,
11-
** subject to the following conditions:
12-
**
13-
** The above copyright notice including the dates of first publication and either this
14-
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15-
** included in all copies or substantial portions of the Software.
16-
**
17-
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18-
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19-
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20-
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
** OR OTHER DEALINGS IN THE SOFTWARE.
23-
**
24-
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25-
** be used in advertising or otherwise to promote the sale, use or other dealings in
26-
** this Software without prior written authorization from Silicon Graphics, Inc.
1+
/*
2+
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3+
** Copyright (C) 2011 Silicon Graphics, Inc.
4+
** All Rights Reserved.
5+
**
6+
** Permission is hereby granted, free of charge, to any person obtaining a copy
7+
** of this software and associated documentation files (the "Software"), to deal
8+
** in the Software without restriction, including without limitation the rights
9+
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
** of the Software, and to permit persons to whom the Software is furnished to do so,
11+
** subject to the following conditions:
12+
**
13+
** The above copyright notice including the dates of first publication and either this
14+
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15+
** included in all copies or substantial portions of the Software.
16+
**
17+
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18+
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19+
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20+
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22+
** OR OTHER DEALINGS IN THE SOFTWARE.
23+
**
24+
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25+
** be used in advertising or otherwise to promote the sale, use or other dealings in
26+
** this Software without prior written authorization from Silicon Graphics, Inc.
2727
*/
28-
/*
29-
** Original Author: Eric Veach, July 1994.
30-
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31-
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
28+
/*
29+
** Original Author: Eric Veach, July 1994.
30+
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31+
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
3232
*/
3333

3434
using System;

LibTessDotNet/Sources/PriorityQueue.cs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/*
2-
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3-
** Copyright (C) 2011 Silicon Graphics, Inc.
4-
** All Rights Reserved.
5-
**
6-
** Permission is hereby granted, free of charge, to any person obtaining a copy
7-
** of this software and associated documentation files (the "Software"), to deal
8-
** in the Software without restriction, including without limitation the rights
9-
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10-
** of the Software, and to permit persons to whom the Software is furnished to do so,
11-
** subject to the following conditions:
12-
**
13-
** The above copyright notice including the dates of first publication and either this
14-
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15-
** included in all copies or substantial portions of the Software.
16-
**
17-
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18-
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19-
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20-
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
** OR OTHER DEALINGS IN THE SOFTWARE.
23-
**
24-
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25-
** be used in advertising or otherwise to promote the sale, use or other dealings in
26-
** this Software without prior written authorization from Silicon Graphics, Inc.
1+
/*
2+
** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3+
** Copyright (C) 2011 Silicon Graphics, Inc.
4+
** All Rights Reserved.
5+
**
6+
** Permission is hereby granted, free of charge, to any person obtaining a copy
7+
** of this software and associated documentation files (the "Software"), to deal
8+
** in the Software without restriction, including without limitation the rights
9+
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
** of the Software, and to permit persons to whom the Software is furnished to do so,
11+
** subject to the following conditions:
12+
**
13+
** The above copyright notice including the dates of first publication and either this
14+
** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
15+
** included in all copies or substantial portions of the Software.
16+
**
17+
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18+
** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19+
** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
20+
** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22+
** OR OTHER DEALINGS IN THE SOFTWARE.
23+
**
24+
** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
25+
** be used in advertising or otherwise to promote the sale, use or other dealings in
26+
** this Software without prior written authorization from Silicon Graphics, Inc.
2727
*/
28-
/*
29-
** Original Author: Eric Veach, July 1994.
30-
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31-
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
28+
/*
29+
** Original Author: Eric Veach, July 1994.
30+
** libtess2: Mikko Mononen, http://code.google.com/p/libtess2/.
31+
** LibTessDotNet: Remi Gillig, https://github.com/speps/LibTessDotNet
3232
*/
3333

3434
using System;
@@ -76,7 +76,7 @@ static void Swap(ref int a, ref int b)
7676
public void Init()
7777
{
7878
var stack = new Stack<StackItem>();
79-
int p, r, i, j, piv;
79+
int p, r, i, j, piv;
8080
uint seed = 2016473283;
8181

8282
p = 0;

0 commit comments

Comments
 (0)