View Issue Details

IDProjectCategoryView StatusLast Update
0028472CommunityOCCT:Modeling Algorithmspublic2017-02-28 10:48
Reporterdevocctgp Assigned Tobugmaster  
PrioritynormalSeverityjust a question 
Status closedResolutionno change required 
Target Version7.3.0 
Summary0028472: Error result of BOPAlgo_MakerVolume?
Descriptioncreated a text "hello",
get it's wire,
prism the wire

create face1
create face2

use BOPAlgo_MakerVolume with the prismed wire, face1, face2, the result seems not exactly what i want.

see the picture, you will understand
Steps To ReproduceFont_FontAspect _font_aspect;
    TCollection_AsciiString _font_name;
    Font_BRepTextBuilder _text_builder;

    //_font_name = "C:\\Windows\\Fonts\\arialbd.ttf";

    Font_BRepFont _font;
    _font.SetCompositeCurveMode(true);
    if (!_font.Init(Program::Path("Fonts\\arialbd.ttf").c_str(), 10))
    {
        std::cerr << "Font initialization error\n";
    }

    gp_Ax3 pen_ax3 = gp_Ax3(gp_Pnt(0, 12.5, 12), gp_Dir(-1, 0, 0), gp_Dir(0, 1, 0));

    TopoDS_Shape text_shape = _text_builder.Perform(_font, "Hello", pen_ax3,
        Graphic3d_HTA_CENTER, Graphic3d_VTA_BOTTOM);


    TopoDS_Compound text_wire_cmp;
    BRep_Builder b;
    b.MakeCompound(text_wire_cmp);

    TopTools_IndexedMapOfShape aMap;
    TopExp::MapShapes(text_shape, TopAbs_WIRE, aMap);
    for (int i = 1; i <= aMap.Extent(); i++)
    {
        const TopoDS_Shape& wire = aMap.FindKey(i);
        b.Add(text_wire_cmp, wire);
    }

    TopoDS_Shape text_prism_shape = BRepPrimAPI_MakePrism(
        text_wire_cmp, gp_Vec(pen_ax3.Direction()) * 20);

    //
    TopoDS_Face cut_face1 = BRepBuilderAPI_MakeFace(
        gp_Pln(gp_Ax3(gp_Pnt(-10, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 1, 0))), 0, 30, 0, 20);

    TopoDS_Face cut_face2 = BRepBuilderAPI_MakeFace(
        gp_Pln(gp_Ax3(gp_Pnt(-15, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 1, 0))), 0, 30, 0, 20);

    
    BOPCol_ListOfShape aLS;
    aLS.Append(text_prism_shape);
    aLS.Append(cut_face1);
    aLS.Append(cut_face2);

    /* parallel or single mode (the default value is FALSE)*/
    Standard_Boolean bRunParallel = Standard_True;
    /* intersect or not the arguments (the default value is TRUE)*/
    Standard_Boolean bIntersect = Standard_True;
    /* fuzzy option (default value is 0)*/
    Standard_Real aTol = 0.0;

    BOPAlgo_MakerVolume aMV;
    aMV.SetArguments(aLS);
    aMV.SetRunParallel(bRunParallel);
    aMV.SetIntersect(bIntersect);
    aMV.SetFuzzyValue(aTol);
    aMV.SetAvoidInternalShapes(true);

    //aMV.SetGlue(BOPAlgo_GlueShift);
    aMV.Perform();
    if (aMV.ErrorStatus())
    {
        return;
    }

    // result of the operation
    TopoDS_Shape final_shape = aMV.Shape();

##########################
## Draw script:

text2brep t "Hello" -font arialbd
eval compound [explode t w] tw
prism pr tw 0 0 20
plane f1 0 0 10 0 0 1
plane f2 0 0 15 0 0 1
mkface f1 f1 -20 50 -30 30
mkface f2 f2 -20 50 -30 30
mkvolume r pr f1 f2
TagsNo tags attached.
Test case number

Attached Files

  • all3.png (137,645 bytes)
  • QQ浏览器截屏未命名.png (81,865 bytes)

Activities

devocctgp

2017-02-18 10:52

developer  

all3.png (137,645 bytes)

msv

2017-02-20 10:02

developer   ~0063901

The algorithm BOPAlgo_MakerVolume works right. It creates all possible volumes from the intersected faces.
What was your expectations?

devocctgp

2017-02-20 19:02

developer  

QQ浏览器截屏未命名.png (81,865 bytes)

devocctgp

2017-02-20 19:04

developer   ~0063928

what i want is there is empty,

see the picture , i don't know if i explained clear!

msv

2017-02-21 12:50

developer   ~0063936

I understand what you mean, but as I wrote the algorithm works right. Certainly you need to use some other OCCT algorithms. Please get help from OCCT forum (https://www.opencascade.com/forums) or from our support services (https://www.opencascade.com/contact).

msv

2017-02-21 12:51

developer   ~0063937

Dear bugmaster, please close this bug.

Issue History

Date Modified Username Field Change
2017-02-18 10:52 devocctgp New Issue
2017-02-18 10:52 devocctgp Assigned To => msv
2017-02-18 10:52 devocctgp File Added: all3.png
2017-02-20 10:02 msv Note Added: 0063901
2017-02-20 10:02 msv Assigned To msv => devocctgp
2017-02-20 10:02 msv Severity major => minor
2017-02-20 10:02 msv Status new => feedback
2017-02-20 10:02 msv Steps to Reproduce Updated
2017-02-20 10:03 msv Severity minor => just a question
2017-02-20 19:02 devocctgp File Added: QQ浏览器截屏未命名.png
2017-02-20 19:04 devocctgp Note Added: 0063928
2017-02-21 12:50 msv Note Added: 0063936
2017-02-21 12:51 msv Note Added: 0063937
2017-02-21 12:51 msv Assigned To devocctgp => bugmaster
2017-02-21 12:51 msv Resolution open => no change required
2017-02-28 10:48 bugmaster Status feedback => tested
2017-02-28 10:48 bugmaster Status tested => closed