К основному содержанию
скилл CX Codex

pixijs-scene-mesh — скилл для Claude Code: что делает и как установить

Помогает настраивать кастомную 2D-геометрию в PixiJS v8 через Mesh, MeshPlane, MeshRope и PerspectiveMesh. Пригодится при анимации вершин, деформации текстур и рисовании путей.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code
Открыть на GitHub

Что делает pixijs-scene-mesh

Скилл обучает ассистента сборке геометрии в PixiJS v8. Он разбирает базовый класс Mesh с объектом MeshGeometry, а также четыре готовых подкласса: MeshSimple для покадровой смены координат, MeshPlane для деформаций сетки, MeshRope для рисования текстуры вдоль ломаной линии и PerspectiveMesh для 2.5D-плоскостей.

В восьмой версии библиотеки конструкторы принимают единый объект настроек вместо позиционных аргументов. Меши работают как конечные узлы сцены со свойством allowChildren = false. Вкладывать объекты друг в друга нельзя, поэтому для группировки требуется обычный Container.

Батчинг вызовов отрисовки срабатывает только при выполнении условий: геометрия на базе MeshGeometry, отсутствие кастомных шейдеров или флагов глубины, а также не более 100 вершин при batchMode = 'auto'.

Какие задачи решает

  • построить сетку с кастомными вершинами через MeshGeometry
  • деформировать текстуру прямоугольника с помощью MeshPlane
  • растянуть или замостить текстуру вдоль линии через MeshRope
  • сымитировать 2.5D-наклон плоскости с PerspectiveMesh
  • анимировать вершины каждого кадра через MeshSimple

Примеры запросов агенту

  • Создай MeshRope по массиву точек с растягиванием текстуры
  • Настрой PerspectiveMesh для наклона 2D-карточки в PixiJS v8
  • Собери MeshGeometry с индексами и топологией triangle-strip

Как установить pixijs-scene-mesh

1Через Skills CLI (Vercel)

npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code

2Вручную: положить файлы

~/.claude/skills/pixijs-scene-mesh/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/pixijs-scene-mesh/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о pixijs-scene-mesh

Как установить pixijs-scene-mesh в Claude Code?

Выполните команду npx skills add pixijs/pixijs-skills --skill pixijs-scene-mesh -a claude-code.

Что делает pixijs-scene-mesh?

Скилл даёт правила работы с мешами в PixiJS v8, описывая базовый Mesh и специализированные классы вроде MeshPlane или MeshRope. Он предотвращает частые ошибки обновления API при миграции с более ранних версий.

Можно ли добавлять дочерние элементы в Mesh?

Нет, меши в PixiJS v8 являются конечными узлами дерева сцены и имеют флаг allowChildren = false. Если нужно сгруппировать несколько мешей, поместите их в обычный Container.

Исходный текст

SKILL.md · MIT
---
name: pixijs-scene-mesh
description: "Use this skill when rendering custom geometry in PixiJS v8. Covers Mesh with MeshGeometry (positions, uvs, indices, topology), MeshSimple for per-frame vertex animation, MeshPlane for subdivided deformation, MeshRope for path-following textures, PerspectiveMesh for 2.5D corners. Triggers on: Mesh, MeshGeometry, MeshSimple, MeshPlane, MeshRope, PerspectiveMesh, positions, uvs, indices, topology, setCorners, constructor options, MeshOptions, MeshPlaneOptions, MeshRopeOptions, SimpleMeshOptions, PerspectivePlaneOptions."
license: MIT
---

Meshes render arbitrary 2D (or perspective-projected) geometry with a texture or custom shader. PixiJS ships the base `Mesh` class plus four specialized subclasses for common shapes: `MeshSimple`, `MeshPlane`, `MeshRope`, and `PerspectiveMesh`. Pick the subclass that matches your shape; drop to the base `Mesh` when you need full vertex-level control or a custom shader.

Assumes familiarity with `pixijs-scene-core-concepts`. Meshes are leaf nodes; they cannot have children. Wrap multiple meshes in a `Container` to group them.

## Quick Start

```ts
const texture = await Assets.load("pattern.png");

const geometry = new MeshGeometry({
  positions: new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]),
  uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  indices: new Uint32Array([0, 1, 2, 0, 2, 3]),
  topology: "triangle-list",
});

const mesh = new Mesh({
  geometry,
  texture,
  roundPixels: false,
});
app.stage.addChild(mesh);
```

