// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Measure a five-point traced feature // Not compiled or tested in-world // Setup: Put in the root of a spare owned object/linkset. Child touch handlers may consume events. Touch five ordered points along the feature. Collect 5 owner touches; the next touch starts another measurement. // Stop / restore: Reset clears collected points; disable/remove to stop. No geometry is changed. // Notes: Straight segment sums underestimate curved paths. Touches are not automatically captured during a drag. Results use actual touch positions in region coordinates, not hidden mesh dimensions. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Live touch measurements only. list points; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(llDetectedTouchFace(0)<0) { llOwnerSay("Touch position unavailable."); return; } if(llGetListLength(points)>=5)points=[]; points+=[llDetectedTouchPos(0)]; integer collected=llGetListLength(points); if(collected<5) { llOwnerSay("Recorded point "+(string)collected+" of 5."); return; } vector a=llList2Vector(points,0); vector b=llList2Vector(points,1); vector c=llList2Vector(points,2); vector d=llList2Vector(points,3); float length; integer i; for(i=1;i<5;++i)length+=llVecDist(llList2Vector(points,i-1),llList2Vector(points,i)); float direct=llVecDist(a,llList2Vector(points,4)); llOwnerSay("Traced length="+(string)length+" endpoint distance="+(string)direct); if(length>0.000001)llOwnerSay("Directness="+(string)(direct/length)); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }