@vib3code/sdk 2.0.1 → 2.0.3-canary.75a3290

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/DOCS/AGENT_HARNESS_ARCHITECTURE.md +243 -0
  3. package/DOCS/CLI_ONBOARDING.md +1 -1
  4. package/DOCS/CROSS_SITE_DESIGN_PATTERNS.md +117 -0
  5. package/DOCS/EPIC_SCROLL_EVENTS.md +773 -0
  6. package/DOCS/HANDOFF_LANDING_PAGE.md +154 -0
  7. package/DOCS/HANDOFF_SDK_DEVELOPMENT.md +493 -0
  8. package/DOCS/MULTIVIZ_CHOREOGRAPHY_PATTERNS.md +937 -0
  9. package/DOCS/PRODUCT_STRATEGY.md +63 -0
  10. package/DOCS/README.md +103 -0
  11. package/DOCS/REFERENCE_SCROLL_ANALYSIS.md +97 -0
  12. package/DOCS/ROADMAP.md +111 -0
  13. package/DOCS/SCROLL_TIMELINE_v3.md +269 -0
  14. package/DOCS/SITE_REFACTOR_PLAN.md +100 -0
  15. package/DOCS/STATUS.md +24 -0
  16. package/DOCS/SYSTEM_INVENTORY.md +33 -30
  17. package/DOCS/VISUAL_ANALYSIS_CLICKERSS.md +85 -0
  18. package/DOCS/VISUAL_ANALYSIS_FACETAD.md +133 -0
  19. package/DOCS/VISUAL_ANALYSIS_SIMONE.md +95 -0
  20. package/DOCS/VISUAL_ANALYSIS_TABLESIDE.md +86 -0
  21. package/DOCS/{BLUEPRINT_EXECUTION_PLAN_2026-01-07.md → archive/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md} +1 -1
  22. package/DOCS/{DEV_TRACK_ANALYSIS.md → archive/DEV_TRACK_ANALYSIS.md} +3 -0
  23. package/DOCS/{SYSTEM_AUDIT_2026-01-30.md → archive/SYSTEM_AUDIT_2026-01-30.md} +3 -0
  24. package/DOCS/{DEV_TRACK_SESSION_2026-01-31.md → dev-tracks/DEV_TRACK_SESSION_2026-01-31.md} +1 -1
  25. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-06.md +231 -0
  26. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-13.md +127 -0
  27. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +142 -0
  28. package/DOCS/dev-tracks/README.md +10 -0
  29. package/README.md +26 -13
  30. package/cpp/CMakeLists.txt +236 -0
  31. package/cpp/bindings/embind.cpp +269 -0
  32. package/cpp/build.sh +129 -0
  33. package/cpp/geometry/Crystal.cpp +103 -0
  34. package/cpp/geometry/Fractal.cpp +136 -0
  35. package/cpp/geometry/GeometryGenerator.cpp +262 -0
  36. package/cpp/geometry/KleinBottle.cpp +71 -0
  37. package/cpp/geometry/Sphere.cpp +134 -0
  38. package/cpp/geometry/Tesseract.cpp +94 -0
  39. package/cpp/geometry/Tetrahedron.cpp +83 -0
  40. package/cpp/geometry/Torus.cpp +65 -0
  41. package/cpp/geometry/WarpFunctions.cpp +238 -0
  42. package/cpp/geometry/Wave.cpp +85 -0
  43. package/cpp/include/vib3_ffi.h +238 -0
  44. package/cpp/math/Mat4x4.cpp +409 -0
  45. package/cpp/math/Mat4x4.hpp +209 -0
  46. package/cpp/math/Projection.cpp +142 -0
  47. package/cpp/math/Projection.hpp +148 -0
  48. package/cpp/math/Rotor4D.cpp +322 -0
  49. package/cpp/math/Rotor4D.hpp +204 -0
  50. package/cpp/math/Vec4.cpp +303 -0
  51. package/cpp/math/Vec4.hpp +225 -0
  52. package/cpp/src/vib3_ffi.cpp +607 -0
  53. package/cpp/tests/Geometry_test.cpp +213 -0
  54. package/cpp/tests/Mat4x4_test.cpp +494 -0
  55. package/cpp/tests/Projection_test.cpp +298 -0
  56. package/cpp/tests/Rotor4D_test.cpp +423 -0
  57. package/cpp/tests/Vec4_test.cpp +489 -0
  58. package/package.json +40 -27
  59. package/src/agent/index.js +1 -3
  60. package/src/agent/mcp/MCPServer.js +918 -0
  61. package/src/agent/mcp/index.js +1 -1
  62. package/src/agent/mcp/stdio-server.js +264 -0
  63. package/src/agent/mcp/tools.js +454 -0
  64. package/src/cli/index.js +374 -44
  65. package/src/core/CanvasManager.js +97 -204
  66. package/src/core/ErrorReporter.js +1 -1
  67. package/src/core/Parameters.js +1 -1
  68. package/src/core/VIB3Engine.js +93 -4
  69. package/src/core/VitalitySystem.js +53 -0
  70. package/src/core/index.js +18 -0
  71. package/src/core/renderers/FacetedRendererAdapter.js +10 -9
  72. package/src/core/renderers/HolographicRendererAdapter.js +13 -9
  73. package/src/core/renderers/QuantumRendererAdapter.js +11 -7
  74. package/src/creative/AestheticMapper.js +628 -0
  75. package/src/creative/ChoreographyPlayer.js +481 -0
  76. package/src/creative/index.js +11 -0
  77. package/src/export/TradingCardManager.js +3 -4
  78. package/src/export/index.js +11 -1
  79. package/src/faceted/FacetedSystem.js +241 -388
  80. package/src/holograms/HolographicVisualizer.js +29 -12
  81. package/src/holograms/RealHolographicSystem.js +194 -43
  82. package/src/math/index.js +7 -7
  83. package/src/polychora/PolychoraSystem.js +77 -0
  84. package/src/quantum/QuantumEngine.js +103 -66
  85. package/src/quantum/QuantumVisualizer.js +7 -2
  86. package/src/reactivity/index.js +3 -5
  87. package/src/render/LayerPresetManager.js +372 -0
  88. package/src/render/LayerReactivityBridge.js +344 -0
  89. package/src/render/LayerRelationshipGraph.js +610 -0
  90. package/src/render/MultiCanvasBridge.js +148 -25
  91. package/src/render/UnifiedRenderBridge.js +3 -0
  92. package/src/render/index.js +27 -2
  93. package/src/scene/index.js +4 -4
  94. package/src/shaders/faceted/faceted.frag.glsl +220 -80
  95. package/src/shaders/faceted/faceted.frag.wgsl +138 -97
  96. package/src/shaders/holographic/holographic.frag.glsl +28 -9
  97. package/src/shaders/holographic/holographic.frag.wgsl +107 -38
  98. package/src/shaders/quantum/quantum.frag.glsl +1 -0
  99. package/src/shaders/quantum/quantum.frag.wgsl +1 -1
  100. package/src/testing/ParallelTestFramework.js +2 -2
  101. package/src/viewer/GalleryUI.js +17 -0
  102. package/src/viewer/ViewerPortal.js +2 -2
  103. package/src/viewer/index.js +1 -1
  104. package/tools/headless-renderer.js +258 -0
  105. package/tools/shader-sync-verify.js +8 -4
  106. package/tools/site-analysis/all-reports.json +32 -0
  107. package/tools/site-analysis/combined-analysis.md +50 -0
  108. package/tools/site-analyzer.mjs +779 -0
  109. package/tools/visual-catalog/capture.js +276 -0
  110. package/tools/visual-catalog/composite.js +138 -0
  111. package/types/adaptive-sdk.d.ts +204 -5
  112. package/types/agent/cli.d.ts +78 -0
  113. package/types/agent/index.d.ts +18 -0
  114. package/types/agent/mcp.d.ts +87 -0
  115. package/types/agent/telemetry.d.ts +190 -0
  116. package/types/core/VIB3Engine.d.ts +26 -0
  117. package/types/core/index.d.ts +261 -0
  118. package/types/creative/AestheticMapper.d.ts +72 -0
  119. package/types/creative/ChoreographyPlayer.d.ts +96 -0
  120. package/types/creative/index.d.ts +17 -0
  121. package/types/export/index.d.ts +243 -0
  122. package/types/geometry/index.d.ts +164 -0
  123. package/types/math/index.d.ts +214 -0
  124. package/types/render/LayerPresetManager.d.ts +78 -0
  125. package/types/render/LayerReactivityBridge.d.ts +85 -0
  126. package/types/render/LayerRelationshipGraph.d.ts +174 -0
  127. package/types/render/index.d.ts +3 -0
  128. package/types/scene/index.d.ts +204 -0
  129. package/types/systems/index.d.ts +244 -0
  130. package/types/variations/index.d.ts +62 -0
  131. package/types/viewer/index.d.ts +225 -0
  132. /package/DOCS/{DEV_TRACK_PLAN_2026-01-07.md → archive/DEV_TRACK_PLAN_2026-01-07.md} +0 -0
  133. /package/DOCS/{SESSION_014_PLAN.md → archive/SESSION_014_PLAN.md} +0 -0
  134. /package/DOCS/{SESSION_LOG_2026-01-07.md → archive/SESSION_LOG_2026-01-07.md} +0 -0
  135. /package/DOCS/{STRATEGIC_BLUEPRINT_2026-01-07.md → archive/STRATEGIC_BLUEPRINT_2026-01-07.md} +0 -0
  136. /package/src/viewer/{ReactivityManager.js → ViewerInputHandler.js} +0 -0
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Mat4x4.hpp - 4x4 Matrix for VIB3+ SDK
3
+ *
4
+ * Column-major layout for direct GPU upload.
5
+ * All 6 rotation plane matrices for 4D rotation.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include "Vec4.hpp"
11
+ #include <array>
12
+
13
+ namespace vib3 {
14
+
15
+ // Forward declaration
16
+ class Rotor4D;
17
+
18
+ /**
19
+ * 4x4 Matrix class (column-major)
20
+ *
21
+ * Layout: [col0, col1, col2, col3] where each column is Vec4
22
+ * Element access: m[col][row] or m.at(row, col)
23
+ */
24
+ class alignas(64) Mat4x4 {
25
+ public:
26
+ std::array<float, 16> data;
27
+
28
+ // Constructors
29
+ Mat4x4() noexcept;
30
+ explicit Mat4x4(float diagonal) noexcept;
31
+ Mat4x4(const std::array<float, 16>& elements) noexcept;
32
+ Mat4x4(const Vec4& col0, const Vec4& col1, const Vec4& col2, const Vec4& col3) noexcept;
33
+
34
+ // Static factories
35
+ static Mat4x4 identity() noexcept;
36
+ static Mat4x4 zero() noexcept;
37
+
38
+ /**
39
+ * Create rotation matrix for XY plane (around Z axis in 3D)
40
+ */
41
+ static Mat4x4 rotationXY(float angle) noexcept;
42
+
43
+ /**
44
+ * Create rotation matrix for XZ plane (around Y axis in 3D)
45
+ */
46
+ static Mat4x4 rotationXZ(float angle) noexcept;
47
+
48
+ /**
49
+ * Create rotation matrix for YZ plane (around X axis in 3D)
50
+ */
51
+ static Mat4x4 rotationYZ(float angle) noexcept;
52
+
53
+ /**
54
+ * Create rotation matrix for XW plane (4D rotation)
55
+ */
56
+ static Mat4x4 rotationXW(float angle) noexcept;
57
+
58
+ /**
59
+ * Create rotation matrix for YW plane (4D rotation)
60
+ */
61
+ static Mat4x4 rotationYW(float angle) noexcept;
62
+
63
+ /**
64
+ * Create rotation matrix for ZW plane (4D rotation)
65
+ */
66
+ static Mat4x4 rotationZW(float angle) noexcept;
67
+
68
+ /**
69
+ * Create combined rotation from all 6 angles
70
+ * Order: XY * XZ * YZ * XW * YW * ZW
71
+ */
72
+ static Mat4x4 rotationFromAngles(float xy, float xz, float yz,
73
+ float xw, float yw, float zw) noexcept;
74
+
75
+ /**
76
+ * Create combined rotation from angle array
77
+ */
78
+ static Mat4x4 rotationFromAngles(const std::array<float, 6>& angles) noexcept;
79
+
80
+ /**
81
+ * Create scale matrix
82
+ */
83
+ static Mat4x4 scale(float sx, float sy, float sz, float sw) noexcept;
84
+ static Mat4x4 scale(float uniform) noexcept;
85
+ static Mat4x4 scale(const Vec4& s) noexcept;
86
+
87
+ /**
88
+ * Create translation matrix (in homogeneous coordinates)
89
+ * Note: Standard 4D doesn't use translation matrices the same way
90
+ */
91
+ static Mat4x4 translation(float tx, float ty, float tz, float tw = 0) noexcept;
92
+ static Mat4x4 translation(const Vec4& t) noexcept;
93
+
94
+ // Element access
95
+
96
+ /**
97
+ * Access element (row, col) - note: stored column-major
98
+ */
99
+ float& at(size_t row, size_t col) noexcept;
100
+ const float& at(size_t row, size_t col) const noexcept;
101
+
102
+ /**
103
+ * Get column as Vec4
104
+ */
105
+ Vec4 column(size_t col) const noexcept;
106
+
107
+ /**
108
+ * Set column from Vec4
109
+ */
110
+ void setColumn(size_t col, const Vec4& v) noexcept;
111
+
112
+ /**
113
+ * Get row as Vec4
114
+ */
115
+ Vec4 row(size_t row) const noexcept;
116
+
117
+ /**
118
+ * Set row from Vec4
119
+ */
120
+ void setRow(size_t row, const Vec4& v) noexcept;
121
+
122
+ // Matrix operations
123
+
124
+ /**
125
+ * Matrix multiplication
126
+ */
127
+ Mat4x4 operator*(const Mat4x4& other) const noexcept;
128
+
129
+ /**
130
+ * Compound multiplication
131
+ */
132
+ Mat4x4& operator*=(const Mat4x4& other) noexcept;
133
+
134
+ /**
135
+ * Transform a Vec4
136
+ */
137
+ Vec4 operator*(const Vec4& v) const noexcept;
138
+
139
+ /**
140
+ * Scalar multiplication
141
+ */
142
+ Mat4x4 operator*(float scalar) const noexcept;
143
+ Mat4x4& operator*=(float scalar) noexcept;
144
+
145
+ /**
146
+ * Matrix addition
147
+ */
148
+ Mat4x4 operator+(const Mat4x4& other) const noexcept;
149
+ Mat4x4& operator+=(const Mat4x4& other) noexcept;
150
+
151
+ /**
152
+ * Matrix subtraction
153
+ */
154
+ Mat4x4 operator-(const Mat4x4& other) const noexcept;
155
+ Mat4x4& operator-=(const Mat4x4& other) noexcept;
156
+
157
+ /**
158
+ * Transpose
159
+ */
160
+ Mat4x4 transposed() const noexcept;
161
+
162
+ /**
163
+ * Transpose in place
164
+ */
165
+ void transpose() noexcept;
166
+
167
+ /**
168
+ * Determinant
169
+ */
170
+ float determinant() const noexcept;
171
+
172
+ /**
173
+ * Inverse (returns identity if singular)
174
+ */
175
+ Mat4x4 inverse() const noexcept;
176
+
177
+ /**
178
+ * Check if orthogonal (columns are orthonormal)
179
+ */
180
+ bool isOrthogonal(float epsilon = 1e-5f) const noexcept;
181
+
182
+ /**
183
+ * Check if identity matrix
184
+ */
185
+ bool isIdentity(float epsilon = 1e-5f) const noexcept;
186
+
187
+ // Comparison
188
+
189
+ bool operator==(const Mat4x4& other) const noexcept;
190
+ bool operator!=(const Mat4x4& other) const noexcept;
191
+
192
+ /**
193
+ * Get pointer to data for GPU upload
194
+ */
195
+ const float* ptr() const noexcept { return data.data(); }
196
+ float* ptr() noexcept { return data.data(); }
197
+
198
+ /**
199
+ * Transform Vec4 (same as operator*)
200
+ */
201
+ Vec4 multiplyVec4(const Vec4& v) const noexcept;
202
+ };
203
+
204
+ // Free function operators
205
+ inline Mat4x4 operator*(float scalar, const Mat4x4& m) noexcept {
206
+ return m * scalar;
207
+ }
208
+
209
+ } // namespace vib3
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Projection.cpp - 4D to 3D Projection Implementation
3
+ */
4
+
5
+ #include "Projection.hpp"
6
+ #include <cmath>
7
+ #include <algorithm>
8
+
9
+ namespace vib3 {
10
+
11
+ constexpr float LARGE_VALUE = 1e6f;
12
+ constexpr float EPSILON = 1e-6f;
13
+
14
+ Projection3D projectPerspective(const Vec4& v, float distance) noexcept {
15
+ float denom = distance - v.w;
16
+
17
+ // Handle singularity
18
+ if (std::abs(denom) < EPSILON) {
19
+ float sign = (denom >= 0) ? 1.0f : -1.0f;
20
+ return Projection3D(
21
+ v.x * sign * LARGE_VALUE,
22
+ v.y * sign * LARGE_VALUE,
23
+ v.z * sign * LARGE_VALUE
24
+ );
25
+ }
26
+
27
+ float factor = distance / denom;
28
+ return Projection3D(v.x * factor, v.y * factor, v.z * factor);
29
+ }
30
+
31
+ Projection3D projectStereographic(const Vec4& v) noexcept {
32
+ float denom = 1.0f - v.w;
33
+
34
+ // Handle singularity at w = 1 (north pole of hypersphere)
35
+ if (std::abs(denom) < EPSILON) {
36
+ // Return direction at infinity
37
+ float sign = (v.x + v.y + v.z >= 0) ? 1.0f : -1.0f;
38
+ return Projection3D(sign * LARGE_VALUE, sign * LARGE_VALUE, sign * LARGE_VALUE);
39
+ }
40
+
41
+ float factor = 1.0f / denom;
42
+ return Projection3D(v.x * factor, v.y * factor, v.z * factor);
43
+ }
44
+
45
+ Projection3D projectOrthographic(const Vec4& v) noexcept {
46
+ return Projection3D(v.x, v.y, v.z);
47
+ }
48
+
49
+ Projection3D projectOblique(const Vec4& v,
50
+ float shearX,
51
+ float shearY,
52
+ float shearZ) noexcept {
53
+ return Projection3D(
54
+ v.x + shearX * v.w,
55
+ v.y + shearY * v.w,
56
+ v.z + shearZ * v.w
57
+ );
58
+ }
59
+
60
+ SliceResult projectSlice(const Vec4& v,
61
+ float sliceW,
62
+ float thickness,
63
+ bool fade) noexcept {
64
+ float dist = std::abs(v.w - sliceW);
65
+
66
+ if (dist > thickness) {
67
+ return SliceResult::invalid();
68
+ }
69
+
70
+ float alpha = 1.0f;
71
+ if (fade && thickness > 0) {
72
+ alpha = 1.0f - (dist / thickness);
73
+ alpha = std::max(0.0f, std::min(1.0f, alpha));
74
+ }
75
+
76
+ return SliceResult{
77
+ Projection3D(v.x, v.y, v.z),
78
+ alpha,
79
+ true
80
+ };
81
+ }
82
+
83
+ // Batch projections
84
+
85
+ std::vector<Projection3D> projectPerspectiveBatch(
86
+ const std::vector<Vec4>& points,
87
+ float distance
88
+ ) noexcept {
89
+ std::vector<Projection3D> result;
90
+ result.reserve(points.size());
91
+
92
+ for (const auto& p : points) {
93
+ result.push_back(projectPerspective(p, distance));
94
+ }
95
+
96
+ return result;
97
+ }
98
+
99
+ std::vector<Projection3D> projectStereographicBatch(
100
+ const std::vector<Vec4>& points
101
+ ) noexcept {
102
+ std::vector<Projection3D> result;
103
+ result.reserve(points.size());
104
+
105
+ for (const auto& p : points) {
106
+ result.push_back(projectStereographic(p));
107
+ }
108
+
109
+ return result;
110
+ }
111
+
112
+ std::vector<Projection3D> projectOrthographicBatch(
113
+ const std::vector<Vec4>& points
114
+ ) noexcept {
115
+ std::vector<Projection3D> result;
116
+ result.reserve(points.size());
117
+
118
+ for (const auto& p : points) {
119
+ result.push_back(projectOrthographic(p));
120
+ }
121
+
122
+ return result;
123
+ }
124
+
125
+ std::vector<float> projectToFloatArray(
126
+ const std::vector<Vec4>& points,
127
+ float distance
128
+ ) noexcept {
129
+ std::vector<float> result;
130
+ result.reserve(points.size() * 3);
131
+
132
+ for (const auto& p : points) {
133
+ auto proj = projectPerspective(p, distance);
134
+ result.push_back(proj.x);
135
+ result.push_back(proj.y);
136
+ result.push_back(proj.z);
137
+ }
138
+
139
+ return result;
140
+ }
141
+
142
+ } // namespace vib3
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Projection.hpp - 4D to 3D Projection Functions
3
+ *
4
+ * Various projection methods for visualizing 4D geometry in 3D.
5
+ */
6
+
7
+ #pragma once
8
+
9
+ #include "Vec4.hpp"
10
+ #include <array>
11
+ #include <vector>
12
+
13
+ namespace vib3 {
14
+
15
+ /**
16
+ * 4D to 3D projection result
17
+ */
18
+ struct Projection3D {
19
+ float x, y, z;
20
+
21
+ constexpr Projection3D() noexcept : x(0), y(0), z(0) {}
22
+ constexpr Projection3D(float x, float y, float z) noexcept : x(x), y(y), z(z) {}
23
+
24
+ /**
25
+ * Convert to array
26
+ */
27
+ constexpr std::array<float, 3> toArray() const noexcept {
28
+ return {x, y, z};
29
+ }
30
+ };
31
+
32
+ /**
33
+ * Projection parameters
34
+ */
35
+ struct ProjectionParams {
36
+ float distance = 2.0f; // For perspective projection
37
+ float viewerW = 0.0f; // Viewer position in W
38
+ float sliceW = 0.0f; // For slice projection
39
+ float sliceThickness = 0.1f;
40
+
41
+ static ProjectionParams defaults() noexcept {
42
+ return ProjectionParams{};
43
+ }
44
+ };
45
+
46
+ /**
47
+ * Perspective projection: X = x * d / (d - w)
48
+ *
49
+ * Projects 4D points as if viewed from w = distance.
50
+ * Objects farther in w appear smaller (like depth in 3D).
51
+ *
52
+ * @param v 4D point
53
+ * @param distance Projection distance
54
+ * @return 3D projected point
55
+ */
56
+ Projection3D projectPerspective(const Vec4& v, float distance = 2.0f) noexcept;
57
+
58
+ /**
59
+ * Stereographic projection: X = x / (1 - w)
60
+ *
61
+ * Conformal projection from S³ (unit hypersphere).
62
+ * Preserves angles but not distances.
63
+ * Pole at w = 1 maps to infinity.
64
+ *
65
+ * @param v 4D point (ideally on unit hypersphere)
66
+ * @return 3D projected point
67
+ */
68
+ Projection3D projectStereographic(const Vec4& v) noexcept;
69
+
70
+ /**
71
+ * Orthographic projection: X = x, Y = y, Z = z
72
+ *
73
+ * Simple parallel projection, discarding W.
74
+ *
75
+ * @param v 4D point
76
+ * @return 3D projected point
77
+ */
78
+ Projection3D projectOrthographic(const Vec4& v) noexcept;
79
+
80
+ /**
81
+ * Oblique (cavalier) projection: X = x + shear.x * w, etc.
82
+ *
83
+ * @param v 4D point
84
+ * @param shearX X shear factor
85
+ * @param shearY Y shear factor
86
+ * @param shearZ Z shear factor
87
+ * @return 3D projected point
88
+ */
89
+ Projection3D projectOblique(const Vec4& v,
90
+ float shearX = 0.5f,
91
+ float shearY = 0.5f,
92
+ float shearZ = 0.0f) noexcept;
93
+
94
+ /**
95
+ * Cross-sectional slice projection
96
+ *
97
+ * Returns empty if point is outside the slice.
98
+ *
99
+ * @param v 4D point
100
+ * @param sliceW W coordinate of the slice plane
101
+ * @param thickness Half-thickness of the slice
102
+ * @param fade If true, fade points near edges
103
+ * @return 3D point if in slice, or empty optional
104
+ */
105
+ struct SliceResult {
106
+ Projection3D point;
107
+ float alpha; // 1.0 = center of slice, 0.0 = edge
108
+ bool valid;
109
+
110
+ static SliceResult invalid() noexcept {
111
+ return SliceResult{{}, 0.0f, false};
112
+ }
113
+ };
114
+
115
+ SliceResult projectSlice(const Vec4& v,
116
+ float sliceW = 0.0f,
117
+ float thickness = 0.1f,
118
+ bool fade = true) noexcept;
119
+
120
+ /**
121
+ * Batch projection for efficiency
122
+ */
123
+ std::vector<Projection3D> projectPerspectiveBatch(
124
+ const std::vector<Vec4>& points,
125
+ float distance = 2.0f
126
+ ) noexcept;
127
+
128
+ std::vector<Projection3D> projectStereographicBatch(
129
+ const std::vector<Vec4>& points
130
+ ) noexcept;
131
+
132
+ std::vector<Projection3D> projectOrthographicBatch(
133
+ const std::vector<Vec4>& points
134
+ ) noexcept;
135
+
136
+ /**
137
+ * Project to flat array (for GPU upload)
138
+ *
139
+ * @param points Input 4D points
140
+ * @param distance Projection distance
141
+ * @return Flat array [x0,y0,z0, x1,y1,z1, ...]
142
+ */
143
+ std::vector<float> projectToFloatArray(
144
+ const std::vector<Vec4>& points,
145
+ float distance = 2.0f
146
+ ) noexcept;
147
+
148
+ } // namespace vib3