View Issue Details

IDProjectCategoryView StatusLast Update
0029734Open CASCADEOCCT:Modeling Algorithmspublic2019-08-28 10:16
ReportermsvAssigned Tokgv  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Product Version7.2.0 
Target Version7.4.0Fixed in Version7.4.0 
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

Relationships

parent of 0030924 closedapn Open CASCADE Coding - incorrect header in file OSD_ThreadPool.hxx 
child of 0028125 newmsv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 

Activities

msv

2018-05-04 11:53

developer   ~0075828

This patch is to replace the partial patch implemented in scope of #29731.

git

2018-05-17 15:40

administrator   ~0076013

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

ifv

2018-05-18 10:44

developer   ~0076029

Branch CR29734 is ready for review

msv

2018-05-21 12:22

developer   ~0076054

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

git

2018-05-25 14:37

administrator   ~0076325

Branch CR29734 has been updated forcibly by ifv.

SHA-1: e2439cd8e9e4892c5952ad192f05ab852aa05bcc

git

2018-05-25 14:40

administrator   ~0076326

Branch CR29734 has been updated forcibly by ifv.

SHA-1: aeeaa54d27eef779d3f76019239e2236f585d06d

git

2018-05-25 16:22

administrator   ~0076333

Branch CR29734 has been updated forcibly by ifv.

SHA-1: c310c2d15b085a8888177a7b61622e0e9a111b53

ifv

2018-05-28 12:05

developer   ~0076357

Branch CR29734 is ready for review

msv

2018-05-29 10:39

developer   ~0076385

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.

git

2018-06-04 12:15

administrator   ~0076581

Branch CR29734 has been updated forcibly by ifv.

SHA-1: d9ec6ca052c4d00bb898da4eb8ad60ec555035f0

git

2018-06-05 10:58

administrator   ~0076603

Branch CR29734 has been updated forcibly by msv.

SHA-1: af35cc10ef57bc24bf981cfb524379489d7ea338

msv

2018-06-05 10:59

developer   ~0076604

Some code formatting and comments updating have been done.

msv

2018-06-05 11:05

developer   ~0076606

Reviewed.

kgv

2018-06-05 12:35

developer   ~0076611

Last edited: 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?

kgv

2018-06-05 12:43

developer   ~0076612

Last edited: 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.

msv

2018-06-05 15:30

developer   ~0076620

Dear Igor, please consider KGV's remarks.

git

2018-06-09 14:12

administrator   ~0076694

Branch CR29734 has been updated forcibly by ifv.

SHA-1: 44d370b55e165672ddb6455650eaf919f4e489ac

ifv

2018-06-09 14:14

developer   ~0076695

CR29734 is updated according to KGV remarks

msv

2018-06-09 17:57

developer   ~0076708

Reviewed.

bugmaster

2018-06-13 14:44

administrator   ~0076739

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

kgv

2018-06-13 20:38

developer   ~0076753

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.

msv

2018-06-14 11:46

developer   ~0076764

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.

kgv

2018-06-14 11:51

developer   ~0076765

Last edited: 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.

git

2018-06-14 13:21

administrator   ~0076767

Branch CR29734 has been updated forcibly by ifv.

SHA-1: b48cc1d8c3cdcdf0d569c60fde58450222571778

ifv

2018-06-14 13:32

developer   ~0076768

CR29734 is updated

msv

2018-06-14 14:25

developer   ~0076770

Reviewed.

git

2018-06-18 13:55

administrator   ~0076812

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.

bugmaster

2018-06-18 13:56

administrator   ~0076813

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

kgv

2018-06-18 16:16

developer   ~0076819

Fix has been rebased to current master.

http://jenkins-test-11.nnov.opencascade.com/view/CR29734_1-master-KGV/

bugmaster

2018-06-18 17:04

administrator   ~0076821

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

git

2018-06-22 14:56

administrator   ~0076887

Branch CR29734 has been updated forcibly by ifv.

SHA-1: 6c00fb8c9d7e3d6295f18674365d864d059ffd7e

git

2018-06-25 13:58

administrator   ~0077026

Branch CR29734 has been deleted by kgv.

SHA-1: 6c00fb8c9d7e3d6295f18674365d864d059ffd7e

git

2018-06-25 13:58

