-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4e641a
commit 83605ae
Showing
5 changed files
with
37 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// EuclidMesh.swift | ||
// Example | ||
// | ||
// Created by Nick Lockwood on 20/09/2023. | ||
// Copyright © 2023 Nick Lockwood. All rights reserved. | ||
// | ||
|
||
import Euclid | ||
import UIKit | ||
|
||
let euclidMesh: Mesh = { | ||
let start = CFAbsoluteTimeGetCurrent() | ||
|
||
// create some geometry using Euclid | ||
let cube = Mesh.cube(size: 0.8, material: UIColor.red) | ||
let sphere = Mesh.sphere(slices: 120, material: CGImage.checkerboard()) | ||
let mesh = cube.subtracting(sphere).makeWatertight() | ||
|
||
print("Time:", CFAbsoluteTimeGetCurrent() - start) | ||
print("Polygons:", mesh.polygons.count) | ||
print("Triangles:", mesh.triangulate().polygons.count) | ||
print("Watertight:", mesh.isWatertight) | ||
|
||
return mesh | ||
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters