MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029734Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2018-05-04 11:512018-06-18 17:04
Reportermsv 
Assigned Tobugmaster 
PrioritynormalSeverityfeature 
StatustestedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.2.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0029734: Modeling Algorithms - Compute global properties of tessellated shape
DescriptionIt is needed to improve calculation of global properties of a shape (package BRepGProp) to be able to perform calculations on tessellated shapes.

The special flag is to be added to the API in order to give the preferred source for calculations - geometric curves and surfaces or polygons and triangulations.

A set of test cases is to be developed to add to non-regression grid tests.
Steps To Reproducetest cases
bugs modalg_7 bug24731
bugs modalg_7 bug29734
TagsNo tags attached.
Test case numberbugs/modalg_7/bug29731, bugs/modalg_7/bug29734
Attached Files

- Relationships
child of 0028125newmsv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 

-  Notes
(0075828)
msv (developer)
2018-05-04 11:53

This patch is to replace the partial patch implemented in scope of #29731.
(0076013)
git (administrator)
2018-05-17 15:40

Branch CR29734 has been created by ifv.

SHA-1: cbd2228d9e240187a887ae653920766eecb6123f


Detailed log of new commits:

Author: ifv
Date: Thu May 17 15:38:17 2018 +0300

    0029734: Modeling Algorithms - Compute global properties of tessellated shape
    
    New algorithms using mesh data for calculation are added: BRepGProp/BRepGProp_MeshCinert, BRepGProp/BRepGProp_MeshSinert, BRepGProp/BRepGProp_MeshVinert.
    
    In API special flag, which defines preferable source for calculations is added
    Test case is added
    Documentation is updated
(0076029)
ifv (developer)
2018-05-18 10:44

Branch CR29734 is ready for review
(0076054)
msv (developer)
2018-05-21 12:22

src/BRepGProp/BRepGProp_MeshCinert.hxx
- 1-4: incorrect information
- 30-35: not relevant description

src/BRepGProp/BRepGProp_MeshCinert.cxx
- 1-2: incorrect information
- Please use English for comments.
- 80-81: simplify as Lower is always == 0.
- 82: protection against division by zero is needed.

src/BRepGProp/BRepGProp_MeshSinert.hxx
- 1-3: incorrect information
- 34: Comment about closed region of space is not relevant to surface properties.
- 43: missing end of sentense point.
- Wrap too long lines.

src/BRepGProp/BRepGProp_MeshSinert.cxx
- 1-3: incorrect information
- 50-55: too heavy computation of triangle area and normal. It is better to avoid creation of an additional array of points.
- 58: The caller has no means to know if the computation is failed.
- 155, 159: skip triangle if CalculateProps is failure.

src/BRepGProp/BRepGProp_MeshVinert.hxx
- 1-3: incorrect information
- 44: missing end of sentense point.
- Wrap too long lines.

src/BRepGProp/BRepGProp_MeshVinert.cxx
- 1-3: incorrect information

The files BRepGProp_MeshSinert.cxx and BRepGProp_MeshVinert.cxx are almost the same except a small portion of the method CalculateProps. Please think about avoiding of code duplication.

src/BRepGProp/BRepGProp.hxx
- 220: misprint "defained"
- Wrap too long lines where they are changed.

src/BRepGProp/BRepGProp.cxx
- 60: use reference.
- 160-188: too heavy calculation of center and normal. Precision depends on the distance of polygon from the origin. I propose to calculate area and normals of triangles with origin in the first point.
- 212: Why management of Mesh inertia is not made like curve inertia, declaring the instance of BRepGProp_MeshCinert where it is needed?
- 293-309: it is better to move the logic into BRepGProp_MeshSinert, passing there triangulation and location.
- 423-439: the same as above, but for BRepGProp_MeshVinert.

src/BRepTest/BRepTest_GPropCommands.cxx
- 45: misprint "geomery"

dox/dev_guides/upgrade/upgrade.md
- Upgrade guide is not needed to be modified, as the changes do not impact the port to new version.

dox/user_guides/draw_test_harness/draw_test_harness.md
- 7375: "forces computation of only closed shells"
- 7377: "will be taken"
- 7378: "are output"

tests/bugs/modalg_7/bug29734
- The same checker code is copied three times. Please make a tcl proc and call it three times.

Please take from the branch CR29731_1 the changes in files
src/BRepTools/BRepTools.cxx
src/BRepTools/BRepTools.hxx
src/DBRep/DBRep.cxx
tests/bugs/modalg_7/bug29731
(0076325)
git (administrator)
2018-05-25 14:37

Branch CR29734 has been updated forcibly by ifv.

SHA-1: e2439cd8e9e4892c5952ad192f05ab852aa05bcc
(0076326)
git (administrator)
2018-05-25 14:40

Branch CR29734 has been updated forcibly by ifv.

