View Issue Details

IDProjectCategoryView StatusLast Update
0031707Open CASCADEOCCT:Modeling Algorithmspublic2020-09-15 15:56
ReportervsvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Target Version7.5.0 
Summary0031707: Wrong faces orientation in compound after mirror transformation
DescriptionThe following peace of code
  gp_Trsf aTrsf;
  aTrsf.SetMirror(gp_Pnt(0, 0, 0));
  aShape.Move(aTrsf);

causes inversion of faces orientation if shape is a compound.
Steps To ReproduceAn example of such compound is attached. A C++ code for testing is following:
  char aFileName[] = "D:\\NewGeom\\Development\\symmetry.brep";
  std::cout << "File name: " << aFileName << std::endl;
  TopoDS_Shape aShape;
  BRep_Builder aBuilder;
  BRepTools::Read(aShape, aFileName, aBuilder);

  gp_Pln aPln;
  gp_Dir aDir;
  std::cout << "Before move" << std::endl;
  for (TopExp_Explorer anExp(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
    TopoDS_Face aFace = TopoDS::Face(anExp.Current());
    Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
    GeomLib_IsPlanarSurface isPlanarSurf(aSurf);
    if (isPlanarSurf.IsPlanar()) {
      aPln = isPlanarSurf.Plan();
      aDir = aPln.Axis().Direction();
      std::cout << "X=" << aDir.X() << " Y=" << aDir.Y() << " Z=" << aDir.Z() << std::endl;
    }
  }

  gp_Trsf aTrsf;
  aTrsf.SetMirror(gp_Pnt(0, 0, 0));
  aShape.Move(aTrsf);

  std::cout << "Aftert move" << std::endl;
  for (TopExp_Explorer anExp(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
    TopoDS_Face aFace = TopoDS::Face(anExp.Current());
    Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
    GeomLib_IsPlanarSurface isPlanarSurf(aSurf);
    if (isPlanarSurf.IsPlanar()) {
      aPln = isPlanarSurf.Plan();
      aDir = aPln.Axis().Direction();
      std::cout << "X=" << aDir.X() << " Y=" << aDir.Y() << " Z=" << aDir.Z() << std::endl;
    }
  }
TagsNo tags attached.
Test case number

Attached Files

  • symmetry.brep (4,662 bytes)
  • symmetry.png (1,656 bytes)

Activities

vsv

2020-08-11 13:16

developer  

symmetry.brep (4,662 bytes)

vsv

2020-08-11 13:26

developer  

symmetry.png (1,656 bytes)

msv

2020-09-15 11:36

developer   ~0094815

Not all kinds of transformations can be applied to shapes using the method TopoDS_Shape::Move(). Only transformations that contain translation and rotation are safe. Other kinds, including scale and mirror, can and will bring unsupported behavior to shapes.

For such kinds of transformations a special class must be used BRepBuilderAPI_Transform.

So, this bug can be closed as not a bug.

azv

2020-09-15 15:54

administrator   ~0094851

Dear Mikhail, thank you very much for the clarification.

Dear BugMaster, please, close this issue. We have used the correct way within the SHAPER's source code.

Issue History

Date Modified Username Field Change
2020-08-11 13:16 vsv New Issue
2020-08-11 13:16 vsv Assigned To => msv
2020-08-11 13:16 vsv File Added: symmetry.brep
2020-08-11 13:21 vsv Steps to Reproduce Updated
2020-08-11 13:26 vsv File Added: symmetry.png
2020-09-15 11:36 msv Note Added: 0094815
2020-09-15 11:49 msv Assigned To msv => azv
2020-09-15 15:54 azv Note Added: 0094851
2020-09-15 15:54 azv Assigned To azv => bugmaster
2020-09-15 15:54 azv Status new => feedback
2020-09-15 15:56 bugmaster Status feedback => closed
2020-09-15 15:56 bugmaster Resolution open => no change required