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.
This commit is contained in:
Pasukhin Dmitry
2026-04-25 11:46:46 +01:00
committed by GitHub
parent 90f5d7b214
commit bae76f50db
3 changed files with 9 additions and 15 deletions
@@ -434,9 +434,9 @@ void GeomFill_ConstrainedFilling::Init(const occ::handle<GeomFill_Boundary>& B1,
{
occ::handle<Law_Function> fu1, fu2;
ptch->Func(fu1, fu2);
fu1 = Law::MixBnd(occ::down_cast<Law_Linear>(fu1));
fu2 = Law::MixBnd(occ::down_cast<Law_Linear>(fu2));
ptch->Func(fu1, fu2);
const occ::handle<Law_Function> ffu1 = Law::MixBnd(occ::down_cast<Law_Linear>(fu1));
const occ::handle<Law_Function> ffu2 = Law::MixBnd(occ::down_cast<Law_Linear>(fu2));
ptch->SetFunc(ffu1, ffu2);
break;
}
}
@@ -523,8 +523,8 @@ void GeomFill_ConstrainedFilling::Init(const occ::handle<GeomFill_Boundary>& B1,
{
occ::handle<Law_Function> fu1, fu2;
ptch->Func(fu1, fu2);
occ::handle<Law_Function> ffu1 = Law::MixBnd(occ::down_cast<Law_Linear>(fu1));
occ::handle<Law_Function> ffu2 = Law::MixBnd(occ::down_cast<Law_Linear>(fu2));
const occ::handle<Law_Function> ffu1 = Law::MixBnd(occ::down_cast<Law_Linear>(fu1));
const occ::handle<Law_Function> ffu2 = Law::MixBnd(occ::down_cast<Law_Linear>(fu2));
ptch->SetFunc(ffu1, ffu2);
break;
}
@@ -82,12 +82,11 @@ void GeomFill_CoonsAlgPatch::Func(occ::handle<Law_Function>& 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;
@@ -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);
}
//==================================================================================================