MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029264Open CASCADE[OCCT] OCCT:Modeling Datapublic2017-10-26 17:252017-10-26 18:02
Reporterssv 
Assigned Tomsv 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version[OCCT] 7.2.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0029264: BRep_Builder affects orientation of sub-shape, why?
DescriptionImagine you add REVERSED wire to REVERSED face via BRep_Builder. Which orientation of wire do you expect as a result? Personally, I think that the orientation should be REVERSED as it could be set intentionally and there is no explicit reason for BRep_Builder to modify the user's intent. However, the orientation will be FORWARD (reproducer C++ code is provided).

This issue complicates working with OCCT topological structures at low level, i.e. when full control over the topological structures and their orientations is needed. The problem is complicated by the fact that you're obligated to use BRep_Builder, because you cannot affect sub-shapes collection directly (it is a private field of TShape). Or, if BRep_Builder is a "high-level" tool to decide on orientation, then what is the alternative low-level tool? Do we have any?

In the scope of this issue, I propose at least to introduce some flag in BRep_Builder in order to make it stay away from the user's data and not touch orientation.
Steps To ReproduceBRep_Builder BB;

// Construct any face
TopoDS_Face face;
BB.MakeFace(face);
face.Orientation(TopAbs_REVERSED);
// Construct any wire
TopoDS_Wire wire;
BB.MakeWire(wire);
wire.Orientation(TopAbs_REVERSED);

// Add wire to face
BB.Add(face, wire);

// Problem: wire loses its REVERSED orientation
for ( TopoDS_Iterator it(face, false, false); it.More(); it.Next() )
{
  // We don't care of internal/external here
  std::cout << "Orientation of sub-shape is "
            << (it.Value().Orientation() == TopAbs_FORWARD ? "forward" : "reversed");
}
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0071808)
ssv (developer)
2017-10-26 17:27

To be more specific, I am speaking about lines 101-103 in TopoDS_Builder.cxx:

// compute the relative Orientation
if (aShape.Orientation() == TopAbs_REVERSED)
  S.Reverse();
(0071809)
msv (developer)
2017-10-26 18:02

I think the problem here is that TopoDS_Builder::Add() method does not have a flag "CumOri" like TopoDS_Iterator has. We can introduce such flag in this method.

- Issue History
Date Modified Username Field Change
2017-10-26 17:25 ssv New Issue
2017-10-26 17:25 ssv Assigned To => msv
2017-10-26 17:27 ssv Note Added: 0071808
2017-10-26 18:00 msv Category OCCT:Modeling Algorithms => OCCT:Modeling Data
2017-10-26 18:00 msv Product Version => 7.2.0
2017-10-26 18:02 msv Note Added: 0071809


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker