-
Notifications
You must be signed in to change notification settings - Fork 0
3d jan/extended volumetric spec #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ility; implement related unit tests
Signed-off-by: 3dJan <[email protected]>
…ongithub Update version, improve test handling
… workflow efficiency
…inux to optimize build performance
Signed-off-by: 3dJan <[email protected]>
Co-authored-by: 3dJan <[email protected]>
Co-authored-by: 3dJan <[email protected]>
… execution Co-authored-by: 3dJan <[email protected]>
Co-authored-by: 3dJan <[email protected]>
Co-authored-by: 3dJan <[email protected]>
…th verification Co-authored-by: 3dJan <[email protected]>
…eamline caching process
…to enhance vcpkg configuration
Fix failing CI build: resolve workflow syntax errors and optimize caching
…w features and bug fixes
…notes Update release notes for version 1.2.13
Co-authored-by: 3dJan <[email protected]>
…L tests Co-authored-by: 3dJan <[email protected]>
… toolchain Co-authored-by: 3dJan <[email protected]>
Fix CodeQL autobuild failure by adding manual build workflow
…starting position
…nt BeamLatticeExporter
… enum for acceleration type and update related methods
…mpute spatial gradients using central finite differences and mirror referenced function inputs
- Introduced the FunctionGradient node to compute the normalized gradient of a referenced function. - Implemented necessary methods for resolving function IDs, updating inputs and outputs, and validating configurations. - Enhanced the Assembly and Model classes to accommodate FunctionGradient nodes. - Updated the NodeFactory to create FunctionGradient instances. - Added UI controls for FunctionGradient in NodeView, allowing users to select scalar outputs and vector inputs. - Implemented visitor patterns for FunctionGradient in various visitors (ToCommandStreamVisitor, ToOCLVisitor, Visitor). - Ensured proper integration with existing nodes and error handling for invalid configurations.
…ctionality and behavior
…3djan/FixResourceOrder) and update SHA
…p size control Replace the combo widgets with button-driven popups for FunctionGradient scalar/vector selection to avoid dangling references in the node editor. Use ModelEditor->showPopupMenu to open per-node popups, capture data by-value, and apply selections by updating the node, setting m_parameterChanged, and marking the model as modified when available Replace ImGui::SeparatorText with a plain header text for the gradient section Add a Step Size DragFloat control that clamps negative values to zero, ensures the parameter is set modifiable, sets m_parameterChanged, and marks the model modified on change
…d avoid backup during async refresh - ToOCLVisitor: add checks and early returns for missing/unused gradient output, null assembly, missing referenced model, wrong output type, unconsumed output, missing/invalid vector input and missing step size; emit a safe float3(0.0f) fallback (inlined or as local var) instead of throwing to make OCL generation resilient - Writer3mf: detect functions containing FunctionGradient nodes and skip 3MF serialization while logging a warning to avoid NodeTypeMap/runtime errors; add TODO for future full serialization support - Document: comment out saveBackup() call in refreshModelAsync to prevent backups being triggered during asynchronous model refresh
…, cache lowered functions, validate configurations, wire parameters and replace FunctionGradient nodes with FunctionCall; include parameter copying, consumer rewiring, name sanitization and error reporting
…ector to ignore non-gradient nodes during detection
…ngth to B, zero to C and one to D
…creating FunctionGradient nodes from FunctionCall and run lowering pass with error reporting - Add functionCallControls to create a FunctionGradient from a FunctionCall (set function id, register inputs/outputs, copy parameter links or values, mark outputs used) - Add "Create Function Gradient" button invocation in node content rendering - Add "Lower Function Gradients" button and logic in functionGradientControls to run nodes::LowerFunctionGradient, collect/report errors, update assembly/model state and notify ModelEditor - Add m_lowerGradientMessage and m_lowerGradientMessageIsError members for feedback display - Add necessary include for nodes/LowerFunctionGradient and <exception> - Wrap lowering/creation operations in try/catch and surface messages; set m_parameterChanged/m_modelChanged when modifications occur
…n UI, run lowering pass during assembly flattening, and fix mask wiring in lowering
…t lowering, reuse and error reporting; add ToOclVisitor fallback test to FunctionGradient_tests
…rough lowering and OCL emission - Add FieldNames::Gradient and FieldNames::Magnitude constants - Extend FunctionGradient type rule to include Gradient (float3) and Magnitude (float) - Preserve and create Gradient and Magnitude output ports in FunctionGradient::updateInternalOutputs - In LowerFunctionGradient, register Gradient and Magnitude inputs on synthesized end node and wire: - raw gradient -> mask -> Gradient input (Multiplication) - length -> mask -> Magnitude input (Multiplication) - In ToOclVisitor, emit raw gradient and magnitude outputs (support inlining where possible or emit defined variables)
…xtension, lowering, and NormalizeDistanceField Add comprehensive architecture and design documents to thegreatplan: - gladius/thegreatplan/3mf-volumetric-implementation.md: describe 3MF volumetric & implicit namespaces, node graph model, pipeline, data types, and integration guidance - gladius/thegreatplan/FunctionGradientExtension.md: document FunctionGradient extension (raw gradient and magnitude outputs), codegen/inlining behavior, masking/zero-gradient handling, and tests - gladius/thegreatplan/FunctionGradientLowering.md: specify LowerFunctionGradient pass, function synthesis, caching, replacement algorithm, helpers, edge cases, and tests - gladius/thegreatplan/NormalizeDistanceFieldNode.md: propose NormalizeDistanceField node, lowering approach using FunctionGradient.magnitude, API/UX, testing and rollout plan - gladius/thegreatplan/more_ideas.md: add brief notes for mesh→beam-lattice importer and gradient node idea Provide implementation notes, testing strategy, and rollout guidance to enable subsequent implementation and integration
…nt and magnitude outputs Add assertions and new tests to verify FunctionGradient exposes Gradient and Magnitude outputs and that ToOclVisitor emits gradient/magnitude-related variables when those outputs are used. Update LowerFunctionGradient_tests to expect lowered functions to include Gradient and Magnitude outputs so lowering and OCL emission behavior are validated
…I, and 3MF/OCL support
- Introduce NormalizeDistanceField node (DerivedNodes.h / DerivedNodes.cpp)
- mirror referenced function inputs as arguments, provide FunctionId and StepSize params
- add selection/validation helpers and getters/setters for configuration
- Implement LowerNormalizeDistanceField lowering pass (new LowerNormalizeDistanceField.{h,cpp})
- find NormalizeDistanceField nodes, create helper functions that mirror referenced inputs
- compose normalization by creating helper FunctionCall, FunctionGradient, Max (epsilon), and Division nodes
- rewire consumers to normalized output, remove original NormalizeDistanceField node
- add error reporting, sanitization, parameter copying and linking utilities
- Wire lowering into assembly flattening (Document.cpp)
- run LowerNormalizeDistanceField after LowerFunctionGradient and before OptimizeOutputs
- UI: add creation and lowering controls in NodeView (NodeView.h / NodeView.cpp)
- allow creating a NormalizeDistanceField from a FunctionCall and lowering selected nodes interactively
- add status messaging for lowering results
- Visitor and OCL: add visitor hook and annotate ToOCL fallback output
- add NormalizeDistanceField visit methods (Visitor.h / Visitor.cpp)
- add nodesfwd entries and FieldNames for new params
- annotate FunctionGradient fallback in ToOCLVisitor output for diagnostics
- 3MF: mark import/export behavior for unsupported nodes
- add TODO comments in Importer3mf for NormalizeDistanceField/FunctionGradient import
- update Writer3mf to detect and skip functions containing FunctionGradient or NormalizeDistanceField with a warning
- Misc: add helper declarations and plumbing to support new node and lowering
…g, UI, OCL and tests - Importer3mf: map new 3MF node types (BeamLattice, FunctionGradient, NormalizeDistance) and allow dynamic inputs for FunctionCall/FunctionGradient/NormalizeDistance; initialize parameters (FunctionId/StepSize) and read selected scalar/vector names for implicit nodes - Writer3mf: add serialization for FunctionGradient nodes (emit scalar/vector selection, function resource and step constant) and update unsupported-node detection to skip NormalizeDistanceField until serialization is implemented - nodes/DerivedNodes: rename FunctionGradient vector output to NormalizedGradient and update type rules/ports and NormalizeDistanceField outputs to use Result per spec - nodes/LowerFunctionGradient: wire normalized gradient output through lowering, register mirrored NormalizedGradient input and rewire consumers accordingly - nodes/OptimizeOutputs & nodes/ToOCLVisitor: update consumers and inlining logic to reference NormalizedGradient - nodes/nodesfwd: add FieldNames::NormalizedGradient and adjust StepSize identifier - ui/NodeView: implement full NormalizeDistanceField configuration UI (select scalar output, select vector input, step size control, validation, and lowering button) with diagnostics and guarded lowering - tests: add NormalizeDistanceField unit tests covering inputs/outputs, defaults, lowering behavior (helper function, FunctionGradient creation, Division node), category and description - vcpkg overlay: update lib3mf REF and SHA to volumetric_beamlattice_gradient branch - docs: remove obsolete 3mf-volumetric-implementation.md Ensure consistency across nodes and lowering for normalized gradient handling and preserve backward compatibility where applicable
…umetric_beamlattice_gradient
Update CPACK_PACKAGE_VERSION_PATCH in CMakeLists, installDir in CMakePresets.json, revision in src/version.h, and version-string in vcpkg.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces comprehensive improvements spanning build infrastructure, CI/CD pipelines, desktop integration, and a significant refactor of the implicit modeling node system. The primary focus is on extending volumetric capabilities with new gradient computation features and distance field normalization.
Key changes:
- Added CodeQL static analysis workflow for automated security and code quality scanning
- Implemented Linux desktop integration (icons, launchers) and improved packaging robustness
- Introduced
FunctionGradientandNormalizeDistanceFieldnodes with graph-based lowering transformations - Extended test infrastructure with OpenCL availability detection and parameterized integration tests
- Enhanced UI capabilities including function extraction, navigation history, and multi-monitor spanning support
Reviewed Changes
Copilot reviewed 93 out of 101 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| release_notes.md | Updated release notes for version 1.2.13 with slice view improvements |
| gladius/vcpkg.json, gladius/src/version.h | Version bump to 1.2.15 |
| gladius/vcpkg-overlay-ports/lib3mflinux_/* | Removed Linux-specific lib3mf overlay (now using unified version) |
| gladius/vcpkg-overlay-ports/lib3mf/portfile.cmake | Updated lib3mf reference branch for volumetric beam lattice gradient support |
| gladius/thegreatplan/*.md | Added implementation plans for gradient node, distance field normalization, and feature ideas |
| gladius/tests/unittests/opencl_test_helper.h | New helper macro for skipping tests when OpenCL is unavailable |
| gladius/tests/unittests/*_tests.cpp | Multiple test files updated with OpenCL availability checks and new test coverage |
| gladius/tests/integrationtests/testdata.h | Updated test data file reference |
| gladius/tests/integrationtests/GladiusLib_tests.cpp | Refactored to parameterized tests scanning all available 3MF files |
| gladius/tests/integrationtests/CMakeLists.txt | Added CONFIGURE_DEPENDS to test file globbing |
| gladius/src/ui/*.cpp/h | Extensive UI enhancements: function extraction dialog, navigation history, gradient/normalize controls |
| gladius/src/nodes/*.cpp/h | Core node system extensions: FunctionGradient, NormalizeDistanceField, OutputPortReferenceAnalyzer, lowering transformations |
| gladius/src/compute/Rendering.cpp | Fixed brace-enclosed initializer syntax |
| gladius/src/io/ImageStackExporter.cpp | Fixed implicit narrowing conversion warning |
|
|
||
| inputData.resize(distmap.getData().size()); | ||
| if (inputData.size() != m_columnCountWorld * m_rowCountWorld) | ||
| if (inputData.size() != static_cast<size_t>(m_columnCountWorld) * m_rowCountWorld) |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explicit cast to size_t only applies to m_columnCountWorld. If m_rowCountWorld is also a signed type, the multiplication could still produce a signed result before comparison with size_t. Consider casting the entire multiplication: static_cast<size_t>(m_columnCountWorld) * static_cast<size_t>(m_rowCountWorld).
| if (inputData.size() != static_cast<size_t>(m_columnCountWorld) * m_rowCountWorld) | |
| if (inputData.size() != static_cast<size_t>(m_columnCountWorld) * static_cast<size_t>(m_rowCountWorld)) |
This pull request introduces several improvements across the build system, continuous integration, desktop integration, and the
BeamLatticeResourceimplementation. The most significant changes include the addition of CodeQL static analysis to CI, improved Linux desktop integration (including icon and launcher support), and a refactor of the beam lattice acceleration structure configuration for clarity and extensibility.Key changes:
Continuous Integration and Quality
.github/workflows/codeql.yml) to perform static analysis on C/C++ code for security and code quality, with a configuration file to exclude third-party and build artifact directories (.github/codeql/codeql-config.yml). [1] [2].github/chatmodes/reviewer.chatmode.md).Build System and Packaging
gladius/CMakeLists.txt,gladius/CMakePresets.json). [1] [2]installtarget depends on all targets being built, preventing incomplete packaging (gladius/CMakeLists.txt).Linux Desktop Integration
.desktoplauncher file for Linux desktop environments, enabling proper application discovery and theming. [1] [2]BeamLatticeResource Refactor
BeamLatticeResourceclass to use a newBeamLatticeAccelerationenum instead of a boolean for selecting between BVH and Voxel acceleration structures, improving clarity and extensibility (gladius/src/BeamLatticeResource.h,gladius/src/BeamLatticeResource.cpp). [1] [2] [3] [4] [5] [6]Minor Improvements
CLMath.cppfor OpenCL vector types.CLProgram.h. [1] [2]These changes collectively improve the project's maintainability, developer experience, packaging robustness, and code quality.