Skip to content

Commit 4e5560d

Browse files
committed
Update Euclid to 0.7.1
1 parent 3754b87 commit 4e5560d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+982
-429
lines changed

Euclid/CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Change Log
22

3+
## [0.7.1](https://github.com/nicklockwood/Euclid/releases/tag/0.7.1) (2023-09-27)
4+
5+
- Added `Mesh.cubeMapped()` method
6+
- Removed stray `print()` statement
7+
8+
## [0.7.0](https://github.com/nicklockwood/Euclid/releases/tag/0.7.0) (2023-09-23)
9+
10+
- Added `Mesh.icosahedron()` primitive
11+
- Added `Bounded` protocol for types that have a `bounds` property
12+
- Added `Mesh.sphereMapped()` and `Mesh.cylinderMapped()` methods
13+
- Added `Mesh.withTextureTransform()` method
14+
- Added `CGImage.checkerboard()` convenience method for testing textures
15+
- Added `WrapMode.none` option for creating meshes without texture coordinates
16+
- Added `Mesh.withMaterial()` method
17+
- Texture material coordinates now wrap by default
18+
- Texture materials now use nearest-neighbor upscaling by default
19+
- Added `stacks` parameter to cone primitive
20+
- Added `wrapMode` parameter to cube primitive
21+
- Removed minimum height for cone and cylinder primitives
22+
- Materials now use `NSSecureCoding` for serialization
23+
- Raised minimum supported macOS version to 10.14
24+
- Raised minimum supported iOS version to 11
25+
- Renamed various methods for consistency
26+
- Moved docs to main branch
27+
328
## [0.6.18](https://github.com/nicklockwood/Euclid/releases/tag/0.6.18) (2023-09-22)
429

530
- Fixed crash on iOS 16 when building with Xcode 15

Euclid/Euclid.docc/ConstructingMeshes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Euclid offers a number of helper methods to quickly create complex geometry.
1313
The simplest way to create a ``Mesh`` is to start with an existing primitive, such as a cube or sphere.
1414
The following primitive types are available in Euclid, and are defined as static constructor methods on ``Mesh``:
1515

16-
- ``Mesh/cube(center:size:faces:material:)-imdm`` - A cubic ``Mesh`` (or cuboid, if you specify different values for the width, height and/or depth).
16+
- ``Mesh/cube(center:size:faces:wrapMode:material:)-8t5q8`` - A cubic ``Mesh`` (or cuboid, if you specify different values for the width, height and/or depth).
1717
- ``Mesh/sphere(radius:slices:stacks:poleDetail:faces:wrapMode:material:)`` - A spherical `Mesh`.
1818
- ``Mesh/cylinder(radius:height:slices:poleDetail:faces:wrapMode:material:)`` - A cylindrical `Mesh`.
19-
- ``Mesh/cone(radius:height:slices:poleDetail:addDetailAtBottomPole:faces:wrapMode:material:)`` - A conical ``Mesh``.
19+
- ``Mesh/cone(radius:height:slices:stacks:poleDetail:addDetailAtBottomPole:faces:wrapMode:material:)`` - A conical ``Mesh``.
2020

2121
All `Mesh` instances are made of flat polygons.
2222
Since true curves cannot be represented using straight edges, the `sphere`, `cylinder` and `cone` primitives are approximations.
@@ -77,10 +77,10 @@ CSG is another powerful tool for creating intricate geometry.
7777
CSG allows you to perform boolean operations (logical AND, OR, etc.) on solid shapes.
7878
The following CSG operations are defined as methods on the ``Mesh`` type:
7979

80-
- ``Mesh/subtract(_:isCancelled:)`` - Subtracts the volume of one `Mesh` from another.
81-
- ``Mesh/xor(_:isCancelled:)-swift.type.method`` - Produces a shape representing the non-overlapping parts of the input `Mesh`es (this is useful for rendering text glyphs).
80+
- ``Mesh/subtracting(_:isCancelled:)`` - Subtracts the volume of one `Mesh` from another.
81+
- ``Mesh/symmetricDifference(_:isCancelled:)-swift.type.method`` - Produces a shape representing the non-overlapping parts of the input `Mesh`es (this is useful for rendering text glyphs).
8282
- ``Mesh/union(_:isCancelled:)-swift.method`` - Combines two intersecting `Mesh`es, removing internal faces and leaving only the outer shell around both shapes (logical OR).
83-
- ``Mesh/intersection(_:isCancelled:)`` - Returns a single ``Mesh`` representing the common volume of two intersecting ``Mesh``es (logical AND).
83+
- ``Mesh/intersection(_:isCancelled:)-swift.method`` - Returns a single ``Mesh`` representing the common volume of two intersecting ``Mesh``es (logical AND).
8484
- ``Mesh/stencil(_:isCancelled:)-swift.method`` - This effectively "paints" part of one ``Mesh`` with the material from another.
8585

