Skip to content

Commit 12c3d3e

Browse files
mrdoobclaude
andcommitted
Examples: Clamp smooth intensity in Sculpt addon.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 557b5c7 commit 12c3d3e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/jsm/sculpt/SculptTools.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ function smoothTangentVerts( mesh, iVerts, intensity ) {
818818
const i3 = i * 3;
819819
const smx = smoothVerts[ i3 ], smy = smoothVerts[ i3 + 1 ], smz = smoothVerts[ i3 + 2 ];
820820
const d = nx * ( smx - vx ) + ny * ( smy - vy ) + nz * ( smz - vz );
821-
const mI = intensity * mAr[ ind + 2 ];
821+
const mI = Math.min( intensity * mAr[ ind + 2 ], 1.0 );
822822
vAr[ ind ] = vx + ( smx - nx * d - vx ) * mI;
823823
vAr[ ind + 1 ] = vy + ( smy - ny * d - vy ) * mI;
824824
vAr[ ind + 2 ] = vz + ( smz - nz * d - vz ) * mI;
@@ -977,7 +977,7 @@ function toolSmooth( mesh, iVerts, intensity ) {
977977
const ind = iVerts[ i ] * 3;
978978
const vx = vAr[ ind ], vy = vAr[ ind + 1 ], vz = vAr[ ind + 2 ];
979979
const i3 = i * 3;
980-
const mI = intensity * mAr[ ind + 2 ];
980+
const mI = Math.min( intensity * mAr[ ind + 2 ], 1.0 );
981981
const intComp = 1.0 - mI;
982982
vAr[ ind ] = vx * intComp + smoothVerts[ i3 ] * mI;
983983
vAr[ ind + 1 ] = vy * intComp + smoothVerts[ i3 + 1 ] * mI;

0 commit comments

Comments
 (0)