SHA-1: aeeaa54d27eef779d3f76019239e2236f585d06d
(0076333)
git (administrator)
2018-05-25 16:22

Branch CR29734 has been updated forcibly by ifv.

SHA-1: c310c2d15b085a8888177a7b61622e0e9a111b53
(0076357)
ifv (developer)
2018-05-28 12:05

Branch CR29734 is ready for review
(0076385)
msv (developer)
2018-05-29 10:39

The classes BRepGProp_MeshSinert, BRepGProp_MeshVinert are not used any more. Can they be removed then?

src/BRepGProp/BRepGProp_MeshCinert.hxx
src/BRepGProp/BRepGProp_MeshCinert.cxx
src/BRepGProp/BRepGProp_MeshSinert.hxx
src/BRepGProp/BRepGProp_MeshSinert.cxx
src/BRepGProp/BRepGProp_MeshVinert.hxx
src/BRepGProp/BRepGProp_MeshVinert.cxx
src/BRepGProp/BRepGProp_MeshProps.hxx
src/BRepGProp/BRepGProp_MeshProps.cxx
- Please add copyright line in the file beginning:
// Copyright (c) 2018 OPEN CASCADE SAS

src/BRepGProp/BRepGProp_MeshSinert.hxx
- 42: missing end of sentense point.
- 46: Wrap too long line.

src/BRepGProp/BRepGProp_MeshVinert.hxx
- 47: Wrap too long line.

src/BRepGProp/BRepGProp_MeshProps.hxx
- 30: It looks the same as of BRepGProp_MeshSinert. It is needed to tell that this class is capable of computing surface or volume properties.

src/BRepGProp/BRepGProp.hxx
- 96, 135, 148, 186, 200, 215, 217: please wrap long lines.

src/DBRep/DBRep.cxx
- Please update the help of the command tclean with new option "-geom".

tests/bugs/modalg_7/bug29734
- 9-10, 21-22: upvar is not needed for strings.
(0076581)
git (administrator)
2018-06-04 12:15

Branch CR29734 has been updated forcibly by ifv.

SHA-1: d9ec6ca052c4d00bb898da4eb8ad60ec555035f0
(0076603)
git (administrator)
2018-06-05 10:58

Branch CR29734 has been updated forcibly by msv.

SHA-1: af35cc10ef57bc24bf981cfb524379489d7ea338
(0076604)
msv (developer)
2018-06-05 10:59

Some code formatting and comments updating have been done.
(0076606)
msv (developer)
2018-06-05 11:05

Reviewed.
(0076611)
kgv (developer)
2018-06-05 12:35
edited on: 2018-06-05 12:38

