// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Prim section-slice preview // Not compiled or tested in-world // Setup: Use a nonphysical ordinary box, cylinder or prism. Owner-touch toggles its slice from startup to the lower half. // Stop / restore: Owner-touch again to restore the startup snapshot before removal or reset, unless setup describes a different cycle. Do not relink during a preview. // Notes: Use a spare modifiable build. Saved state lives only in script memory. Shape and collision geometry change; mesh objects do not use the same slicing behavior. Verify on a copy first. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; list saved; default { state_entry() { saved=llGetLinkPrimitiveParams(LINK_THIS,[PRIM_SLICE]); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetStatus(STATUS_PHYSICS))return; integer type=llList2Integer(llGetLinkPrimitiveParams(LINK_THIS,[PRIM_TYPE]),0); if(type!=PRIM_TYPE_BOX&&type!=PRIM_TYPE_CYLINDER&&type!=PRIM_TYPE_PRISM)return; preview=!preview; if(preview) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SLICE,<0.0,0.5,0.0>]); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_SLICE]+saved); } } }