Every `Mesh` subclass takes a single options object. The base `Mesh` requires a `geometry`; subclasses (`MeshSimple`, `MeshPlane`, `MeshRope`, `PerspectiveMesh`) build the geometry internally and require a `texture` instead. See each variant's reference for the full field list.

## Variants

| Variant           | Use when                                              | Trade-offs                                              | Reference                                                        |
| ----------------- | ----------------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- |
| `Mesh`            | Full control, custom geometry, custom shaders         | You build the `MeshGeometry` yourself                   | [references/mesh.md](references/mesh.md)                         |
| `MeshSimple`      | Quick textured shapes with per-frame vertex animation | Thin wrapper; auto-updates the vertex buffer            | [references/mesh-simple.md](references/mesh-simple.md)           |
| `MeshPlane`       | Subdivided textured rectangle for distortion effects  | Fixed topology; `verticesX`/`verticesY` control density | [references/mesh-plane.md](references/mesh-plane.md)             |
| `MeshRope`        | Texture following a polyline path                     | Bent at each point; needs many points for smooth curves | [references/mesh-rope.md](references/mesh-rope.md)               |
| `PerspectiveMesh` | 2D plane with perspective corners                     | Not true 3D; UV-level perspective correction only       | [references/mesh-perspective.md](references/mesh-perspective.md) |

## When to use what

- **"I need a textured quad"** → `Sprite` (see `pixijs-scene-sprite`), not a mesh. Meshes are for cases Sprite can't express.
- **"I need to deform a textured rectangle"** → `MeshPlane`. Set `verticesX`/`verticesY` for the desired smoothness.
- **"I need a rope or trail that follows points"** → `MeshRope`. Control thickness with `width`; use `textureScale: 0` to stretch or `> 0` to repeat.
- **"I need a tilted 2D card or floor"** → `PerspectiveMesh`. Pass four corner positions; not real 3D but good enough for 2.5D effects.
- **"I need per-frame animated vertices with a simple shape"** → `MeshSimple`. It handles the buffer-update dance for you.
- **"I need a custom shader or unusual geometry"** → Base `Mesh` with a hand-built `MeshGeometry`. See `pixijs-custom-rendering` for shader authoring.
- **"I need true 3D rendering"** → Use a dedicated 3D library. `PerspectiveMesh` simulates perspective at the UV level but has no depth buffer.

## Quick concepts

### MeshGeometry owns the vertex data

`MeshGeometry` holds the `positions`, `uvs`, `indices`, and `topology`. You can share one geometry across multiple `Mesh` instances; positions are reference-counted.

### Batching

A mesh batches (combines with other draw calls) only if it uses `MeshGeometry`, has no custom shader, no depth or culling state, and the `'auto'` rule (`batchMode = 'auto'` and ≤100 vertices). Custom shaders always render independently.

### Topology is on the geometry, not the mesh

`new MeshGeometry({ topology: 'triangle-strip' })`; topology is a geometry property. The default is `'triangle-list'`; set it explicitly if your data is organized differently.

### Extra knobs

- `new MeshGeometry({ shrinkBuffersToFit: true })` — trims GPU buffer storage to the actual vertex count on creation. Use it when feeding large, one-shot geometries.
- `Mesh.containsPoint(point)` — topology-aware hit test that walks the triangles. Works with any `MeshGeometry`, including custom layouts.
- `new Mesh({ geometry, state })` — pass a `State` object to control blend, depth, and culling. Batching is disabled automatically if depth or culling flags are set. Defaults to `State.for2d()` when omitted.

## Common Mistakes

### [HIGH] Using old `SimpleMesh` / `SimplePlane` / `SimpleRope` names

Wrong:

```ts
import { SimpleRope } from "pixi.js";
const rope = new SimpleRope(texture, points);
```

Correct:

```ts
import { MeshRope } from "pixi.js";
const rope = new MeshRope({ texture, points });
```

Renamed in v8: `SimpleMesh` → `MeshSimple`, `SimplePlane` → `MeshPlane`, `SimpleRope` → `MeshRope`. All switched to options-object constructors.


### [HIGH] Positional constructor args for `MeshGeometry`

Wrong:

```ts
const geom = new MeshGeometry(vertices, uvs, indices);
```

Correct:

```ts
const geom = new MeshGeometry({
  positions: vertices,
  uvs,
  indices,
  topology: "triangle-list",
});
```