administrator   ~0077027

Branch CR29734_1 has been deleted by kgv.

SHA-1: b70f295e79e646e36508214c9e99208e5815b161

Related Changesets

occt: master b9570bd5

2018-05-17 12:38:17

ifv


Committer: bugmaster Details Diff
0029734: Modeling Algorithms - Compute global properties of tessellated shape

New algorithms using mesh data for calculation have been added:
• BRepGProp_MeshCinert computes the global properties of polylines represented by a set of points
• BRepGProp_MeshProps - computes the global properties of a surface mesh.

A special flag UseTriangulation has been added in API.
If it is true which face triangulations are used as the first source for calculations, otherwise exact geometry objects (surfaces) are used.
Affected Issues
0029734
mod - dox/user_guides/draw_test_harness/draw_test_harness.md Diff File
mod - src/BRepGProp/BRepGProp.cxx Diff File
mod - src/BRepGProp/BRepGProp.hxx Diff File
add - src/BRepGProp/BRepGProp_MeshCinert.cxx Diff File
add - src/BRepGProp/BRepGProp_MeshCinert.hxx Diff File
add - src/BRepGProp/BRepGProp_MeshProps.cxx Diff File
add - src/BRepGProp/BRepGProp_MeshProps.hxx Diff File
mod - src/BRepGProp/FILES Diff File
mod - src/BRepTest/BRepTest_GPropCommands.cxx Diff File
mod - src/BRepTools/BRepTools.cxx Diff File
mod - src/BRepTools/BRepTools.hxx Diff File
mod - src/DBRep/DBRep.cxx Diff File
add - tests/bugs/modalg_7/bug29731 Diff File
add - tests/bugs/modalg_7/bug29734 Diff File
mod - tests/bugs/vis/bug173_1 Diff File

occt: master 4b114473

2018-05-17 12:38:17

ifv


Committer: kgv Details Diff
0029734: Modeling Algorithms - Compute global properties of tessellated shape

New algorithms calculating global properties on mesh data have been added:
- BRepGProp_MeshCinert computes the global properties of polylines represented by a set of points;
- BRepGProp_MeshProps computes the global properties of a surface mesh.

Existing tool BRepGProp now automatically uses new algorithm for triangulation-only faces.
By default, algorithm will use exact geometry objects (surfaces), when it is available (as before the patch);
this behavior can be switched by a new flag UseTriangulation, forcing usage of triangulation instead of exact geometry when both defined.
Affected Issues
0029734
mod - dox/user_guides/draw_test_harness/draw_test_harness.md Diff File
mod - src/BRepGProp/BRepGProp.cxx Diff File
mod - src/BRepGProp/BRepGProp.hxx Diff File
add - src/BRepGProp/BRepGProp_MeshCinert.cxx Diff File
add - src/BRepGProp/BRepGProp_MeshCinert.hxx Diff File
add - src/BRepGProp/BRepGProp_MeshProps.cxx Diff File
add - src/BRepGProp/BRepGProp_MeshProps.hxx Diff File
mod - src/BRepGProp/FILES Diff File
mod - src/BRepTest/BRepTest_GPropCommands.cxx Diff File
mod - src/BRepTools/BRepTools.cxx Diff File
mod - src/BRepTools/BRepTools.hxx Diff File
mod - src/DBRep/DBRep.cxx Diff File
add - tests/bugs/modalg_7/bug29731 Diff File
add - tests/bugs/modalg_7/bug29734 Diff File
mod - tests/bugs/vis/bug173_1 Diff File

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: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
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
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
2018-06-05 12:38 kgv Note Edited: 0076611
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
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 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
2018-06-14 11:52 kgv Note Edited: 0076765
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
2018-06-22 14:56 git Note Added: 0076887
2018-06-23 19:05 bugmaster Changeset attached => occt master b9570bd5
2018-06-23 19:05 bugmaster Status tested => verified
2018-06-23 19:05 bugmaster Resolution open => fixed
2018-06-25 13:58 git Note Added: 0077026
2018-06-25 13:58 git Note Added: 0077027
2018-06-30 12:48 kgv Changeset attached => occt master 4b114473
2018-06-30 12:48 kgv Assigned To bugmaster => kgv
2019-08-28 10:16 kgv Relationship added parent of 0030924