// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Estimate summed component boxes versus envelope // Not compiled or tested in-world // Setup: Put in a spare owned prim or linkset root. Touch the face or component to inspect. Child scripts may consume touches; face-based tools require a viewer that supplies touched-face data. // Stop / restore: Remove/disable. Inspectors read state and report only to the owner; they do not change the build. // Notes: Bounding boxes can overlap and meshes can be hollow; this is a layout density indicator, not actual solid volume or land impact. At most64 prims. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Owner-only live inspection. default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer link=llDetectedLinkNumber(0); if(link==0)link=LINK_THIS; integer face=llDetectedTouchFace(0); integer count=llGetObjectPrimCount(llGetKey()); if(count<1||count>64) { llOwnerSay("Use a rezzed build with1..64 prims."); return; } float sum; integer i; for(i=1;i<=count;++i) { vector size=llList2Vector(llGetLinkPrimitiveParams(i,[PRIM_SIZE]),0); sum+=size.x*size.y*size.z; } list bounds=llGetBoundingBox(llGetKey()); vector size=llList2Vector(bounds,1)-llList2Vector(bounds,0); float envelope=size.x*size.y*size.z; llOwnerSay("Summed component boxes="+(string)sum+" envelope="+(string)envelope); if(envelope>0.0)llOwnerSay("Box ratio="+(string)(sum/envelope)); } }