Skip to content

Commit 424ee31

Browse files
committed
0.8.3
1 parent 7890f63 commit 424ee31

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

AddOns/Geometry_Clipper.cs renamed to AddOns/ClipperAddOns.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66
// 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.
77
//
8-
// #define ADDONS_ENABLED
9-
#if ADDONS_ENABLED
108
using System;
119
using System.Collections;
1210
using System.Collections.Generic;
@@ -16,7 +14,7 @@
1614
using ClipperLib;
1715

1816

19-
namespace EPPZ.Geometry
17+
namespace EPPZ.Geometry.AddOns
2018
{
2119

2220

@@ -25,7 +23,7 @@ namespace EPPZ.Geometry
2523
using Paths = List<List<IntPoint>>;
2624

2725

28-
public static class Geometry_Clipper
26+
public static class ClipperAddOns
2927
{
3028

3129

@@ -101,4 +99,3 @@ public static Vector2[] PointsFromClipperPath(Path path, float scale)
10199

102100
}
103101
}
104-
#endif

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# eppz! `Geometry`
22

3+
* 0.8.3
4+
5+
+ Added `ClipperAddOns`
6+
37
* 0.8.2
48

59
+ `PolygonSource`

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ For clipping, offsetting, triangulating the library use these brilliant third pa
8383

8484
+ Triangle.NET generates 2D (constrained) Delaunay triangulations and high-quality meshes of point sets or planar straight line graphs. It is a C# port by Christian Woltering of Jonathan Shewchuk's Triangle software. See standalone project repository [Triangle.NET](https://github.com/eppz/Triangle.NET) for details.
8585

86+
## Add-ons
87+
88+
* [`ClipperAddOns`](AddOns/ClipperAddOns.cs)
89+
+ Mainly `Polygon` extensions for easy conversion between **eppz! Geometry** and [Clipper](https://github.com/eppz/Clipper). It has a method to convert from generic `Vector2[]` array. **[Clipper](https://github.com/eppz/Clipper) works with integers**. So conversion involves a scale up (and a scale down), thus you'll need to pass a scale value to Clipper. (`Polygon` internals use `10e+5f`).
90+
+ `Polygon PolygonFromClipperPaths(Paths paths, float scale)`
91+
+ `Polygon PolygonFromClipperPath(Path path, float scale)`
92+
+ `Paths ClipperPaths(this Polygon this_, float scale)`
93+
+ `Path ClipperPath(this Polygon this_, float scale)`
94+
+ `Vector2[] PointsFromClipperPath(Path path, float scale)`
95+
8696
## License
8797

8898
> Licensed under the [**MIT License**](https://en.wikipedia.org/wiki/MIT_License).

0 commit comments

Comments
 (0)