// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Miter extension at a path corner // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set bend angle0..170 degrees and positive half-width. Touch to print the plan privately. // Stop / restore: Remove/disable; calculations do not alter objects. // Notes: Sharp bends create long miters; the example reports a miter-limit ratio before actual construction. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Calculation only. float BEND=70.0; float HALF_WIDTH=0.8; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(BEND<0.0||BEND>=170.0||HALF_WIDTH<=0.0) { llOwnerSay("Invalid angle/width."); return; } float length=HALF_WIDTH/llCos(BEND*DEG_TO_RAD*0.5); llOwnerSay("Miter length="+(string)length+" ratio="+(string)(length/HALF_WIDTH)+" outer extension="+(string)(HALF_WIDTH*llTan(BEND*DEG_TO_RAD*0.5))); } }