v8 uses an options object. Note the property is `positions`, not `vertices`; the `vertices` name is only used by `MeshSimple`.


### [MEDIUM] Adding children to a mesh

Wrong:

```ts
mesh.addChild(otherMesh);
```

Correct:

```ts
const group = new Container();
group.addChild(mesh, otherMesh);
```

`Mesh` sets `allowChildren = false`. Adding children logs a deprecation warning. Group meshes inside a plain `Container`.


## API Reference

- [Mesh](https://pixijs.download/release/docs/scene.Mesh.html.md)
- [MeshGeometry](https://pixijs.download/release/docs/scene.MeshGeometry.html.md)
- [MeshSimple](https://pixijs.download/release/docs/scene.MeshSimple.html.md)
- [MeshPlane](https://pixijs.download/release/docs/scene.MeshPlane.html.md)
- [MeshRope](https://pixijs.download/release/docs/scene.MeshRope.html.md)
- [PerspectiveMesh](https://pixijs.download/release/docs/scene.PerspectiveMesh.html.md)

© pixijs · MIT · pixijs/pixijs-skills

Похожие скиллы

Всё по теме «Фронтенд и UI» →
contour-to-mesh RobLe3 Строит меш в Blender прямо из контура или маски, а не из примерных примитивов. Нужен, когда силуэт должен совпасть с шаблоном один в один. CX Codex +1 788установок pixijs-rendering gamedev-skills Скилл для сборки слоя рендера на PixiJS v8: асинхронный Application, загрузка текстур, сцена на Container, тикер и события указателя. CX Codex +1 5 400установок pixijs-2d freshtechbro Скилл обучает агента создавать 2D-графику на PixiJS с WebGL и WebGPU: анимировать спрайты, выводить частицы и рисовать векторные фигуры на холсте. CX Codex +1 2 500установок threejs-geometry CloudAI-X Скилл учит ИИ-агента создавать стандартные и процедурные геометрии three.js, настраивать буферные атрибуты и генерировать 3D-текст. CX Codex +1 14 600установок threejs-scene-setup gamedev-skills Настраивает базовую сцену three.js и помогает найти причины пустого или чёрного canvas. Нужен при старте проекта, ресайзе, цикле рендеринга и OrbitControls. CX Codex +1 5 500установок geometry-and-math phaserjs Скилл даёт доступ к утилитам Phaser 4 для работы с векторами, прямоугольниками, кругами и полигонами. Пригодится при расчётах расстояний, углов, проверке пересечений и генерации случайных точек. CX Codex +1 807установок

Из того же набора25

pixijs-ticker Скилл объясняет, как устроен цикл рендера PixiJS v8: колбэки тикера, единицы времени, приоритеты и ограничение FPS. CX Codex +1 5 800установок pixijs-scene-text Скилл учит нейросеть работать с текстом в PixiJS v8. Он помогает выбрать подходящий класс рендеринга и не тратить ресурсы на перерисовку канваса каждый кадр. CX Codex +1 5 800установок pixijs-scene-core-concepts Объясняет, как устроено дерево сцены PixiJS v8: контейнеры, листья, трансформы и порядок отрисовки. Пригодится, когда агент пишет код на PixiJS. CX Codex +1 5 900установок pixijs-math Скилл для работы с координатами, матрицами, фигурами и проверкой попаданий в PixiJS v8. Пригодится, когда нужно перевести точку между системами координат или собрать хит-зону. CX Codex +1 5 900установок pixijs-scene-dom-container Подсказывает агенту, как накладывать HTML-элементы на canvas PixiJS v8 через DOMContainer и DOMPipe. Пригодится, когда нужны поля ввода, iframe или видео поверх сцены. CX Codex +1 5 700установок pixijs-blend-modes Скилл подсказывает агенту, как смешивать объекты PixiJS v8 через blendMode: стандартные режимы, продвинутые и порядок для батчинга. CX Codex +1 5 700установок pixijs-color Скилл по классу Color в PixiJS v8. Помогает переводить форматы цвета, настраивать tint и альфу, а также оптимизировать вызовы в циклах рендера через Color.shared и буферы. CX Codex +1 5 700установок pixijs-create Скилл ведёт агента через создание нового проекта PixiJS v8 или подключение библиотеки к уже существующему: шаблоны, пакетные менеджеры, настройка TypeScript. CX Codex +1 5 700установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой