Modeling Data - Add GeomHash and Geom2dHash packages#845
Merged
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom Nov 22, 2025
Merged
Modeling Data - Add GeomHash and Geom2dHash packages#845dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
Conversation
- Implemented GeomHash_OffsetCurveHasher for hashing and comparing offset curves. - Implemented GeomHash_OffsetSurfaceHasher for hashing and comparing offset surfaces. - Implemented GeomHash_ParabolaHasher for hashing and comparing parabolas. - Implemented GeomHash_PlaneHasher for hashing and comparing planes. - Implemented GeomHash_PointHasher for hashing and comparing 3D points. - Implemented GeomHash_RectangularTrimmedSurfaceHasher for hashing and comparing trimmed surfaces. - Implemented GeomHash_SphericalSurfaceHasher for hashing and comparing spherical surfaces. - Implemented GeomHash_SurfaceHasher for polymorphic hashing of surfaces. - Implemented GeomHash_SurfaceOfLinearExtrusionHasher for hashing and comparing linear extrusion surfaces. - Implemented GeomHash_SurfaceOfRevolutionHasher for hashing and comparing revolution surfaces. - Implemented GeomHash_ToroidalSurfaceHasher for hashing and comparing toroidal surfaces. - Implemented GeomHash_TrimmedCurveHasher for hashing and comparing trimmed curves. - Implemented GeomHash_VectorHasher for hashing and comparing 3D vectors. - Updated CMake configuration to include GeomHash package.
- Implemented tests for various geometric surfaces including Plane, CylindricalSurface, ConicalSurface, SphericalSurface, ToroidalSurface, BezierSurface, BSplineSurface, SurfaceOfRevolution, SurfaceOfLinearExtrusion, RectangularTrimmedSurface, and OffsetSurface. - Verified that copied surfaces produce the same hash and comparison results. - Ensured that different parameters (e.g., radius, angle, bounds, weights) yield different hashes and comparison results. - Included tests for null surfaces and same object comparisons. - Added cross-type comparison tests to validate behavior between different surface types.
… GeomHash_SurfaceHasher
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive hash and comparison functionality for OCCT geometric objects to enable efficient geometry deduplication and caching. It adds two new packages: GeomHash for 3D geometry and Geom2dHash for 2D geometry, both providing type-specific hashers for curves and surfaces that support polymorphic dispatch via RTTI.
Key changes:
- Implementation of hashers for analytic curves (Line, Circle, Ellipse, Hyperbola, Parabola) and freeform curves (Bezier, BSpline, Trimmed, Offset) in both 2D and 3D
- Implementation of hashers for surfaces including elementary surfaces (Plane, Cylinder, Cone, Sphere, Torus) and derived surfaces (Revolution, LinearExtrusion, RectangularTrimmed, Offset)
- Comprehensive test coverage for all hasher implementations
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ModelingData/TKG3d/PACKAGES.cmake | Adds GeomHash package to TKG3d toolkit |
| src/ModelingData/TKG3d/GeomHash/*.pxx | Implements 3D geometry hashers for foundational types, curves, and surfaces |
| src/ModelingData/TKG3d/GeomHash/.hxx/.cxx | Public API for polymorphic curve and surface hashers |
| src/ModelingData/TKG3d/GeomHash/FILES.cmake | Lists all GeomHash package source files |
| src/ModelingData/TKG3d/GTests/*_Test.cxx | Comprehensive unit tests for 3D hashers |
| src/ModelingData/TKG3d/GTests/FILES.cmake | Adds test files to build system |
| src/ModelingData/TKG2d/PACKAGES.cmake | Adds Geom2dHash package to TKG2d toolkit |
| src/ModelingData/TKG2d/Geom2dHash/*.pxx | Implements 2D geometry hashers (parallel to 3D) |
| src/ModelingData/TKG2d/Geom2dHash/.hxx/.cxx | Public API for polymorphic 2D curve hashers |
| src/ModelingData/TKG2d/Geom2dHash/FILES.cmake | Lists all Geom2dHash package source files |
| src/ModelingData/TKG2d/GTests/Geom2dHash_CurveHasher_Test.cxx | Comprehensive unit tests for 2D hashers |
| src/ModelingData/TKG2d/GTests/FILES.cmake | Adds 2D test files to build system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces new hash and comparison functionality for geometric objects:
These classes provide efficient hashing and deep comparison for geometry deduplication and caching.
Implementation Details
GeomHash_CurveHasher: Hash/comparison for 3D curves
GeomHash_SurfaceHasher: Hash/comparison for 3D surfaces
Geom2dHash_CurveHasher: Hash/comparison for 2D curves