Skip to content

Commit 151d16f

Browse files
committed
Update README
1 parent c71b8a9 commit 151d16f

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Add the package as a dependency in your Package.swift (or Xcode project). Becaus
1414
let package = Package(
1515
name: "manifold-swift-example",
1616
dependencies: [
17-
.package(url: "https://github.com/tomasf/manifold-swift.git", .upToNextMinor(from: "0.1.0"))
17+
.package(url: "https://github.com/tomasf/manifold-swift.git", .upToNextMinor(from: "0.2.0"))
1818
],
1919
targets: [
2020
.executableTarget(
@@ -28,21 +28,19 @@ let package = Package(
2828

2929
## Example
3030

31-
The library uses protocols for vectors and matrices, so you can add conformance to your own types and send them in without conversion.
31+
The library uses protocols for vectors and matrices. The `Manifold` and `CrossSection` types are generic over V, so you can plug in your own vector type.
3232

33-
```swift
34-
import Manifold3D
3533

36-
struct V: Vector3 {
37-
let x: Double
38-
let y: Double
39-
let z: Double
34+
```swift
35+
struct MyVector: Vector3 {
36+
let x, y, z: Double
4037
}
4138

42-
let sphere = Manifold.sphere(radius: 10, segmentCount: 25)
43-
let box = Manifold.cube(size: V(x: 12, y: 20, z: 20))
44-
.rotate(V(x: 20, y: 25, z: 0))
45-
let difference = sphere.boolean(.difference, with: box)
39+
let box = Manifold.cube(size: MyVector(x: 12, y: 20, z: 20))
40+
.rotate(MyVector(x: 20, y: 25, z: 0))
41+
42+
let difference = Manifold.sphere(radius: 10, segmentCount: 25)
43+
.boolean(.difference, with: box)
4644

4745
let meshGL = difference.meshGL()
4846
// Render or save meshGL.vertices, meshGL.triangles, etc.

0 commit comments

Comments
 (0)