@@ -54,8 +54,8 @@ final class GeometryTests: XCTestCase {
5454 children: [ cube, camera] ,
5555 sourceLocation: nil
5656 )
57- XCTAssert ( camera. bounds . transformed ( by : camera . transform ) . isEmpty)
58- XCTAssertEqual ( group. bounds , cube. bounds )
57+ XCTAssert ( camera. overestimatedBounds . isEmpty)
58+ XCTAssertEqual ( group. overestimatedBounds , cube. overestimatedBounds )
5959 }
6060
6161 func testLowDetailPrimitiveBounds( ) {
@@ -105,11 +105,9 @@ final class GeometryTests: XCTestCase {
105105 context. transform = . translation( offset)
106106 let shape = Geometry ( type: GeometryType . fill ( [ . square( ) ] ) , in: context)
107107 XCTAssertEqual ( shape. exactBounds ( with: shape. transform) . center, offset)
108- XCTAssertEqual ( shape. bounds. size, [ 1 , 1 , 0 ] )
109- XCTAssertEqual ( shape. bounds. center, [ 0 , 0 , 0 ] )
110- let exactBounds = shape. exactBounds ( with: shape. transform)
111- XCTAssertEqual ( exactBounds. size, shape. bounds. size)
112- XCTAssertEqual ( exactBounds. center, [ 1 , 2 , 3 ] )
108+ XCTAssertEqual ( shape. overestimatedBounds. size, [ 1 , 1 , 0 ] )
109+ XCTAssertEqual ( shape. overestimatedBounds. center, [ 1 , 2 , 3 ] )
110+ XCTAssertEqual ( shape. exactBounds ( with: shape. transform) , shape. overestimatedBounds)
113111 }
114112
115113 func testTransformedMultipleFilledPathBounds( ) {
@@ -120,11 +118,9 @@ final class GeometryTests: XCTestCase {
120118 . square( ) ,
121119 . circle( radius: 0.5 ) . translated ( by: [ 1 , 0 , 0 ] ) ,
122120 ] ) , in: context)
123- XCTAssertEqual ( shape. bounds. size, [ 2 , 1 , 0 ] )
124- XCTAssertEqual ( shape. bounds. center, [ 0.5 , 0 , 0 ] )
125- let exactBounds = shape. exactBounds ( with: shape. transform)
126- XCTAssertEqual ( exactBounds. size, shape. bounds. size)
127- XCTAssertEqual ( exactBounds. center, [ 1.5 , 2 , 3 ] )
121+ XCTAssertEqual ( shape. overestimatedBounds. size, [ 2 , 1 , 0 ] )
122+ XCTAssertEqual ( shape. overestimatedBounds. center, [ 1.5 , 2 , 3 ] )
123+ XCTAssertEqual ( shape. exactBounds ( with: shape. transform) , shape. overestimatedBounds)
128124 }
129125
130126 func testTransformedMultipleExtrudedPathBounds( ) {
@@ -135,11 +131,9 @@ final class GeometryTests: XCTestCase {
135131 . square( ) ,
136132 . circle( radius: 0.5 ) . translated ( by: [ 1 , 0 , 0 ] ) ,
137133 ] , . default) , in: context)
138- XCTAssertEqual ( shape. bounds. size, [ 2 , 1 , 1 ] )
139- XCTAssertEqual ( shape. bounds. center, [ 0.5 , 0 , 0 ] )
140- let exactBounds = shape. exactBounds ( with: shape. transform)
141- XCTAssertEqual ( exactBounds. size, shape. bounds. size)
142- XCTAssertEqual ( exactBounds. center, [ 1.5 , 2 , 3 ] )
134+ XCTAssertEqual ( shape. overestimatedBounds. size, [ 2 , 1 , 1 ] )
135+ XCTAssertEqual ( shape. overestimatedBounds. center, [ 1.5 , 2 , 3 ] )
136+ XCTAssertEqual ( shape. exactBounds ( with: shape. transform) , shape. overestimatedBounds)
143137 }
144138
145139 func testTransformedMultipleExtrudedPathBoundsWithTwist( ) {
@@ -154,11 +148,9 @@ final class GeometryTests: XCTestCase {
154148 twist: . halfPi,
155149 align: nil
156150 ) ) , in: context)
157- XCTAssertEqual ( shape. bounds. size, [ 2 , 2 , 1 ] )
158- XCTAssertEqual ( shape. bounds. center, [ 0.5 , - 0.5 , 0 ] )
159- let exactBounds = shape. exactBounds ( with: shape. transform)
160- XCTAssertEqual ( exactBounds. size, shape. bounds. size)
161- XCTAssertEqual ( exactBounds. center, [ 1.5 , 1.5 , 3 ] )
151+ XCTAssertEqual ( shape. overestimatedBounds. size, [ 2 , 2 , 1 ] )
152+ XCTAssertEqual ( shape. overestimatedBounds. center, [ 1.5 , 1.5 , 3 ] )
153+ XCTAssertEqual ( shape. exactBounds ( with: shape. transform) , shape. overestimatedBounds)
162154 }
163155
164156 func testTransformedMultipleLathedPathBounds( ) {
@@ -169,11 +161,9 @@ final class GeometryTests: XCTestCase {
169161 . square( ) ,
170162 . circle( radius: 0.5 ) . translated ( by: [ 0 , 1 , 0 ] ) ,
171163 ] , segments: 4 ) , in: context)
172- XCTAssertEqual ( shape. bounds. size, [ 1 , 2 , 1 ] )
173- XCTAssertEqual ( shape. bounds. center, [ 0 , 0.5 , 0 ] )
174- let exactBounds = shape. exactBounds ( with: shape. transform)
175- XCTAssertEqual ( exactBounds. size, shape. bounds. size)
176- XCTAssertEqual ( exactBounds. center, [ 1 , 2.5 , 3 ] )
164+ XCTAssertEqual ( shape. overestimatedBounds. size, [ 1 , 2 , 1 ] )
165+ XCTAssertEqual ( shape. overestimatedBounds. center, [ 1 , 2.5 , 3 ] )
166+ XCTAssertEqual ( shape. exactBounds ( with: shape. transform) , shape. overestimatedBounds)
177167 }
178168
179169 // MARK: Intersection
@@ -201,7 +191,7 @@ final class GeometryTests: XCTestCase {
201191 }
202192 }
203193 """ ) , delegate: nil )
204- XCTAssertEqual ( a. bounds , b. bounds )
194+ XCTAssertEqual ( a. overestimatedBounds , b. overestimatedBounds )
205195 XCTAssertEqual ( a. children. count, b. children. count)
206196 XCTAssertEqual ( a. children. map ( \. mesh) , b. children. map ( \. mesh) )
207197 XCTAssertEqual ( a. children. map {
0 commit comments