MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031707Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2020-08-11 13:162020-09-15 15:56
Reportervsv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0Fixed in Version 
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? file icon symmetry.brep (4,662 bytes) 2020-08-11 13:16
png file icon symmetry.png (1,656 bytes) 2020-08-11 13:26

- Relationships

-  Notes
(0094815)
msv (developer)
2020-09-15 11:36

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.
(0094851)
azv (developer)
2020-09-15 15:54

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 View Revisions
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


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker