Skip to content

Commit d2660d0

Browse files
committed
WIP
1 parent 251d2f6 commit d2660d0

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

lib/solvers/GapFillSolver.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,17 @@ export class GapFillSolver extends BaseSolver {
216216
private stepFindNearbyEdges(): void {
217217
const primaryEdge = this.state.currentPrimaryEdge!
218218

219-
// Check one candidate edge per step
220-
if (this.state.nearbyEdgeCandidateIndex < this.state.edges.length) {
221-
const candidate = this.state.edges[this.state.nearbyEdgeCandidateIndex]!
222-
223-
// Check if this edge is nearby and parallel
219+
this.state.currentNearbyEdges = []
220+
for (const candidate of this.state.edges) {
224221
if (
225222
candidate !== primaryEdge &&
226223
this.isNearbyParallelEdge(primaryEdge, candidate)
227224
) {
228225
this.state.currentNearbyEdges.push(candidate)
226+
break
229227
}
230-
231-
this.state.nearbyEdgeCandidateIndex++
232-
} else {
233-
// Done finding nearby edges, move to checking unoccupied
234-
this.state.phase = "CHECK_UNOCCUPIED"
235228
}
229+
this.state.phase = "CHECK_UNOCCUPIED"
236230
}
237231

238232
private stepCheckUnoccupied(): void {
@@ -338,9 +332,7 @@ export class GapFillSolver extends BaseSolver {
338332

339333
private hasMinimumSize(candidate: Placed3D): boolean {
340334
const minSize = 0.01
341-
return (
342-
candidate.rect.width >= minSize && candidate.rect.height >= minSize
343-
)
335+
return candidate.rect.width >= minSize && candidate.rect.height >= minSize
344336
}
345337

346338
private expandPointToRect(point: ExpansionPoint): Placed3D | null {

0 commit comments

Comments
 (0)