Get cut curves from pervasive solid and face

Hi,

I want to get the "cut curve" which is defined by a face which pervades a solid. What I need to have is defined in the attached image "crosssection.jpg". It's a cross section of the container bottom.

Atm I load a step file which contains the bottom as solid (I use the C++ SDK of OCC). Then I calculate the bounding box of the solid and derive the "middle plane" of the solid.
Now, I'd like to have the cutting curve of the two objects, the plane and the solid. You can see the situation in the attaced image solid_and_face.jpg.

I tried to do it with the boolean operation section.

//build the cut face
TopoDS_Shape contour;
{
	std::vector<gp_Pnt> points;
	points.emplace_back(obb.Center() - (obb.XHSize() * obb.XDirection()) - (obb.ZHSize() * obb.ZDirection()));
	points.emplace_back(obb.Center() + (obb.XHSize() * obb.XDirection()) - (obb.ZHSize() * obb.ZDirection()));
	points.emplace_back(obb.Center() + (obb.XHSize() * obb.XDirection()) + (obb.ZHSize() * obb.ZDirection()));
	points.emplace_back(obb.Center() - (obb.XHSize() * obb.XDirection()) + (obb.ZHSize() * obb.ZDirection()));

	auto face = occutils::face::FromPoints(points);
	//
	contour = BRepAlgoAPI_Section(reader.Shape(), face);
}

//export to STP
occutils::step_export::ExportSTEP(contour, "test.stp");

When viewing the generated step file, the content looks weird. The section seems to be wrong.

Does anyone has some hints for me how to solve my problem?

Thanks & best regards


Mikhail Sazonov's picture

What you want is impossible to get with Section operation. It looks more similar to Common. So, you should use BRepAlgoAPI_Common.

Marco's picture

Thanks for the hint. seems I misinterpreted the operation description in the documentation.
BRepAlgoAPI_Common works fine. Thank you!