From bae76f50db074e7629e46848aa69b13777d74f43 Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Sat, 25 Apr 2026 11:46:46 +0100 Subject: [PATCH] Modeling - Update function handling in GeomFill_ConstrainedFilling and GeomFill_CoonsAlgPatch (#922) - Fixed a bug in GeomFill_ConstrainedFilling::Init(): law functions were discarded due to erroneous use of method Func() instead of SetFunc(). - Corrected parameter usage in GeomFill_CoonsAlgPatch::Value() to ensure proper variable assignment for curve evaluation. --- .../GeomFill/GeomFill_ConstrainedFilling.cxx | 10 +++++----- .../TKGeomAlgo/GeomFill/GeomFill_CoonsAlgPatch.cxx | 5 ++--- .../TKGeomAlgo/IntPatch/IntPatch_PolyhedronBVH.cxx | 9 ++------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx index 052e7717cd..6a5df3aab6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx @@ -434,9 +434,9 @@ void GeomFill_ConstrainedFilling::Init(const occ::handle& B1, { occ::handle fu1, fu2; ptch->Func(fu1, fu2); - fu1 = Law::MixBnd(occ::down_cast(fu1)); - fu2 = Law::MixBnd(occ::down_cast(fu2)); - ptch->Func(fu1, fu2); + const occ::handle ffu1 = Law::MixBnd(occ::down_cast(fu1)); + const occ::handle ffu2 = Law::MixBnd(occ::down_cast(fu2)); + ptch->SetFunc(ffu1, ffu2); break; } } @@ -523,8 +523,8 @@ void GeomFill_ConstrainedFilling::Init(const occ::handle& B1, { occ::handle fu1, fu2; ptch->Func(fu1, fu2); - occ::handle ffu1 = Law::MixBnd(occ::down_cast(fu1)); - occ::handle ffu2 = Law::MixBnd(occ::down_cast(fu2)); + const occ::handle ffu1 = Law::MixBnd(occ::down_cast(fu1)); + const occ::handle ffu2 = Law::MixBnd(occ::down_cast(fu2)); ptch->SetFunc(ffu1, ffu2); break; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CoonsAlgPatch.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CoonsAlgPatch.cxx index 5048b6ac2c..e3abbaab61 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CoonsAlgPatch.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CoonsAlgPatch.cxx @@ -82,12 +82,11 @@ void GeomFill_CoonsAlgPatch::Func(occ::handle& f1, //================================================================================================= -// gp_Pnt GeomFill_CoonsAlgPatch::Value(const double U, -gp_Pnt GeomFill_CoonsAlgPatch::Value(const double, const double V) const +gp_Pnt GeomFill_CoonsAlgPatch::Value(const double U, const double V) const { double a0, a1, a2, a3; a0 = a[0]->Value(V); - a1 = a[1]->Value(V); + a1 = a[1]->Value(U); a2 = 1. - a0; a3 = 1. - a1; gp_XYZ cor, cortemp; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyhedronBVH.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyhedronBVH.cxx index d00b6f7d98..05304bd360 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyhedronBVH.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyhedronBVH.cxx @@ -166,15 +166,10 @@ double IntPatch_PolyhedronBVH::Center(const int theIndex, const int theAxis) con void IntPatch_PolyhedronBVH::Swap(const int theIndex1, const int theIndex2) { - if (theIndex1 == theIndex2) + if (theIndex1 != theIndex2) { - return; + std::swap(myIndexMap.ChangeValue(theIndex1), myIndexMap.ChangeValue(theIndex2)); } - - // Swap indices in the mapping - const int aTmp = myIndexMap.Value(theIndex1); - myIndexMap.SetValue(theIndex1, myIndexMap.Value(theIndex2)); - myIndexMap.SetValue(theIndex2, aTmp); } //==================================================================================================