File size: 1,120 Bytes
346b70f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Mesh Palettizer Core

Core library for 3D model texture palette optimization

## Purpose

- Extract colors from mesh textures and materials
- Generate optimized palettes via perceptual clustering
- Build color palettes and remap mesh UVs
- Support multi-mesh scenes with shared textures

## Layout

```
src/
β”œβ”€β”€ context.md       # This file
β”œβ”€β”€ __init__.py      # Main API: convert_meshes()
β”œβ”€β”€ preprocessing/   # Texture detail removal
β”œβ”€β”€ extraction/      # Color extraction from meshes
β”œβ”€β”€ palette/         # Palette generation and mapping
β”œβ”€β”€ atlas/           # Palette texture creation
└── mesh/            # UV remapping
```

## Scope

- In-scope: Mesh processing, color quantization, UV mapping
- Out-of-scope: File I/O, API calls, web interface

## Entrypoints

- `convert_meshes(mesh_list, atlas_size, face_sampling_ratio, simplify_details, detail_sensitivity, scene_metadata)` - Main API
- Returns: `ConversionResult` with processed meshes, palette, and scene metadata

## Dependencies

- Internal: All submodules
- External: numpy, trimesh, PIL, scikit-learn, scipy