DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0026562

BRepAlgoAPI_Section generates incorrect result

CommunityOCCT:Modeling Algorithmsnew0 public notes

Search issues

Description

The resulting edge of the intersection of the attached shapes "cutShape1.brep" and "cutShape2.brep" lies inside the first shape, but does exceed the boundaries of the second shape. The resulting edge can be found in the attachment "cutResultFail.brep".

Tested with OCCT Version 6.9.0 patch #0000001, built from git tag V6_9_0p1

Steps to reproduce

The following code was used for the computation of the intersection:

    TopoDS_Shape cutShape1, cutShape2;
    BRep_Builder builder;

    Standard_Boolean result1 = BRepTools::Read(cutShape1, "cutShape1.brep", builder);
    Standard_Boolean result2 = BRepTools::Read(cutShape2, "cutShape2.brep", builder);

    if (!result1 || !result2) {
        std::cerr << "Error reading input files cutShape1.brep or cutShape2.brep for intersection" << std::endl;
        return 1;
    }

    BRepAlgoAPI_Section cutter(cutShape1, cutShape2, Standard_False);
    cutter.ComputePCurveOn1(Standard_True);
    cutter.Approximation(Standard_True);
    cutter.Build();
    if (!cutter.IsDone()) {
        std::cerr << "Cutting of shapes not successfull!" << std::endl;
        return 1;
    }
    TopoDS_Shape result = cutter.Shape();
    BRepTools::Write(result, "cutResult.brep");

    return 0;

Public activity

No public notes

Participants are labeled by their role within this record.