# Distribuir / Distribute · Better · 16 bits

## Español

En Modo Experto ejecuta /cli distribuir; en inglés, /cli distribute. Distribuir / Distribute abre Better · 16 bits. Selecciona un mueble en la escena o en la lista. Arrastra por el suelo o mueve ¼ de casilla con las flechas; Columna/Fila + Mover aplica un desplazamiento recto. Girar ↶/↷ aplica 90° sobre el origen del mueble. Escala permite 25–300% con −/+, un porcentaje y Enter; mantiene las proporciones de altura y suelo. Se valida la huella completa, el perímetro, otros muebles y el recorrido, incluido el espacio barrido durante el giro. Un intento bloqueado conserva la transformación anterior. El mapa de dureza muestra perímetro y huellas. Mover, girar y escalar se guardan en este navegador y admiten Deshacer (hasta 50 cambios mientras el editor siga abierto). Recargar conserva posición, giro y escala; reinicia Deshacer. Escape cancela un arrastre pendiente o cierra; Mayús + arrastre mueve la cámara. /distribuir off cierra. La simulación se pausa al editar y recupera su estado anterior al cerrar. Elementos montados y bloqueados, incluido el pilar de Starbucks, quedan fijos. El alias anterior /cli distribuit sigue funcionando. Sin herramienta MCP remota nueva. Bloquear/Desbloquear impide o permite mover, girar y escalar el objeto seleccionado. Eliminar retira sólo esa instancia; Deshacer la recupera si su posición sigue libre. Cargar desde PixerIA abre los 60 objetos recientes compatibles con vista previa; Añadir al espacio carga el GLB real en Better o una imagen ilustrada y busca un hueco libre para toda su huella. Un catálogo o archivo inaccesible no guarda una pieza nueva. Bloqueo, eliminación e importación se guardan con el inventario de este Xpacio y admiten Deshacer mientras el editor siga abierto. Recargar mantiene los cambios, pero reinicia Deshacer. La posición de los objetos montados sigue fija aunque se quite su bloqueo; el pilar estructural no se puede desbloquear ni eliminar. Good muestra la imagen del objeto de PixerIA cuando está disponible.

