import { buildGeometryTriangles } from "./buildGeometryTriangles"; import { marshalCoords } from "./marshalCoords"; import type { Vector3 as IVector3 } from "three/src/math/Vector3"; import type { Brush } from "./Brush.type"; import type { Vector3Simple } from "./Vector3Simple.type"; export function* buildGeometryPoints( brushes: ReadonlyArray, skipPlaceholders: boolean = true, discardOccluding: null | IVector3 = null ): Generator { const unique: Set = new Set(); for (let brushHalfSpaceTriangle of buildGeometryTriangles(brushes, skipPlaceholders, discardOccluding)) { for (let point of brushHalfSpaceTriangle.triangle) { const marshaled = marshalCoords(point.x, point.y, point.z); if (!unique.has(marshaled)) { unique.add(marshaled); yield point; } } } }