8686
All CSG operations require ``Mesh``es that are "watertight", that is they have no holes in their surface.
@@ -95,4 +95,4 @@ The ``Path/text(_:width:detail:)`` method produces an array of 2D ``Path`` that
9595
Alternatively, the ``Mesh/text(_:font:width:depth:detail:material:)`` constructor directly produces an extruded 3D text model from a `String` or `AttributedString`.
9696

9797
Each glyph in the input string maps to a single ``Path`` in the result, but these ``Path``s may contain nested subpaths.
98-
Glyphs formed from multiple subpaths will be filled using the even-odd rule (equivalent to an `xor` between the individually filled or extruded subpaths).
98+
Glyphs formed from multiple subpaths will be filled using the even-odd rule (equivalent to using `symmetricDifference` with the individually filled or extruded subpaths).

Euclid/Euclid.docc/Extensions/Angle.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424

2525
### Computing Angles
2626

27-
- ``Angle/-(_:)``
28-
- ``Angle/-(_:_:)``
29-
- ``Angle/*(_:_:)-2ew65``
30-
- ``Angle/*(_:_:)-8l78z``
31-
- ``Angle//(_:_:)``
32-
- ``Angle/+(_:_:)``
3327
- ``Angle/acos(_:)``
3428
- ``Angle/asin(_:)``
3529
- ``Angle/atan(_:)``
3630
- ``Angle/atan2(y:x:)``
3731

38-
### Mutating Angles
32+
### Operators
3933

34+
- ``Angle/+(_:_:)``
4035
- ``Angle/+=(_:_:)``
36+
- ``Angle/-(_:)``
37+
- ``Angle/-(_:_:)``
4138
- ``Angle/-=(_:_:)``
39+
- ``Angle/*(_:_:)-2ew65``
40+
- ``Angle/*(_:_:)-8l78z``
4241
- ``Angle/*=(_:_:)``
42+
- ``Angle//(_:_:)``
4343
- ``Angle//=(_:_:)``

Euclid/Euclid.docc/Extensions/Bounds.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
### Creating Bounds
66

7-
- ``Bounds/init(_:_:)``
8-
- ``Bounds/init(_:)``
9-
- ``Bounds/init(bounds:)``
7+
- ``Bounds/init(_:)-1icmf``
8+
- ``Bounds/init(_:)-27jri``
109
- ``Bounds/init(min:max:)``
11-
- ``Bounds/init(points:)``
12-
- ``Bounds/init(polygons:)``
10+
- ``Bounds/init(_:_:)``
1311

1412
### Default Bounds
1513

Euclid/Euclid.docc/Extensions/LineSegment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
### Comparing Line Segments
1717

1818
- ``LineSegment/containsPoint(_:)``
19-
- ``LineSegment/intersection(with:)``
19+
- ``LineSegment/intersection(with:)-1tffl``
20+
- ``LineSegment/intersection(with:)-2u7vo``
2021
- ``LineSegment/intersects(_:)``
2122

2223
### Transforming Line Segments

Euclid/Euclid.docc/Extensions/Mesh.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
### Geometric Primitives
1010

11-
- ``Mesh/cone(radius:height:slices:poleDetail:addDetailAtBottomPole:faces:wrapMode:material:)``
12-
- ``Mesh/cube(center:size:faces:material:)-7wdr2``
13-
- ``Mesh/cube(center:size:faces:material:)-imdm``
11+
- ``Mesh/cone(radius:height:slices:stacks:poleDetail:addDetailAtBottomPole:faces:wrapMode:material:)``
12+
- ``Mesh/cube(center:size:faces:wrapMode:material:)-8t5q8``
13+
- ``Mesh/cube(center:size:faces:wrapMode:material:)-eado``
1414
- ``Mesh/cylinder(radius:height:slices:poleDetail:faces:wrapMode:material:)``
1515
- ``Mesh/sphere(radius:slices:stacks:poleDetail:faces:wrapMode:material:)``
16+
- ``Mesh/icosahedron(radius:faces:wrapMode:material:)``
1617

1718
- ``Mesh/WrapMode``
1819
- ``Mesh/Faces``
@@ -23,12 +24,12 @@
2324
- ``Mesh/convexHull(of:)-6c896``
2425
- ``Mesh/union(_:isCancelled:)-swift.method``
2526
- ``Mesh/union(_:isCancelled:)-swift.type.method``
26-
- ``Mesh/intersect(_:isCancelled:)``
27-
- ``Mesh/intersection(_:isCancelled:)``
28-
- ``Mesh/subtract(_:isCancelled:)``
27+
- ``Mesh/intersection(_:isCancelled:)-swift.method``
28+
- ``Mesh/intersection(_:isCancelled:)-swift.type.method``
29+
- ``Mesh/subtracting(_:isCancelled:)``
2930
- ``Mesh/difference(_:isCancelled:)``
30-
- ``Mesh/xor(_:isCancelled:)-swift.method``
31-
- ``Mesh/xor(_:isCancelled:)-swift.type.method``
31+
- ``Mesh/symmetricDifference(_:isCancelled:)-swift.method``
32+
- ``Mesh/symmetricDifference(_:isCancelled:)-swift.type.method``
3233
- ``Mesh/stencil(_:isCancelled:)-swift.method``
3334
- ``Mesh/stencil(_:isCancelled:)-swift.type.method``
3435

@@ -108,7 +109,12 @@
108109
### Updating Materials and Texture Coordinates
109110

110111
- ``Mesh/replacing(_:with:)``
112+
- ``Mesh/withMaterial(_:)``
111113
- ``Mesh/withoutTexcoords()``
114+
- ``Mesh/withTextureTransform(_:)``
115+
- ``Mesh/sphereMapped()``
116+
- ``Mesh/cylinderMapped()``
117+
- ``Mesh/cubeMapped()``
112118

113119
### Merging Meshes
114120

@@ -128,4 +134,4 @@
128134
- ``Mesh/detessellate()``
129135
- ``Mesh/detriangulate()``
130136
- ``Mesh/makeWatertight()``
131-
- ``Mesh/smoothNormals(_:)``
137+
- ``Mesh/smoothingNormals(forAnglesGreaterThan:)``

Euclid/Euclid.docc/Extensions/Path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@
4747
- ``Path/scaled(by:)-84xdd``
4848
- ``Path/translated(by:)``
4949
- ``Path/transformed(by:)``
50-
- ``Path/with(color:)``
50+
- ``Path/withColor(_:)``
5151
- ``Path/closed()``

Euclid/Euclid.docc/Extensions/PathPoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
- ``PathPoint/scaled(by:)-7e3o7``
3030
- ``PathPoint/translated(by:)``
3131
- ``PathPoint/transformed(by:)``
32-
- ``PathPoint/with(color:)``
32+
- ``PathPoint/withColor(_:)``
3333
- ``PathPoint/curved(_:)``

Euclid/Euclid.docc/Extensions/Polygon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
- ``Polygon/transformed(by:)``
3737
- ``Polygon/merge(_:ensureConvex:)``
3838
- ``Polygon/inverted()``
39-
- ``Polygon/with(material:)``
39+
- ``Polygon/withMaterial(_:)``
4040

4141
### Splitting Polygons
4242

Euclid/Euclid.docc/Extensions/Quaternion.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@
3131

3232
### Computing Quaternions
3333

34-
- ``Quaternion/-(_:_:)``
35-
- ``Quaternion/-(_:)``
36-
- ``Quaternion/*(_:_:)-2drke``
37-
- ``Quaternion/*(_:_:)-305tn``
38-
- ``Quaternion//(_:_:)``
39-
- ``Quaternion/+(_:_:)``
4034
- ``Quaternion/dot(_:)``
35+
- ``Quaternion/normalized()``
4136

4237
### Interpolating Quaternions
4338

4439
- ``Quaternion/slerp(_:_:)``
4540

46-
### Mutating Quaternions
41+
### Operators
4742

43+
- ``Quaternion/+(_:_:)``
44+
- ``Quaternion/+=(_:_:)``
45+
- ``Quaternion/-(_:_:)``
46+
- ``Quaternion/-(_:)``
4847
- ``Quaternion/-=(_:_:)``
48+
- ``Quaternion/*(_:_:)-2drke``
49+
- ``Quaternion/*(_:_:)-305tn``
4950
- ``Quaternion/*=(_:_:)-5ic2j``
5051
- ``Quaternion/*=(_:_:)-lsgo``
52+
- ``Quaternion//(_:_:)``
5153
- ``Quaternion//=(_:_:)``
52-
- ``Quaternion/+=(_:_:)``
53-
- ``Quaternion/normalized()``
5454

0 commit comments

Comments
 (0)