1. Abre [Cafebrería](https://www.xpaceos.com/admira-xp/?autostart=cafeteria&quality=better), [Xtanco](https://www.xpaceos.com/admira-xp/?autostart=xtanco&quality=better) o [Starbucks](https://www.xpaceos.com/admira-xp/?loc=alsea-sbux-021&quality=better).
2. En Experto escribe `/cli distribuir` y pulsa Enviar/Enter. Selecciona el mueble.
3. Arrastra, gira 90° con ↶/↷ o cambia Escala. El giro usa el origen del mueble: si falta espacio libre, mueve primero el mueble. La escala modifica por igual suelo y altura, conservando su proporción original.
4. Bloquear/Desbloquear protege una pieza. Eliminar la retira; Deshacer puede recuperarla. Cargar desde PixerIA → elige un objeto → Añadir al espacio. Los modelos 3D y las imágenes se comprueban antes de guardar. Cada cambio válido se guarda. Deshacer restaura movimiento, giro o escala. Si el espacio cambia durante el guardado, se rechaza; si falla el almacenamiento, se recupera la distribución anterior.
5. Pulsa × o `/distribuir off`. Si estabas jugando, se reanuda; si estabas en pausa, permanece en pausa.

### Comprobar paso

Distribuir incorpora Comprobar paso: en Cuerpo elige Persona o Unitree y pulsa Comprobar. Comprueba una ruta completa desde la entrada hasta la zona de acceso del mueble seleccionado, o el centro sin selección, con el mapa físico de Good, Better y Best y radios de 0,72 y 0,52 celdas respectivamente. La puerta se considera abierta virtualmente; la escena no cambia. Paso libre muestra la ruta y el volumen corporal; Paso bloqueado identifica los bloqueos implicados, sin prometer un conjunto mínimo. Seleccionar un mueble bloqueador lo selecciona para editar conservando el destino. Ver mapa de dureza muestra la superposición. La vista previa válida, mover, girar, escalar, guardar, bloquear, eliminar, añadir, Deshacer y cambios de geometría recalculan el diagnóstico; una vista previa inválida conserva la última pose válida. Cerrar limpia la comprobación. No mueve actores ni muebles, no abre la puerta real, no guarda ni activa People. Desde Good/Better/Best se abre el mismo editor Better mediante Mobiliario → Distribuir o /cli distribuir. Cafebrería sin portal operativo muestra que la entrada no está definida; no presenta un falso paso libre. Implementado A: este diagnóstico local. Pendientes B y C: Mostrar ITIL en escena e IoT piloto, además de la vinculación física IoT. Se conservan IDs, marca, historial CLI e inventario. No añade herramienta MCP remota.

Experto → Mobiliario → Distribuir → selecciona el destino, o usa el centro → Cuerpo: Persona/Unitree → Comprobar → Ver mapa de dureza → consulta Paso libre o Paso bloqueado → Seleccionar un bloqueador → edita si lo deseas → Deshacer recalcula el resultado.

[Guía y contrato](check-passage.md) · [Tutorial](https://www.xpaceos.com/help/#check-passage).

## English

In Expert mode run /cli distribute (Spanish: /cli distribuir). Distribute / Distribuir opens Better · 16 bits. Select furniture in the scene or list. Drag along the floor or move ¼ tile with arrow keys; Column/Row + Move applies a straight move. Rotate ↶/↷ turns 90° around the furniture origin. Scale accepts 25–300% using −/+, a percentage and Enter; it preserves height-to-floor proportions. The full footprint, room boundary, other furniture and path are checked, including the area swept during rotation. Blocked attempts retain the previous transform. The hardness map shows the perimeter and footprints. Move, rotate and scale save in this browser and support Undo (up to 50 changes while the editor is open). Reload retains position, rotation and scale but clears Undo history. Escape cancels a pending drag or closes; Shift + drag moves the camera. /distribute off closes. Simulation pauses during editing and restores its previous state on exit. Mounted and locked items, including the Starbucks pillar, remain fixed. The legacy /cli distribuit alias still works. No new remote MCP tool. Lock/Unlock prevents or allows moving, rotating and scaling the selected object. Delete removes only that instance; Undo restores it if its original position is still clear. Load from PixerIA opens the 60 recent compatible objects with previews; Add to space loads the actual GLB in Better or an illustrated image and finds free space for its full footprint. An unavailable catalog or asset does not save a new instance. Locks, deletions and imports save with this Xpace inventory and support Undo while the editor stays open. Reload keeps edits but resets Undo. Mounted objects remain fixed even when their user lock is removed; the structural pillar cannot be unlocked or deleted. Good shows the PixerIA object image when available.

1. Open Cafebrería, Xtanco or Starbucks using the stable links above.
2. In Expert type `/cli distribute` and press Send/Enter. Select the furniture.
3. Drag, rotate 90° with ↶/↷ or change Scale. Rotation uses the layout origin; move into a clear area first when needed. Scaling multiplies floor and height dimensions by the same factor, preserving the original proportions.
4. Lock/Unlock protects an instance. Delete removes it; Undo can restore it. Load from PixerIA → choose an object → Add to space. 3D models and images are checked before saving. Each valid change saves. Undo restores a move, rotation or scale. A changed venue or source transform rejects stale saves; storage failures roll back the layout.
5. Close with × or `/distribute off`. Running simulation resumes; paused simulation remains paused.

### Check passage

Distribute includes Check passage: under Body choose Person or Unitree and press Check. It checks a complete route from the entrance to the selected furniture access area, or the centre without selection, using the physical map of Good, Better and Best and radii of 0.72 and 0.52 tiles respectively. The door is virtually open; the scene is unchanged. Passage clear shows the route and body volume; Passage blocked identifies the implicated blockers, without promising a minimum set. Select chooses a furniture blocker for editing while retaining the destination. Show hardness map displays the overlay. Valid previews, move, rotate, scale, save, lock, delete, add, Undo and geometry changes recompute the diagnostic; an invalid preview retains the last valid pose. Closing clears the check. It does not move actors or furniture, open the actual door, save or enable People. Good/Better/Best open the same Better editor through Furniture → Distribute or /cli distribute. Cafebrería without an operational portal reports an undefined entrance; it never shows a false clear passage. Delivered A: this local diagnostic. Pending B and C: Show ITIL in scene and an IoT pilot, plus physical IoT binding. IDs, brand, CLI history and inventory are retained. No new remote MCP tool.

Expert → Furniture → Distribute → select the destination, or use the centre → Body: Person/Unitree → Check → Show hardness map → read Passage clear or Passage blocked → Select a blocker → edit if desired → Undo recomputes the result.

[Guide and contract](check-passage.md) · [Tutorial](https://www.xpaceos.com/help/#check-passage).

## Shared contract / Contrato compartido

- Browser-local virtual layout; no physical-device action or new remote MCP tool. MCP help: https://mcp.admira.store/help (topic distribuir or distribute).
- Stable inventory/layout IDs, current/backup/schema storage per Xpacio, existing removal tombstones. Legacy `distribuit` command and JSON contract ID are retained for compatibility; visible names are Distribuir/Distribute.
- Source: `window.__xtancoFurnitureEditor` in `admira-xp/index.html`. Private preview; revalidation of every path segment and all source pose fields before an atomic commit. Saves col, row, rot, sx, sy, locked and PixerIA source metadata. Object mutations atomically update current/backup/schema, removal/addition records and visibility. Invisible objects are preserved and their physical floor footprints remain obstacles. Undo only touches the selected ID, checks its current full data and ledger, and refuses an occupied restoration.
- Geometry: floor footprints include fp, horizontal sx, quarter-turn rot and flipX; sy changes height. Main walk grid and Better customer navigation respect those transforms. Rugs are walkable. Mounted/locked items cannot move, rotate or scale.
- Collision: full footprint inside room, no interior overlap with other solid footprints or fixed hardness. Edge contact is allowed. Translation uses a swept check; rotation checks analytical corner extrema and conservative subdivided intervals between its endpoints. It can reject a very close rotational clearance to remain safe. Legacy overlap can escape outward to a clear position.
- Scale range 0.25–3 (25–300%); height changes proportionally to the existing sx/sy ratio. Rotation steps 90° about the saved layout origin. Move/rotate/scale are separate gestures and can be undone in reverse order; at most 50 completed gestures/object edits while open.
- A blocked drag retains the last valid pose; release saves it. Escape/pointer cancellation discards the unfinished gesture. A blocked rotate/scale leaves the saved transform unchanged.
- Starbucks Better/Best groups and Good parts share the same origin, rotation, mirror and scales. Starbucks storage remains separate (`starbucks_pg103_v1`). Its scene is an interpretive reconstruction, not a metric floor plan.
- Translation reuses models; shape changes rebuild owned geometry without starting a second simulation. Closing/disposal releases editor inputs and restores the previous simulation state.
- Dependencies: WebGL, Pointer Events and writable localStorage.
- Delivered: local Person/Unitree Check passage diagnostic with virtual door opening, complete route/blockers and preview/Undo recomputation; selection, drag, quarter-tile moves, coordinate moves, rotation, proportional scale, lock/unlock, instance deletion, live PixerIA catalog import, collision/path checks, map, save, undo, close, ES/EN help.
- Pending: B Show ITIL in scene; C IoT pilot; one-step replacement, cross-browser/shared MCP editing and a measured 3D survey.

## Verification / Verificación

Tests cover intermediate rotation bounds and collisions, mirrored/scaled footprints, valid free rotation, percentage limits, floor grid parity, full-pose persistence, stale-save rejection, storage rollback, reverse undo and Starbucks Good/Better transform parity. Browser verification covers commands, rotation, scale, blocked collisions, undo and reload in Cafebrería. Tests only modify virtual layouts.

## PixerIA import contract / Contrato de importación

- Catalog: `https://api.admira.store/stock/list?type=furni&limit=60`; source authoring: https://pixeria.com. Items use stable `sourceAssetId`; each placed instance receives a new `pixeria_<UUID>` ID. The source asset is never deleted or altered.
- Compatible sources: GLB (`model/gltf-binary`) and PNG/JPEG/WebP/GIF from the PixerIA Stock asset endpoint. GLB meshes are decoded before insertion, fitted proportionally to the footprint and grounded. Better loads their geometry; Good uses their poster when available. This does not start a player or execute asset prompts.
- Footprint: declared `fp` (0.1–10 tiles per axis), or furniture `dimensionsCm` width/depth ÷ 100, otherwise 1×1 tiles. The editor fits geometry to this virtual footprint; no metric survey is claimed. Placement searches at ¼-tile intervals and rejects occupied/fixed floor or room overflow. Maximum 300 instances per Xpacio.
- Online catalog/asset load requires CORS and network availability. GLB fetch timeout: 30 seconds; asset limit: 25 MiB. Source URL, metadata, footprint and instance transform persist locally; GLB/poster bytes remain on PixerIA and require access on reload.
- Tests cover object locks, deletion tombstones surviving factory reload, guarded object undo, invisible furniture retention, catalog formats/URLs, placement and storage rollback. Browser verification uses a real PixerIA kentia model, reload, lock/delete/undo and ES/EN controls.
