View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029734 | Open CASCADE | OCCT:Modeling Algorithms | public | 2018-05-04 11:51 | 2019-08-28 10:16 |
Reporter | Assigned To | kgv | |||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Product Version | 7.2.0 | ||||
Target Version | 7.4.0 | Fixed in Version | 7.4.0 | ||
Summary | 0029734: Modeling Algorithms - Compute global properties of tessellated shape | ||||
Description | It 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 Reproduce | test cases bugs modalg_7 bug24731 bugs modalg_7 bug29734 | ||||
Tags | No tags attached. | ||||
Test case number | bugs/modalg_7/bug29731, bugs/modalg_7/bug29734 | ||||
|
This patch is to replace the partial patch implemented in scope of #29731. |
|
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 |
|
Branch CR29734 is ready for review |
|
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 |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: e2439cd8e9e4892c5952ad192f05ab852aa05bcc |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: aeeaa54d27eef779d3f76019239e2236f585d06d |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: c310c2d15b085a8888177a7b61622e0e9a111b53 |
|
Branch CR29734 is ready for review |
|
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. |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: d9ec6ca052c4d00bb898da4eb8ad60ec555035f0 |
|
Branch CR29734 has been updated forcibly by msv. SHA-1: af35cc10ef57bc24bf981cfb524379489d7ea338 |
|
Some code formatting and comments updating have been done. |
|
Reviewed. |
|
+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? |
|
+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. |
|
Dear Igor, please consider KGV's remarks. |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: 44d370b55e165672ddb6455650eaf919f4e489ac |
|
CR29734 is updated according to KGV remarks |
|
Reviewed. |
|
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 |
|
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. |
|
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. |
|
> 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. |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: b48cc1d8c3cdcdf0d569c60fde58450222571778 |
|
CR29734 is updated |
|
Reviewed. |
|
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. |
|
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 |
|
Fix has been rebased to current master. http://jenkins-test-11.nnov.opencascade.com/view/CR29734_1-master-KGV/ |
|
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 |
|
Branch CR29734 has been updated forcibly by ifv. SHA-1: 6c00fb8c9d7e3d6295f18674365d864d059ffd7e |
|
Branch CR29734 has been deleted by kgv. SHA-1: 6c00fb8c9d7e3d6295f18674365d864d059ffd7e |
|
Branch CR29734_1 has been deleted by kgv. SHA-1: b70f295e79e646e36508214c9e99208e5815b161 |
occt: master b9570bd5 2018-05-17 12:38:17
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
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 |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-05-04 11:51 |
|
New Issue | |
2018-05-04 11:51 |
|
Assigned To | => msv |
2018-05-04 11:52 |
|
Assigned To | msv => ifv |
2018-05-04 11:52 |
|
Status | new => assigned |
2018-05-04 11:53 |
|
Note Added: 0075828 | |
2018-05-04 11:54 |
|
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 |
|
Note Added: 0076029 | |
2018-05-18 10:44 |
|
Assigned To | ifv => msv |
2018-05-18 10:44 |
|
Status | assigned => resolved |
2018-05-18 10:44 |
|
Steps to Reproduce Updated | |
2018-05-21 12:22 |
|
Note Added: 0076054 | |
2018-05-21 12:22 |
|
Assigned To | msv => ifv |
2018-05-21 12:22 |
|
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 |
|
Note Added: 0076357 | |
2018-05-28 12:05 |
|
Assigned To | ifv => msv |
2018-05-28 12:05 |
|
Status | assigned => resolved |
2018-05-29 10:39 |
|
Note Added: 0076385 | |
2018-05-29 10:39 |
|
Assigned To | msv => ifv |
2018-05-29 10:39 |
|
Status | resolved => assigned |
2018-06-04 12:15 | git | Note Added: 0076581 | |
2018-06-04 14:21 |
|
Assigned To | ifv => msv |
2018-06-04 14:21 |
|
Status | assigned => resolved |
2018-06-04 14:21 |
|
Steps to Reproduce Updated | |
2018-06-05 10:58 | git | Note Added: 0076603 | |
2018-06-05 10:59 |
|
Note Added: 0076604 | |
2018-06-05 11:05 |
|
Note Added: 0076606 | |
2018-06-05 11:05 |
|
Assigned To | msv => bugmaster |
2018-06-05 11:05 |
|
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 |
|
Note Added: 0076620 | |
2018-06-05 15:30 |
|
Assigned To | msv => ifv |
2018-06-05 15:30 |
|
Status | feedback => assigned |
2018-06-09 14:12 | git | Note Added: 0076694 | |
2018-06-09 14:14 |
|
Note Added: 0076695 | |
2018-06-09 14:14 |
|
Assigned To | ifv => msv |
2018-06-09 14:14 |
|
Status | assigned => resolved |
2018-06-09 17:57 |
|
Note Added: 0076708 | |
2018-06-09 17:57 |
|
Assigned To | msv => bugmaster |
2018-06-09 17:57 |
|
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 |
|
Note Added: 0076764 | |
2018-06-14 11:46 |
|
Assigned To | msv => ifv |
2018-06-14 11:46 |
|
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 |
|
Note Added: 0076768 | |
2018-06-14 13:32 |
|
Assigned To | ifv => msv |
2018-06-14 13:32 |
|
Status | assigned => resolved |
2018-06-14 14:25 |
|
Note Added: 0076770 | |
2018-06-14 14:25 |
|
Assigned To | msv => bugmaster |
2018-06-14 14:25 |
|
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 |