"Bad" mesh after cut operation

S1 is a pipe shape from a profile with curve, S2 is a box.

After cut operations, the mesh of S1 became "bad"

Thomas Hafemann's picture

Are you using BRepAlgoAPI_Cut?
Make sure that all objects are OK before cutting.

I recently had a Problem with this function. In my case there was a face with an overlapping edge. It was not visible, but testing the wire showed that it was not closed. After fixing the Wire and creating the new face the cut operation worked.

jack-wangss's picture

Yes, I am using BRepAlgoAPI_Cut.

It is the S1 shape problem, but I am not sure how to fix it.

I used BRepOffsetAPI_MakePipe to create the S1 shape by a profile, at first, everything is ok, but when I used a mat4 to scale the profile, the result came to wrong.

But I need scale the profile, so I don't know how to fix it.

Dmitrii Pasukhin's picture

Please try to use ShapeFix_Shape on this shape.(TKShHealing.dll)

Best regards, Dmitrii.

jack-wangss's picture

Thank you for your help.

I used code below try to fix the profile face, pipe shape and cut shape, but all failed.

ShapeFix_Shape fixer(pipe.Shape());
fixer.Perform();
Mikhail Sazonov's picture

If you just use mat4 to scale to the shape directly it is wrong. You need to use the algorithm BRepBuilderAPI_Transform to apply the scale transformation.

jack-wangss's picture

Here is my code for scale profile face, is that right?

NCollection_Mat4<float> mat4;
mat4.SetValue(0, 0, width);
mat4.SetValue(1, 1, height);

gp_GTrsf trsf;
trsf.SetMat4(mat4);
BRepBuilderAPI_GTransform transform(profile, trsf);
jack-wangss's picture

I have solved this problem by convert arcs in profile into mutiple segments.