Wed, 01/19/2022 - 19:28
Forums:
Hi,
I would like to merge two shape with BRepAlgoAPI_Fuse. The merge seems to work but useless edge remain.
I tried to remove this useless edge with ShapeFix_Shape but nothing happend. I join a picture at my message to illustrate my problem.
Is there any solution to this problem ?
Thanks for you response.
Regards,
Manon
Attachments:
Thu, 01/20/2022 - 00:54
Use the method SimplifyResult of the parent class BRepAlgoAPI_BuilderAlgo.
Thu, 01/27/2022 - 15:32
Mikhail,
Thank you for you're answer. I try o use this function but the result shape is empty.
My code is :
BRepAlgoAPI_BuilderAlgo algo;
TopTools_ListOfShape aLS;
aLS.Append(m_Body);
algo.SetArguments(aLS);
algo.SimplifyResult();
m_Body = algo.Shape();
Maybe i did something wrong ?
Regards,
Manon
Thu, 01/27/2022 - 16:12
I also try this :
BRepAlgoAPI_BuilderAlgo algo;
//BOPAlgo_Builder algo;
TopTools_ListOfShape aLS;
aLS.Append(m_bodies[0]);
aLS.Append(m_bodies[1]);
if (m_bodies.size() > 2)
{
for (int i = 2; i < m_bodies.size(); i++)
{
aLS.Append(m_bodies[i]);
}
}
algo.SetArguments(aLS);
algo.SetRunParallel(Standard_True);
algo.SetFuzzyValue(1.e-5);
algo.SetNonDestructive(Standard_True);
algo.SetGlue(BOPAlgo_GlueShift);
algo.SetCheckInverted(Standard_False);
algo.SetUseOBB(Standard_True);
algo.Build();
algo.SimplifyResult();
m_Body = algo.Shape();
ShapeUpgrade_UnifySameDomain unify;
unify.Initialize(m_Body);
unify.Build();
m_Body = unify.Shape();
My shape remain the same as the begining.
Thu, 01/27/2022 - 18:07
I meant that you just call SimplifyResult after Build.
Alternatively, you can perform the algorithm ShapeUpgrade_UnifySameDomain on the result of fuse. You can play with various values of linear and angular tolerances.
Fri, 01/28/2022 - 12:38
Yes it's what I did, but nothing happend. I attach to this message the different result after my test.
I try without simplify, simplify after build, use ShapeUpgrade_UnifySameDomain on the body result and ShapeUpgrade_UnifySameDomain with different angular and linear tolance (0.1) but the result is always the same.
There is my code :
algo.Build();
algo.SimplifyResult();
m_Body = algo.Shape();
ShapeUpgrade_UnifySameDomain unify;
unify.Initialize(m_Body);
unify.SetLinearTolerance(Precision::Confusion()); // or 0.1
unify.SetAngularTolerance(Precision::Angular()); // or 0.1
unify.Build();
m_Body = unify.Shape();
Fri, 01/28/2022 - 12:47
It finaly works with :
m_Body = BRepAlgoAPI_Fuse(m_bodies[0], m_bodies[1]);
ShapeUpgrade_UnifySameDomain unify;
unify.Initialize(m_Body);
unify.Build();
m_Body = unify.Shape();
But I dont understand why it's not working with the general fuse algorithm BRepAlgoAPI_BuilderAlgo like in the documentation. There is any reason for that ?
Fri, 01/28/2022 - 13:52
General fuse algorithm just splits the shells of the arguments at intersections and gathers all in one compound, which is not a manifold solid. Simple fuse produces one solid object, in its shell these edges are actually extra and unify same domain removes them.
Fri, 01/28/2022 - 15:42
ok, thank you for the explanation