// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Trim a corner with a chamfer // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set three vertices and a positive setback smaller than both adjacent runs. Touch to print the plan privately. // Stop / restore: Remove/disable; calculations do not alter objects. // Notes: The setback is measured along each adjoining segment. No actual mesh is edited. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Calculation only. vector A=<0.0,0.0,0.0>; vector B=<5.0,0.0,0.0>; vector C=<5.0,4.0,0.0>; float SETBACK=0.8; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; float first=llVecDist(A,B); float second=llVecDist(B,C); if(SETBACK<=0.0||SETBACK>=first||SETBACK>=second) { llOwnerSay("Setback does not fit adjacent runs."); return; } vector p=B+llVecNorm(A-B)*SETBACK; vector q=B+llVecNorm(C-B)*SETBACK; llOwnerSay("Cut endpoints="+(string)p+" and "+(string)q+"; chamfer length="+(string)llVecDist(p,q)); } }