MantisBT - Community
View Issue Details
0028475Community[OCCT] OCCT:Modeling Algorithmspublic2017-02-20 12:022019-10-06 11:39
Westermann 
jgv 
normalminor 
assignedopen 
WindowsVC++ 201564 bit
[OCCT] 7.1.0 
 
0028475: HLR IN 7.1.0 DIFFERENT TO 7.0.0
 try to use now 7.1.0 but the HLR is very different.

using HLRBRep_PolyAlgo myAlgo = HLRBRep_PolyAlgo();

TopoDS_Shape VCompound = aHLRToShape.VCompound(myShape());

you can see the differences in the attached PDF.
bool STDCALL TOccSolidManager::doHiddenLinePoly(TOccSolidBaseList* hard, double Rotatex, double Rotatez)
{
  try {
    if (hard && (hard->count() > 0)) {
      // Build The algorithm object
      HLRBRep_PolyAlgo myAlgo = HLRBRep_PolyAlgo();
      // Add Shapes into the algorithm

      for (int i = 0; i < hard->count(); i++) {
        TOccSolid* temp = (TOccSolid*)hard->getSolid(i);
        // TopoDS_Shape aShape = TopoDS_Shape(temp->getShape());
        TopoDS_Shape aShape = temp->getShape();
        myAlgo.Load(aShape);
      }

  // Create Rotation
      gp_Pnt aPnt(0, 0, 0);
      /* gp_Dir aDir(Direction.x, Direction.y, Direction.z);
      gp_Dir aDirX(DirectionX.x, DirectionX.y, DirectionX.z);*/

      gp_Dir zDir(0, 0, 1);
      gp_Dir xDir(1, 0, 0);

      gp_Ax2 anAx2d;
      anAx2d.Rotate(gp_Ax1(aPnt, xDir), Rotatez);
      anAx2d.Rotate(gp_Ax1(aPnt, zDir), -Rotatex);

      HLRAlgo_Projector myProjector = HLRAlgo_Projector(anAx2d);

      //// Set The Projector (myProjector is a HLRAlgo_Projector)
      myAlgo.Projector(myProjector);
      //// Build HLR
      myAlgo.Update();
    
      //// Build the extraction object :
      HLRBRep_PolyHLRToShape aHLRToShape = HLRBRep_PolyHLRToShape();
      aHLRToShape.Update(&myAlgo);
      //// extract the results :
      
      // TopoDS_Shape VCompound = aHLRToShape.VCompound();

      for (int i = 0; i < hard->count(); i++) {
        TOccSolid* temp = (TOccSolid*)hard->getSolid(i);
        // Clear previus data
        temp->clearHidden();
        // Visible Parts
        TopoDS_Shape VCompound = aHLRToShape.VCompound(temp->getShape());
        getEdges(temp, VCompound, false);
        VCompound = aHLRToShape.OutLineVCompound(temp->getShape());
        getEdges(temp, VCompound, false);
        VCompound = aHLRToShape.Rg1LineVCompound(temp->getShape());
        getEdges(temp, VCompound, false);
        VCompound = aHLRToShape.RgNLineVCompound(temp->getShape());
        getEdges(temp, VCompound, false);

        // Hidden Parts
        VCompound = aHLRToShape.HCompound(temp->getShape());
        getEdges(temp, VCompound, true);
        VCompound = aHLRToShape.OutLineHCompound(temp->getShape());
        getEdges(temp, VCompound, true);
        VCompound = aHLRToShape.Rg1LineHCompound(temp->getShape());
        getEdges(temp, VCompound, true);
        VCompound = aHLRToShape.RgNLineHCompound(temp->getShape());
        getEdges(temp, VCompound, true);
      
      }

      return true;
    }
    return false;
  }
  catch (...) {
    doLOG(L"Exception in calcHidden");
    return false;
  }
}
https://www.opencascade.com/content/hlr-710-different-700 [^]
No tags attached.
related to 0028242closed apn [Regression] HLR Poly Algo has broken edges 
pdf OCC_7.1.pdf (17,809) 2017-02-20 12:02
https://tracker.dev.opencascade.org/
zip occ_problem.zip (781,022) 2017-02-20 13:01
https://tracker.dev.opencascade.org/
? bug28475_solid118.brep (30,573) 2017-02-20 17:04
https://tracker.dev.opencascade.org/
png bug28475_solid118.png (35,192) 2017-02-20 17:05
https://tracker.dev.opencascade.org/
Issue History
2017-02-20 12:02WestermannNew Issue
2017-02-20 12:02WestermannAssigned To => oan
2017-02-20 12:02WestermannFile Added: OCC_7.1.pdf
2017-02-20 12:14oanCategoryOCCT:Mesh => OCCT:Visualization
2017-02-20 12:15oanAssigned Tooan => jgv
2017-02-20 12:17kgvCategoryOCCT:Visualization => OCCT:Modeling Algorithms
2017-02-20 12:17kgvAssigned Tojgv => msv
2017-02-20 12:28msvNote Added: 0063910
2017-02-20 12:28msvAssigned Tomsv => Westermann
2017-02-20 12:28msvStatusnew => feedback
2017-02-20 13:01WestermannFile Added: occ_problem.zip
2017-02-20 13:02WestermannNote Added: 0063912
2017-02-20 15:50msvNote Added: 0063921
2017-02-20 15:52msvAssigned ToWestermann => jgv
2017-02-20 15:52msvStatusfeedback => assigned
2017-02-20 17:03abvNote Added: 0063925
2017-02-20 17:04abvFile Added: bug28475_solid118.brep
2017-02-20 17:05abvFile Added: bug28475_solid118.png
2017-09-07 11:38WestermannNote Added: 0070305
2017-09-15 23:26WestermannNote Deleted: 0070305
2017-09-15 23:27WestermannNote Added: 0070615
2018-02-26 14:10diptsRelationship addedrelated to 0028242
2018-05-03 15:46WestermannNote Added: 0075781

Notes
(0063910)
msv   
2017-02-20 12:28   
Could you provide a sample of BRep file to reproduce the problem?
(0063912)
Westermann   
2017-02-20 13:02   
Hope these Helps.
The only difference is the OCC Version
(0063921)
msv   
2017-02-20 15:50   
Thank you for the shapes (though it would be easier for us to process it using one brep file containing compound shape).
We will take care of this bug if there are free resources or some investment.
(0063925)
abv   
2017-02-20 17:03   
DRAW script to load all shapes in one compound:

set i 0
set ll {}
foreach f [glob *.brep] { restore $f a_[incr i]; lappend ll a_$i }
eval compound $ll c

DRAW script to reproduce HLR problem:

pload VISUALIZATION
restore [locate_data_file bug28475_solid118.brep] a
vdisplay a
vviewparams -scale 596 -proj 0.0307502 -0.82342 -0.566598 -up -0.0346066 -0.567403 0.822712 -eye 5.2557 -0.600219 -0.985466 -at 5.06152 4.5993 2.59234
vhlr on
(0070615)
Westermann   
2017-09-15 23:27   
Reminder sent to: abv

This is still a valid problem in 7.2,
is there anything i can do for look at it?
(0075781)
Westermann   
2018-05-03 15:46   
Reminder sent to: jgv

I was looking with 7.3 Beta, the problem persists. Any chance to get it in 7.3?