<p dir="auto">I was doing some buffer geo flippin' yesterday when I came across this nice utility function:<br>
<a href="https://stackoverflow.com/questions/16824650/#answer-54496265" rel="nofollow">https://stackoverflow.com/questions/16824650/#answer-54496265</a></p>
<p dir="auto">Wouldn't this be handy to have in BufferGeometryUtils? Or is there a more convenient way to flip BufferGeometries?</p>
<h5 dir="auto">Description of the problem</h5>
<p dir="auto">I am trying to flip a mesh (mirror operation). For doing so if if "scale negatively" its geometry the faces are inside-outside and the mesh does not render properly.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const geom = new THREE.BoxGeometry(10,10,10);
geom.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));"><pre class="notranslate"><code class="notranslate">const geom = new THREE.BoxGeometry(10,10,10);
geom.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));
</code></pre></div>
<p dir="auto">Instead, if I apply it directly to the mesh it works just fine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="this.mesh.scale.set(-1,1,1); "><pre class="notranslate"><code class="notranslate">this.mesh.scale.set(-1,1,1); 
</code></pre></div>
<p dir="auto">Unfortunatelly I need to apply it to the geometry</p>
<p dir="auto">You can check the project using this at <a href="https://beta.bitbloq.cc/app/playground/3d" rel="nofollow">https://beta.bitbloq.cc/app/playground/3d</a></p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r0.107.0</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>