DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0032239

Data Exchange, STEP import - bounding box is too large

CommunityOCCT:Data Exchangeclosed15 public notes

Search issues

Description

The bounding box is too large for the attached STEP file. The X range as reported by Author is 157.233mm. However, measuring the X range in another viewer (eDrawings) shows 106.182mm. The Y and Z range is also too large.

Steps to reproduce

Open the attached file in Author and get the range. Measure the range some other way and compare the values.

pload XDE OCAF VISUALIZATION MODELING
dtracelevel trace
testreadstep {UTG RED DOT OPTIC.STEP} s
checkshape s s
bounding s


Output:
 -- The Shape s has problems :
  Check                                    Count
 ------------------------------------------------
  Unorientable Shape ....................... 4
  Not Closed ............................... 4
 ------------------------------------------------
*** Shapes with problems : 8
WIRE    :  4 Items -> compound named s_w
FACE    :  4 Items -> compound named s_f

-82.043211434255824 -97.41395356722937 -97.41395356722937 73.632312330445473 97.41395356722937 97.41395356722937

Public activity

15 archived notes

Participants are labeled by their role within this record.

01Commenter 1
STEP import produces 4 unorientable Faces (for lenses).
So the problem could be reformulated as fixing STEP import to produce a valid shape (or to determine that specific STEP file is invalid and has no proper fix).

Afterwards, bounding box on fixed shape should has expected dimensions.

 -- The Shape s has problems :
  Check                                    Count
 ------------------------------------------------
  Unorientable Shape ....................... 4
  Not Closed ............................... 4
 ------------------------------------------------
*** Shapes with problems : 8
WIRE    :  4 Items -> compound named s_w
FACE    :  4 Items -> compound named s_f

-82.043211434255824 -97.41395356722937 -97.41395356722937 73.632312330445473 97.41395356722937 97.41395356722937


02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: ona
Date: Wed Sep 7 18:48:09 2022 +0300

    0032239: Data Exchange, STEP import - bounding box is too large
    
    - ShapeFix_Face::FixMissingSeam method is fixed in order to handle degenerated torus
    - Calculation of degenerated torus bounding box is fixed
03Commenter 1
Commenter 3
Please attach screenshots of the model after fix to this bug.

+static void ComputeDegeneratedTorus (const gp_Torus& Torus, 
+                           const Standard_Real UMin, const Standard_Real UMax, 
+                           const Standard_Real VMin, const Standard_Real VMax, 
+                           Bnd_Box& B)

Please:
- Name internal/protected/private functions starting with lower-case (computeDegeneratedTorus);
- Add description to the function;
- Apply OCCT name conventions (the/a prefixes to variables).

+  if (UMax - UMin >= uper && VMax - VMin >= vper)
+  {
+    // a whole sphere
+    B.Update(xmin, ymin, zmin, xmax, ymax, zmax);
+  }
+  else

Putting "return" and avoiding "else" would make code simpler to read.

+  auto anIsDegeneratedTor  = ( aTorSurf.IsNull() ? Standard_False : aTorSurf->MajorRadius() < aTorSurf->MinorRadius() );

Please don't use 'auto'.
04Commenter 1
+checkview -display result -2d -path ${imagedir}/${test_image}.png

Please include 3D viewer screenshot to the test as well.
05Commenter 5
Screenshot of the model after fix to this bug:
Attachment 3 (PNG) (82,661 bytes)   
06Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ona
Date: Thu Sep 8 16:14:26 2022 +0300

    #update after review
07Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ona
Date: Tue Sep 13 12:25:13 2022 +0300

    #test reference data is changed
08Commenter 8
Could you please use real angle obtained from radius ratio instead of M_PI for the definition of the range by V:
  Standard_Real vper = M_PI - Precision::PConfusion();
in the function Compute Degenerated Torus of the class BndLib.cxx
09Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: ona
Date: Tue Sep 13 13:14:14 2022 +0300

    #update after review
10Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
11Commenter 11
The following tests have different pictures, but there is not a regression:
- OCCT
  - de step_2 Q5
  - de step_2 Q6
  - de step_1 E6
  - mesh standard_shading E3
  - mesh standard_shading J2
  - mesh standard_shading E8
  - mesh standard_shading I9
  - mesh standard_shading T5
  - mesh standard_shading R1
  - mesh standard_shading A5
  - mesh standard_shading D1
  - mesh standard_shading N9
  - offset shape_type_a A8
  - bugs step bug26376
  - bugs modalg_2 bug5805_5
- Products
 - pointcloud reader gen_shell
 - pointcloud rendering circle_points
 - pointcloud rendering projection
 - pointcloud transformation bug30162
12Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
13Commenter 13
Branch [archived branch] has been reviewed
14Commenter 14
Combination -
OCCT branch : [archived branch]
master SHA - changes and them, and you can discard any commits you make in this
[revision removed]
changes and them, and you can discard any commits you make in this
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18666.730000000585 / 18776.180000000597 [-0.58%]
Products
Total CPU difference: 11867.75000000012 / 11959.870000000119 [-0.77%]
Windows-64-VC14:
OCCT
Total CPU difference: 20851.8125 / 20857.796875 [-0.03%]
Products
Total CPU difference: 14092.984375 / 14084.640625 [+0.06%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
15Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]