// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Sort a ring of points by bearing // Not compiled or tested in-world // Setup: Use a spare owned prim. Set POINTS around CENTER. Owner touch prints sample coordinates. // Stop / restore: Remove/disable. Nothing is rezzed or moved. // Notes: Angle sorting does not produce a valid polygon for every arbitrary point cloud; duplicate bearings and interior points need additional handling. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. list POINTS=[<0.0,3.0,0.0>,<-3.0,0.0,0.0>,<3.0,0.0,0.0>,<0.0,-3.0,0.0>]; vector CENTER=ZERO_VECTOR; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; list ordered; integer i; for(i=0;i