View Issue Details

IDProjectCategoryView StatusLast Update
0029264Open CASCADEOCCT:Modeling Datapublic2023-08-01 15:06
ReporterssvAssigned Tomsv 
PrioritynormalSeverityminor 
Status newResolutionopen 
PlatformWindowsOSVC++ 2013 
Product Version7.2.0 
Target VersionUnscheduled 
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

Activities

ssv

2017-10-26 17:27

developer   ~0071808

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();

msv

2017-10-26 18:02

developer   ~0071809

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
2019-08-12 16:43 msv Target Version 7.4.0 => 7.5.0
2020-09-14 22:55 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:52 msv Target Version 7.6.0 => 7.7.0
2022-10-24 10:43 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:06 dpasukhi Target Version 7.8.0 => Unscheduled