// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Plan an open belt between unequal pulleys // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set radii R1/R2 and center distance greater than their absolute difference. Touch for private results. // Stop / restore: Disable/remove; no scene properties change. // Notes: The formula models tangent straight segments plus contact arcs; pulleys must also avoid physical overlap for a practical arrangement. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. float R1=2.0; float R2=1.0; float DISTANCE=6.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(R1<=0.0||R2<=0.0||DISTANCE<=llFabs(R1-R2)) { llOwnerSay("Invalid pulley layout."); return; } float big=R1; float small=R2; if(small>big) { float temp=big; big=small; small=temp; } float angle=llAsin((big-small)/DISTANCE); float straight=llSqrt(DISTANCE*DISTANCE-(big-small)*(big-small)); float length=2.0*straight+PI*(big+small)+2.0*angle*(big-small); llOwnerSay("Belt length="+(string)length+" big wrap="+(string)((PI+2.0*angle)*RAD_TO_DEG)+" small wrap="+(string)((PI-2.0*angle)*RAD_TO_DEG)); } }