静态clipVertex position array (x, y pairs)
Index array (groups of 3 for each triangle)
UV coordinate array (u, v pairs)
Clipping range [minU, minV, width, height]
Vertex color array (r, g, b, a groups of 4)
Whether to reuse internal buffers (default: true). When true, returns views of reusable buffers for better performance. When false, returns newly created arrays.
Clipped data {vertices, indices, uvs, colors}
CPU-side UV vertex clipping. Clips triangles based on UV range and outputs clipped vertices, indices, UVs, and color data.
When reuseBuffer=true (default): The returned TypedArrays are views of reusable internal buffers. The data is only valid until the next call to this method. If you need to persist the data, either set reuseBuffer=false or copy it yourself (e.g., new Float32Array(result.vertices)). Using reuseBuffer=true reduces GC pressure in high-frequency rendering loops.
En
UV-based triangle clipping utilities for 2D rendering
Zh
用于2D渲染的UV三角形裁剪工具类