* Pre-compute the three edge lengths of every triangle in `geometry`. * Returned Float64Array has 3 entries per triangle (no winding semantics).
(geometry)
| 219 | return total; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Predict the triangle count `subdivide(geometry, edge)` will produce, by |
| 224 | * simulating the per-triangle split pattern. Useful as a pre-flight check on |
| 225 | * the user's chosen refineLength. |
| 226 | * |
| 227 | * @param {THREE.BufferGeometry} geometry |
| 228 | * @param {number} edge Target maximum edge length, same units as positions. |
| 229 | * @returns {number} Predicted post-subdivision triangle count. |
| 230 | */ |
| 231 | export function estimateSubdivisionTriCount(geometry, edge) { |
| 232 | if (!geometry || !geometry.attributes || !geometry.attributes.position) return 0; |
| 233 | return simulateFromEdges(computeTriEdges(geometry), edge); |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * @param {object} args |
| 238 | * @param {THREE.BufferGeometry} args.geometry Current working geometry. |
no outgoing calls
no test coverage detected