BRepAlgoAPI_Cut

Hello,

I am trying to use following code:
TopoDS_Shape cut_shape = BRepAlgoAPI_Cut(*from_shape, *tool_shape);

After that, I want to compare if cut_shape and *from_shape are the same, meaning, from_shape didn't get cut. In the case of not cutting case, both TopoDS_Shape::IsSame() and TopoDS_Shape::IsEqual() gives false, which indicates these shapes are different.

BRepAlgoAPI_BooleanOperation::HasModified() or HasGenerated() don't same to give the corresponding answer either.

Is there any other ways to tell if the cutting is actually performed or not?

Thanks in advance!

Jane

Rob Bachrach's picture

The IsSame and IsEqual comparisons look to see if the shapes use the same handle. They wouldn't since the result of the cut is always a new shape. I have done this by using BRepGProp to compute the mass of the shape. If the mass after the cut is not less than that before the cut, the cut had no effect.

Rob

Jane Hu's picture

Thanks, Rob! This IS a great idea to compare the mass!

Have a nice day!

Jane