+void BRepGProp_MeshProps::Perform(const Handle(Poly_Triangulation)& theMesh,
+                                  const TopLoc_Location& theLoc,
+                                  const TopAbs_Orientation theOri)
+{
+  if (theLoc.IsIdentity())
+  {
+    Perform(theMesh->Nodes(), theMesh->Triangles(), theOri);
+  }
+  else
+  {
+    Standard_Integer aNbNodes = theMesh->NbNodes();
+    TColgp_Array1OfPnt aTrNodes(1, aNbNodes);
+    const gp_Trsf& aTr = theLoc.Transformation();
+    const TColgp_Array1OfPnt& aNodes = theMesh->Nodes();
+    Standard_Integer i;
+    for (i = 1; i <= aNbNodes; ++i)
+    {
+      aTrNodes.SetValue(i, aNodes.Value(i).Transformed(aTr));
+    }
+    Perform(aTrNodes, theMesh->Triangles(), theOri);
+  }

Is it possible avoiding copying of entire triangulation when it is passed with Location?

(0076612)
kgv (developer)
2018-06-05 12:43
edited on: 2018-06-05 12:46

+private: //! @name private fields
+
+  void CalculateProps(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3,
+                      const gp_Pnt& Apex,
+                      Standard_Real GProps[10],
+                      const Standard_Integer NbGaussPoints,
+                      const Standard_Real* GaussPnts);
+
+  BRepGProp_MeshObjType myType; //!< Type of geometric object

Could you please also make this method protected (or public static)?
It can be reused for implementing the same tool processing triangulation not in Poly_Triangulation form.

(0076620)
msv (developer)
2018-06-05 15:30

Dear Igor, please consider KGV's remarks.
(0076694)
git (administrator)
2018-06-09 14:12

Branch CR29734 has been updated forcibly by ifv.

SHA-1: 44d370b55e165672ddb6455650eaf919f4e489ac
(0076695)
ifv (developer)
2018-06-09 14:14

CR29734 is updated according to KGV remarks
(0076708)
msv (developer)
2018-06-09 17:57

Reviewed.
(0076739)
bugmaster (administrator)
2018-06-13 14:44

Combination -
OCCT branch : CR29734 SHA - 44d370b55e165672ddb6455650eaf919f4e489ac
Products branch : master SHA - 82570c1f4b0e27eb09789f573087eef089260f59
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:
Debian70-64:
OCCT
Total CPU difference: 17086.430000000008 / 17011.039999999866 [+0.44%]
Products
Total CPU difference: 7346.630000000022 / 7436.080000000027 [-1.20%]
Windows-64-VC10:
OCCT
Total CPU difference: 16889.198663398634 / 16821.494229398526 [+0.40%]
Products
Total CPU difference: 8048.8871950998755 / 8185.31006959986 [-1.67%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0076753)
kgv (developer)
2018-06-13 20:38

roughBaryCenter() in BRepGProp.cxx uses TopoDS_Vertex in the Shape,
which will be unavailable in case of triangulation-only Faces.
Can this lead to incorrect result?

+  dim = aGProps[0];
+  g.SetX(aGProps[1] / dim);
+  g.SetY(aGProps[2] / dim);
+  g.SetZ(aGProps[3] / dim);

I think that dim should be checked for 0.0 to avoid possible division by zero FPE in case of degenerated triangulation.

+  static Standard_Real GPtsWg[] =

Seems to be static const.

+private: //! @name private fields
+  BRepGProp_MeshObjType myType; //!< Type of geometric object

This field is still private.
(0076764)
msv (developer)
2018-06-14 11:46

Dear Igor, please consider new remarks.

In roughBaryCenter(), you can consider triangulation nodes if i==0 after iteration by vertices.

To get read access to the field "BRepGProp_MeshObjType myType", please add a public method.
(0076765)
kgv (developer)
2018-06-14 11:51
edited on: 2018-06-14 11:52

> In roughBaryCenter(), you can consider triangulation nodes if i==0 after iteration by vertices.
Andrey suggests that for algorithm it is sufficient providing a point near enough to the shape itself.

E.g., if shape contains at list one TopoDS_Vertex - it would be sufficient taking it's coordinates (without averaging all Vertices, which could be removed)
and if not - take a first Node from Triangulation from any Face.

(0076767)
git (administrator)
2018-06-14 13:21

Branch CR29734 has been updated forcibly by ifv.

SHA-1: b48cc1d8c3cdcdf0d569c60fde58450222571778
(0076768)
ifv (developer)
2018-06-14 13:32

CR29734 is updated
(0076770)
msv (developer)
2018-06-14 14:25

Reviewed.
(0076812)
git (administrator)
2018-06-18 13:55

Branch CR29734_1 has been created by kgv.

SHA-1: b70f295e79e646e36508214c9e99208e5815b161


Detailed log of new commits:

Author: ifv
Date: Thu May 17 15:38:17 2018 +0300

    0029734: Modeling Algorithms - Compute global properties of tessellated shape
    
    New algorithms using mesh data for calculation have been added: BRepGProp_MeshCinert, BRepGProp_MeshProps.
    In API a special flag, which defines preferable source for calculations, has been added.
(0076813)
bugmaster (administrator)
2018-06-18 13:56

Last fix caused regression on windows and Linux on the same case
emesh bugs bug29774


http://occt-tests/CR29734-master-KGV-Products/Debian70-64/summary.html [^]
http://occt-tests/CR29734-master-KGV-Products/Windows-64-VC10/summary.html [^]
(0076819)
kgv (developer)
2018-06-18 16:16

Fix has been rebased to current master.

http://jenkins-test-11.nnov.opencascade.com/view/CR29734_1-master-KGV/ [^]
(0076821)
bugmaster (administrator)
2018-06-18 17:04

Combination -
OCCT branch : CR29734_1 SHA - b70f295e79e646e36508214c9e99208e5815b161
Products branch : master SHA - 9ac004afdb7f325fbc12a45c765b6a8f88d4dc98
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:
Debian70-64:
OCCT
Total CPU difference: 17038.400000000005 / 17008.500000000095 [+0.18%]
Products
Total CPU difference: 7457.790000000032 / 7460.130000000034 [-0.03%]
Windows-64-VC10:
OCCT
Total CPU difference: 16875.704576898515 / 16835.17551709858 [+0.24%]
Products
Total CPU difference: 8272.811030499875 / 8259.114142699882 [+0.17%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

- Issue History
Date Modified Username Field Change
2018-05-04 11:51 msv New Issue
2018-05-04 11:51 msv Assigned To => msv
2018-05-04 11:52 msv Assigned To msv => ifv
2018-05-04 11:52 msv Status new => assigned
2018-05-04 11:52 msv Relationship added related to 0029731
2018-05-04 11:53 msv Note Added: 0075828
2018-05-04 11:54 msv Relationship added related to 0028125
2018-05-04 11:54 kgv Summary Compute global properties of tesselated shape => Modeling Algorithms - Compute global properties of tessellated shape
2018-05-17 15:40 git Note Added: 0076013
2018-05-18 10:44 ifv Note Added: 0076029
2018-05-18 10:44 ifv Assigned To ifv => msv
2018-05-18 10:44 ifv Status assigned => resolved
2018-05-18 10:44 ifv Steps to Reproduce Updated View Revisions
2018-05-21 12:22 msv Note Added: 0076054
2018-05-21 12:22 msv Assigned To msv => ifv
2018-05-21 12:22 msv Status resolved => assigned
2018-05-25 14:37 git Note Added: 0076325
2018-05-25 14:40 git Note Added: 0076326
2018-05-25 16:22 git Note Added: 0076333
2018-05-28 12:05 ifv Note Added: 0076357
2018-05-28 12:05 ifv Assigned To ifv => msv
2018-05-28 12:05 ifv Status assigned => resolved
2018-05-29 10:39 msv Note Added: 0076385
2018-05-29 10:39 msv Assigned To msv => ifv
2018-05-29 10:39 msv Status resolved => assigned
2018-06-04 12:15 git Note Added: 0076581
2018-06-04 14:21 ifv Assigned To ifv => msv
2018-06-04 14:21 ifv Status assigned => resolved
2018-06-04 14:21 ifv Steps to Reproduce Updated View Revisions
2018-06-05 10:58 git Note Added: 0076603
2018-06-05 10:59 msv Note Added: 0076604
2018-06-05 11:05 msv Note Added: 0076606
2018-06-05 11:05 msv Assigned To msv => bugmaster
2018-06-05 11:05 msv Status resolved => reviewed
2018-06-05 12:35 kgv Note Added: 0076611
2018-06-05 12:36 kgv Note Edited: 0076611 View Revisions
2018-06-05 12:38 kgv Note Edited: 0076611 View Revisions
2018-06-05 12:43 kgv Note Added: 0076612
2018-06-05 12:44 kgv Assigned To bugmaster => msv
2018-06-05 12:44 kgv Status reviewed => feedback
2018-06-05 12:46 kgv Note Edited: 0076612 View Revisions
2018-06-05 15:30 msv Note Added: 0076620
2018-06-05 15:30 msv Assigned To msv => ifv
2018-06-05 15:30 msv Status feedback => assigned
2018-06-09 14:12 git Note Added: 0076694
2018-06-09 14:14 ifv Note Added: 0076695
2018-06-09 14:14 ifv Assigned To ifv => msv
2018-06-09 14:14 ifv Status assigned => resolved
2018-06-09 17:57 msv Note Added: 0076708
2018-06-09 17:57 msv Assigned To msv => bugmaster
2018-06-09 17:57 msv Status resolved => reviewed
2018-06-12 14:03 bugmaster Test case number => bugs/modalg_7/bug29731, bugs/modalg_7/bug29734
2018-06-13 14:44 bugmaster Note Added: 0076739
2018-06-13 14:44 bugmaster Status reviewed => tested
2018-06-13 18:11 kgv Relationship replaced child of 0028125
2018-06-13 18:12 kgv Relationship replaced has duplicate 0029731
2018-06-13 20:38 kgv Note Added: 0076753
2018-06-13 20:39 kgv Assigned To bugmaster => msv
2018-06-13 20:39 kgv Status tested => feedback
2018-06-14 11:46 msv Note Added: 0076764
2018-06-14 11:46 msv Assigned To msv => ifv
2018-06-14 11:46 msv Status feedback => assigned
2018-06-14 11:51 kgv Note Added: 0076765
2018-06-14 11:52 kgv Note Edited: 0076765 View Revisions
2018-06-14 11:52 kgv Note Edited: 0076765 View Revisions
2018-06-14 13:21 git Note Added: 0076767
2018-06-14 13:32 ifv Note Added: 0076768
2018-06-14 13:32 ifv Assigned To ifv => msv
2018-06-14 13:32 ifv Status assigned => resolved
2018-06-14 14:25 msv Note Added: 0076770
2018-06-14 14:25 msv Assigned To msv => bugmaster
2018-06-14 14:25 msv Status resolved => reviewed
2018-06-18 13:55 git Note Added: 0076812
2018-06-18 13:56 bugmaster Note Added: 0076813
2018-06-18 13:56 bugmaster Assigned To bugmaster => ifv
2018-06-18 13:56 bugmaster Status reviewed => assigned
2018-06-18 16:16 kgv Note Added: 0076819
2018-06-18 16:16 kgv Assigned To ifv => bugmaster
2018-06-18 16:16 kgv Status assigned => resolved
2018-06-18 16:16 kgv Status resolved => reviewed
2018-06-18 17:04 bugmaster Note Added: 0076821
2018-06-18 17:04 bugmaster Status reviewed => tested


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker