47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output, notes
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | notes | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| scatter_3d | component | cpp | viz | 1.0.0 | pure | void scatter_3d(const char* title, const fn::Scatter3DConfig& cfg) | Scatter 3D ImPlot3D con tamano y color opcional por punto, orbit/zoom/pan nativos |
|
false |
|
false | cpp/functions/viz/scatter_3d.cpp | imgui |
|
Renderiza una nube de puntos 3D dentro del frame ImGui actual; soporta orbit (drag), zoom (wheel) y pan | scaffolding/demo en primitives_gallery |
scatter_3d
Scatter 3D usando ImPlot3D::PlotScatter. Soporta tamano y color opcional por punto via ImPlot3DSpec::MarkerSizes / MarkerFillColors.
Util para visualizaciones de PCA / clustering / nubes de puntos sinteticas. Llamar dentro de un frame ImGui activo.
Caracteristicas
- Per-point size: pasar
cfg.sizes(length = n, en pixeles) o dejarnullptrpara usar el tamano del estilo activo. - Per-point color: pasar
cfg.colors(length = n, ImU32 RGBA) o dejarnullptrpara que ImPlot3D use el color del colormap activo. - Orbit / zoom / pan: nativos de ImPlot3D.
Ejemplo
#include "viz/scatter_3d.h"
#include "imgui.h"
#include <vector>
#include <random>
const int N = 500;
std::vector<float> xs(N), ys(N), zs(N);
std::vector<ImU32> colors(N);
std::mt19937 rng(42);
std::normal_distribution<float> g(0.f, 0.4f);
const ImU32 palette[3] = {
IM_COL32(255, 99, 71, 255), // tomate
IM_COL32( 65,170,255, 255), // azul
IM_COL32(120,220,120, 255), // verde
};
const float cx[3] = {-1.5f, 1.5f, 0.f};
const float cy[3] = { 0.f, 0.f, 2.0f};
const float cz[3] = { 0.f, 1.0f,-1.0f};
for (int i = 0; i < N; ++i) {
int c = i % 3;
xs[i] = cx[c] + g(rng);
ys[i] = cy[c] + g(rng);
zs[i] = cz[c] + g(rng);
colors[i] = palette[c];
}
fn::Scatter3DConfig cfg{};
cfg.xs = xs.data(); cfg.ys = ys.data(); cfg.zs = zs.data();
cfg.colors = colors.data();
cfg.n = N;
fn::scatter_3d("##clusters", cfg);