// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Measure a circular arc from three touches // Not compiled or tested in-world // Setup: Put in the root of a spare owned object/linkset. Child touch handlers may consume events. Touch three separated points around a circular edge. Collect 3 owner touches; the next touch starts another measurement. // Stop / restore: Reset clears collected points; disable/remove to stop. No geometry is changed. // Notes: The three points define a circle in3D. Near-collinear clicks make the radius unstable. 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)>=3)points=[]; points+=[llDetectedTouchPos(0)]; integer collected=llGetListLength(points); if(collected<3) { llOwnerSay("Recorded point "+(string)collected+" of 3."); return; } vector a=llList2Vector(points,0); vector b=llList2Vector(points,1); vector c=llList2Vector(points,2); vector d=llList2Vector(points,3); float ab=llVecDist(a,b); float bc=llVecDist(b,c); float ca=llVecDist(c,a); float twiceArea=llVecMag((b-a)%(c-a)); if(twiceArea<0.000001) { llOwnerSay("Points are nearly collinear."); return; } llOwnerSay("Fitted radius="+(string)(ab*bc*ca/(2.0*twiceArea))); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }