Modeling Data - Fix curve concatenation to use actual endpoints#926
Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom Dec 20, 2025
Merged
Modeling Data - Fix curve concatenation to use actual endpoints#926dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
Conversation
GeomConvert_CompCurveToBSplineCurve::Add() was incorrectly using first/last poles for G0 continuity checks instead of actual curve endpoints. For non-clamped or periodic B-splines, poles may not coincide with curve start/end points, causing concatenation to fail or produce incorrect results. Changed to use StartPoint()/EndPoint() methods which properly evaluate the curve at its parameter bounds.
Member
Author
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in GeomConvert_CompCurveToBSplineCurve::Add() where G0 continuity checks incorrectly used B-spline poles instead of actual curve endpoints. For non-clamped or periodic B-splines, the first/last poles may not coincide with the curve's start/end points, causing concatenation to fail or produce incorrect results.
Key Changes:
- Updated the continuity check logic to use
StartPoint()/EndPoint()methods instead of accessing poles directly - Added comprehensive test coverage for various concatenation scenarios including the specific bug case
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| GeomConvert_CompCurveToBSplineCurve.cxx | Replaced pole-based distance checks with endpoint-based checks for proper G0 continuity validation |
| GeomConvert_CompCurveToBSplineCurve_Test.cxx | New test file with 9 test cases covering clamped/non-clamped B-splines, trimmed arcs, reversal, and edge cases |
| FILES.cmake | Registered the new test file in the build system |
src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx
Show resolved
Hide resolved
src/ModelingData/TKGeomBase/GTests/GeomConvert_CompCurveToBSplineCurve_Test.cxx
Show resolved
Hide resolved
src/ModelingData/TKGeomBase/GTests/GeomConvert_CompCurveToBSplineCurve_Test.cxx
Show resolved
Hide resolved
src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx
Show resolved
Hide resolved
src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx
Show resolved
Hide resolved
…oBSplineCurve.cxx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pasukhin Dmitry <pasuhinsvzn@gmail.com>
AtheneNoctuaPt
approved these changes
Dec 19, 2025
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.
GeomConvert_CompCurveToBSplineCurve::Add() was incorrectly using
first/last poles for G0 continuity checks instead of actual curve
endpoints. For non-clamped or periodic B-splines, poles may not
coincide with curve start/end points, causing concatenation to fail
or produce incorrect results.
Changed to use StartPoint()/EndPoint() methods which properly
evaluate the curve at its parameter bounds.