Skip to content

3D engine that AI agents drive

Merge remote-tracking branch 'origin/main' into 2531-mesh-surface-guards-wt

Nguyen Xuan Anf6d758524181
diff --cc src/mesh-polygons.js
index c64cea21,8c244f47..c37b1d87
--- a/src/mesh-polygons.js
+++ b/src/mesh-polygons.js
@@@ -23,10 -23,10 +23,11 @@@ export function facePolygons(mesh)
/**
* Build MeshData from polygons, dropping vertices that no polygon uses. Point attributes follow their vertex; an extra
- * vertex copies the values of `extraSources[index]` (a source vertex number) when that is given.
+ * vertex copies the values of `extraSources[index]` when that is given: a source vertex number, `{ from, to, t }` to blend
+ * two vertices, or `{ weights }` to blend several (see MeshBuilder.addVertex).
*/
export function buildPolygonMesh(mesh, polygons, extraPositions = [], extraSources = []) {
+ if (polygons.length === 0) throw new RangeError('The edit left no faces. Select fewer faces or edges.');
const used = new Set();
for (const polygon of polygons) {
for (const vertex of polygon.vertices) used.add(vertex);