Forum archiveIssue archiveOther usage issues

Archived discussion

BRepOffsetAPI_MakeOffset in wire and face odd in occt 7.4.0

Other usage issuesSun, 07/12/2020 - 04:230 replies

Browse this forum
QuestionAuthor

Hello everyone, I do not know if you have encountered this problem. When I use BRepOffsetAPI_MakeOffset of occt 7.4.0, I hope to achieve the effect of Figure 1:

Select a closed wire frame (the wire) of a face on the model, call the BRepOffsetAPI_MakeOffset interface, and generate an offset line of it (The result offset wire). Strangely, the ideal effect is that the offset wireframe should be on the same plane as the selected closed wireframe, but it is not. Why is this? Below is the code I used. Thank you all.

BRepBuilderAPI_FindPlane findPlane(shape);
if (!findPlane.Found()) {
	return;
}
TopoDS_Face face = TopoDS::Face(shape);
TopoDS_Wire wire = BRepTools::OuterWire(face);
if (wire.IsNull()) {
	return;
}
mSelectFace = face;
mSelectFaceWire = wire;
BRepOffsetAPI_MakeOffset makeOffset(mSelectFaceWire,GeomAbs_JoinType::GeomAbs_Intersection, Standard_False);
float offset = faceInsertEdit.mIntOffset;
makeOffset.Perform(offset);
if (makeOffset.IsDone()) {
	TopoDS_Shape S = makeOffset.Shape();
	if (!S.IsNull()) {
		if (S.ShapeType() == TopAbs_WIRE) {
		}
	}
}

 

Discussion

No archived replies

Posts are displayed in their archived order.