Skip to content

Commit 3772364

Browse files
mrdoobclaude
andcommitted
Examples: Expand vertex normals update to include neighbors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 89e3714 commit 3772364

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

examples/jsm/sculpt/Sculpt.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ class Sculpt {
287287
}
288288

289289
const result = new Uint32Array( iVertsInRadius.subarray( 0, acc ) );
290-
sm.updateTopology( iFaces, iVerts );
291-
sm._updateGeometry( iFaces, iVerts );
290+
const iVertsExpanded = sm.getVerticesFromFaces( iFaces );
291+
sm.updateTopology( iFaces, iVertsExpanded );
292+
sm._updateGeometry( iFaces, iVertsExpanded );
292293
return result;
293294

294295
}
@@ -402,9 +403,10 @@ class Sculpt {
402403

403404
}
404405

405-
// Update geometry
406+
// Update geometry (expand verts to include neighbors for correct normals)
406407
const iFaces = sm.getFacesFromVertices( iVerts );
407-
sm._updateGeometry( iFaces, iVerts );
408+
const iVertsExpanded = sm.getVerticesFromFaces( iFaces );
409+
sm._updateGeometry( iFaces, iVertsExpanded );
408410

409411
}
410412

@@ -499,7 +501,8 @@ class Sculpt {
499501
const iVertsDyn = this._dynamicTopology( iVerts );
500502
toolDrag( sm, iVertsDyn, this._interPoint, this._rLocal2, this._dragDir );
501503
const iFaces = sm.getFacesFromVertices( iVertsDyn );
502-
sm._updateGeometry( iFaces, iVertsDyn );
504+
const iVertsExpanded = sm.getVerticesFromFaces( iFaces );
505+
sm._updateGeometry( iFaces, iVertsExpanded );
503506

504507
}
505508

0 commit comments

Comments
 (0)