Skip to content

Modeling Data - Add Geom2dGridEval package for batch 2D curve evaluation#1079

Merged
dpasukhi merged 3 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:grid_eval_2d
Feb 13, 2026
Merged

Modeling Data - Add Geom2dGridEval package for batch 2D curve evaluation#1079
dpasukhi merged 3 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:grid_eval_2d

Conversation

@dpasukhi
Copy link
Member

Add new Geom2dGridEval package in TKG2d providing batch evaluation of 2D curves at multiple parameter values, mirroring the existing 3D GeomGridEval package in TKG3d. Specialized evaluators use analytical formulas for conics and cache-based evaluation for BSpline/Bezier curves, with a unified std::variant dispatcher for automatic type-based dispatch.

New classes:

  • Geom2dGridEval_Line (header-only), _Circle, _Ellipse, _Hyperbola, _Parabola, _BezierCurve, _BSplineCurve, _OffsetCurve, _OtherCurve
  • Geom2dGridEval_Curve: unified dispatcher with Initialize() from Adaptor2d_Curve2d or occ::handle<Geom2d_Curve>
  • Geom2dGridEval.hxx: CurveD1/D2/D3 result structures

BSplCLib_Cache changes:

  • Add D0Local/D1Local/D2Local/D3Local overloads for gp_Pnt2d/gp_Vec2d
  • Refactor existing 2D D0/D1/D2/D3 methods to delegate to D*Local, consistent with the existing 3D delegation pattern

…tch 2D curve evaluation

Add new Geom2dGridEval package in TKG2d providing batch evaluation of 2D
curves at multiple parameter values, mirroring the existing 3D GeomGridEval
package in TKG3d. Specialized evaluators use analytical formulas for conics
and cache-based evaluation for BSpline/Bezier curves, with a unified
std::variant dispatcher for automatic type-based dispatch.

New classes:
- Geom2dGridEval_Line (header-only), _Circle, _Ellipse, _Hyperbola,
  _Parabola, _BezierCurve, _BSplineCurve, _OffsetCurve, _OtherCurve
- Geom2dGridEval_Curve: unified dispatcher with Initialize() from
  Adaptor2d_Curve2d or occ::handle<Geom2d_Curve>
- Geom2dGridEval.hxx: CurveD1/D2/D3 result structures

BSplCLib_Cache changes:
- Add D0Local/D1Local/D2Local/D3Local overloads for gp_Pnt2d/gp_Vec2d
- Refactor existing 2D D0/D1/D2/D3 methods to delegate to D*Local,
  consistent with the existing 3D delegation pattern
Copy link

Copilot AI left a 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 PR adds a new Geom2dGridEval package to TKG2d for efficient batch evaluation of 2D curves at multiple parameter values, mirroring the existing 3D GeomGridEval package in TKG3d. The implementation uses analytical formulas for conics and cache-based evaluation for BSpline/Bezier curves, with a unified std::variant dispatcher for automatic type-based dispatch.

Changes:

  • New Geom2dGridEval package with 9 specialized curve evaluators (Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OffsetCurve, OtherCurve)
  • Unified Geom2dGridEval_Curve dispatcher using std::variant for type-safe automatic dispatch
  • BSplCLib_Cache enhancements: added D0Local/D1Local/D2Local/D3Local methods for 2D, refactored existing 2D D0/D1/D2/D3 to delegate to these new methods
  • Comprehensive GTest coverage for all evaluator types

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ModelingData/TKG2d/PACKAGES.cmake Adds Geom2dGridEval package to TKG2d toolkit
src/ModelingData/TKG2d/Geom2dGridEval/FILES.cmake Lists all source and header files for the new package
src/ModelingData/TKG2d/Geom2dGridEval/Geom2dGridEval.hxx Defines CurveD1/D2/D3 result structures
src/ModelingData/TKG2d/Geom2dGridEval/Geom2dGridEval_*.hxx/cxx Specialized evaluators for each curve type
src/ModelingData/TKG2d/Geom2dGridEval/Geom2dGridEval_Curve.hxx/cxx Unified dispatcher with std::variant
src/FoundationClasses/TKMath/BSplCLib/BSplCLib_Cache.hxx/cxx Added 2D D*Local methods and refactored delegation
src/ModelingData/TKG2d/GTests/*.cxx Comprehensive test coverage for all evaluators
src/ModelingData/TKG2d/GTests/FILES.cmake Registers new test files

@dpasukhi dpasukhi marked this pull request as ready for review February 13, 2026 22:41
@dpasukhi dpasukhi merged commit fcd88b9 into Open-Cascade-SAS:IR Feb 13, 2026
39 of 42 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Feb 13, 2026
@dpasukhi dpasukhi deleted the grid_eval_2d branch February 13, 2026 22:41
@dpasukhi dpasukhi changed the title Foundation Classes, Modeling Data - Add Geom2dGridEval package for batch 2D curve evaluation Modeling Data - Add Geom2dGridEval package for batch 2D curve evaluation Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants