View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030365 | Open CASCADE | OCCT:Modeling Algorithms | public | 2018-11-12 16:48 | 2023-02-03 04:56 |
Reporter | Assigned To | ||||
Priority | normal | Severity | integration request | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.7.0 | Fixed in Version | 7.7.0 | ||
Summary | 0030365: Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment | ||||
Description | See the message 0029203:0071647. Namely << 3. Improve the algorithm of computation of deflection between discrete polygon and source curve (see method BRepTopAdaptor_FClass2d::Init()). Currently, the computed deflection is equal to the length of projection of middle-point of arc to the chord. New algorithm can be based on GCPnts_DistFunction2d class or can use simple iteration formula (obtained if we apply Newton-algorithm to GCPnts_DistFunction2d function): U(n+1)=U(n)-(C'(Un).Crossed(D))/(C''(U(n)).Crossed(D)) where C' and C'' are 1st and 2nd derivative of the curve, obtained in the point U(n), D - direction of the segment of the polygon. Please note that this formula is satisfied for 2D-space only. For 3D-algorithm it will look more complexly. | ||||
Steps To Reproduce | All necessary test cases have already been created and pushed to the branch. | ||||
Tags | No tags attached. | ||||
Test case number | lowalgos/2ddeviation/A1, A2, A3 | ||||
|
Branch CR30365 has been created by nbv. SHA-1: ee7f6f2b73926ff91d2f109f8c8ad78503365f22 Detailed log of new commits: Author: nbv Date: Mon Nov 12 17:00:06 2018 +0300 0030365: Create tool to compute deviation between any 2D-curve and some its segment The tool, DRAW-command for its check and corresponding test cases have been created. See documentation about new tool in GeomLib_Tool.hxx file. |
|
Dear Mikhail, Please review CR30365 branch. Test results: http://jenkins-test-12.nnov.opencascade.com/view/CR30365-master_NBV/ |
|
Branch CR30365 has been updated forcibly by nbv. SHA-1: 426649480dc1abc50e5ec1f1ea1e2b1c43b9f83c |
|
Branch has been rebased on current MASTER. |
|
src/GeomliteTest/GeomliteTest_API2dCommands.cxx - 560: incorrect usage string, does not correspond to help. |
|
Branch CR30365 has been updated forcibly by nbv. SHA-1: 2a5e819d71838ad1b3869e48400cfcd7cc6ee587 |
|
Done. The branch CR30365 has been rebased on current MASTER. |
|
Branch CR30365_1 has been created by asuraven. SHA-1: 43bb59f4e0d2ca998a975c76a7842cd7aeaa8b86 Detailed log of new commits: Author: nbv Date: Mon Nov 12 17:00:06 2018 +0300 0030365: Create tool to compute deviation between any 2D-curve and some its segment The tool, DRAW-command for its check and corresponding test cases have been created. See documentation about new tool in GeomLib_Tool.hxx file. |
|
Branch CR30365_1 has been updated forcibly by asuraven. SHA-1: 7ff8caf8ef6d9fed923a1da1e151b71d0492eca9 |
|
Issue has been rebased on current master in branch CR30365_1 Tests results: http://jenkins-test-occt/view/CR30365_1-master-ASURAVEN/view/COMPARE/ |
|
It is needed to check why the test has failed: sat read_parallel_1 C8 |
|
Also, the difference in images seems to be something new: IMAGE sat doc_6 D5: D5.png differs [2002 different pixels] |
|
> Also, the difference in images seems to be something new: > IMAGE sat doc_6 D5: D5.png differs [2002 different pixels] I guess this one is an artifact of Jenkins preparation to OCCT 7.6.0 release (reference version is not master). |
|
The new method is named ComputeDevation. Please remane it to ComputeDeviation. The help of the command 2ddeviation has no description of options. This description is available when the command is run with less than 2 arguments. This logic is strange. It is better to extend the help, and output an error message if the arguments number is not enough. In the command 2ddeviation the parameter theNbIters in calls to the computation methods is hard-coded as 10 and 100. It is better to add new cmd parameters for that. |
|
|
|
Branch CR30365_1 has been updated forcibly by asuraven. SHA-1: 6d6678fe170161b839f6b06d7c3eeb6c3e8aa1ac |
|
Branch CR30365_1 has been updated forcibly by asuraven. SHA-1: 05ba967fac8243b75a26d584035d9346920d4e9e |
|
Dear Michael, please review branch CR30365_1 Tests results are here: http://jenkins-test-occt.nnov.opencascade.com/view/CR30365_1-master-ASURAVEN/view/COMPARE/ |
|
--- a/src/GeomLib/GeomLib_Tool.cxx +++ b/src/GeomLib/GeomLib_Tool.cxx +class FuncSolveDeviation : public math_MultipleVarFunction Though unlikely, such definition might create name collisions in application symbols. Please put internal classes into nameless namespace. protected: - - - - private: While cleaning up the header - please remove redundant empty "protected" scope. + //! - theLine - the linear segment joining the point of theCurve having parameters + //! theFPar and theLPar. + Standard_EXPORT static + Standard_Real ComputeDeviation(const Geom2dAdaptor_Curve& theCurve, Please use Doxygen tags `@param` to document function parameters. - if (n == 2) + if (n == 2) . ... - + . Unrelated and undesired changes adding redundant trailing spaces. switch (T2) { - case GeomAbs_Line: - { + case GeomAbs_Line: + { Please revert. + theCommands.Add("2ddeviation", "deviation2d result curve [-i U0] [-d N] [-Napprox N] [-Nexact N] [-approxOnly]\n" Command names in description do not match. +// +// math_PSO Algorithm is used. +// +// ATTENTION!!! +// The main idea of this method is to obtain rough value of returned +// parameter (fast but not precisely). The found value can be precised +// by 2nd method GeomLib_Tool::ComputeDevation(...) (see above). +//======================================================================= +Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve, Please avoid duplication of method description - move details to .hxx. + inline void GetLine(gp_Lin2d* const theLine) const + { Redundant "inline". |
|
src/GeomliteTest/GeomliteTest_API2dCommands.cxx - misprint "deviation compiting", "mathod" - In the command help, it is not needed to put options in quotes. |
|
Branch CR30365_2 has been created by asuraven. SHA-1: 1f74dad55ecfea6a19c1e5746b2b0bffed22c09e Detailed log of new commits: Author: nbv Date: Mon Nov 12 17:00:06 2018 +0300 0030365: Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment The tool, DRAW-command for its check and corresponding test cases have been created. See documentation about new tool in GeomLib_Tool.hxx file. |
|
Remarks fixed in new branch CR30365_2 Tests are running now |
|
When using @param there is no sense in spaces and '-', e.g. change//! - @param thePtOnCurve - the point on curve where maximal deviation is achieved; to //! @param thePtOnCurve - the point on curve where maximal deviation is achieved; About moving details into header, I think it is better to leave the low-level description where local function FuncSolveDeviation is mentioned in the cxx file. Leave in the header only information that is needed to know to use this method. And please avoid duplication here. E.g., I see several duplications: //! Iterative method is used for computation. So, theStartParameter is //! needed to be set. Recommend value of theStartParameter can be found with //! the overloaded method. and //! 1. The computed value is heavily dependent on the theStartParameter. //! E.g. the method can reach a minimal value of the function instead of its //! maximal value. Or it can reach some local (not global) maximum. //! 2. Recommend value of theStartParameter can be found with //! 2nd method GeomLib_Tool::ComputeDevation (see below). //! The main idea of this method is to obtain rough value of returned //! parameter (fast but not precisely). The found value can be precised // !by 2nd method GeomLib_Tool::ComputeDevation(...) (see above). and //! This algorithm cannot compute deviation precisely (so, there is no point in //! setting big value of theNbIters). But it can give some start point for //! the overloaded method. // !by 2nd method GeomLib_Tool::ComputeDevation(...) (see above). Violation of doxygen syntax: "// !" |
|
remarks for comments fixed in same branch |
|
Branch CR30365_2 has been updated forcibly by asuraven. SHA-1: 2a817dd3526277cf04e49b6e9aaeeb24be3ee596 |
|
+//function : ComputeDevation ... +Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve, Name mismatch. + else if (!strcmp(theArgv[aCurrArg], "-Nexact")) It is not nice to perform case-sensitive comparison of such arguments. + char aBuff[1000]; + theDI << "Computed value is: " << aDefl << "\n"; + + Sprintf(aBuff, "%s_pnt", theArgv[1]); Please avoid fixed-size buffers - just use TCollection_AsciiString. + return Sqrt(Abs(aSqDefl)); Unexpected double space. + Standard_Real aSqDefl = -1.0; ... + return aSqDefl; ... + aSqDefl = RealLast(); + aMPSO.Perform(aStep, aSqDefl, anOutputPnt, theNbIters); What is the point initializing variable to -1.0 and then overriding it with RealLast()? Please just put "return -1.0;" instead. + const math_Vector aFPar(1, 1, theFPar); +//! Target function to compute deviation of the source +//! 2D-curve. It is one-variate function. Its parameter +//! is a parameter on the curve. Deviation is a maximal It looks nicer when line is interrupted at the end of sentence rather than one word before the end. |
|
Please consider remarks of Kirill. |
|
Branch CR30365_2 has been updated forcibly by asuraven. SHA-1: eeb8d7b0718815fa4ead0f549744b2cd3995a287 |
|
Kirill's remarks fixed in CR30365_2 branch |
|
For integration: occt - CR30365_2 products - none |
|
Andrey, current git commit description: 0030365: Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment The tool, DRAW-command for its check and corresponding test cases have been created. See documentation about new tool in GeomLib_Tool.hxx file. leaves reader in frustration as it teases with some new tool, some new command, but mentions neither of them! Could you please update issue title and git commit to mention clearly names of new method(s) and draw command(s)? |
|
Branch CR30365_2 has been updated forcibly by asuraven. SHA-1: 235fe0a5c5f6557f5095cfe5a378707609f8f888 |
|
commit description fixed |
|
Combination - OCCT branch : IR-2021-11-26 master SHA - 4a837ecec21bfe24d9c224c4b59aa9779156f297 49e51745631c52b6c452c65adae4d6dfa21a1b1e Products branch : IR-2021-11-26 SHA - 5da5872bffc6c1fa745ee5e33ac09c4fffd349b4 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: 18390.380000000398 / 18549.650000000624 [-0.86%] Products Total CPU difference: 11648.280000000103 / 11661.570000000122 [-0.11%] Windows-64-VC14: OCCT Total CPU difference: 19927.859375 / 19945.046875 [-0.09%] Products Total CPU difference: 13059.03125 / 13091.625 [-0.25%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR30365 has been deleted by mnt. SHA-1: 2a5e819d71838ad1b3869e48400cfcd7cc6ee587 |
|
Branch CR30365_1 has been deleted by mnt. SHA-1: 05ba967fac8243b75a26d584035d9346920d4e9e |
|
Branch CR30365_2 has been deleted by mnt. SHA-1: 235fe0a5c5f6557f5095cfe5a378707609f8f888 |
occt: master 323e88ad 2018-11-12 14:00:06
Committer: |
0030365: Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment Adds two new overloaded 'ComputeDeviation()' function (approx & exact) to GeomLib_Tool class to calculates the parameter in the curve where the maximum deviation is obtained between the curve and the line segment connecting its points with the specified parameters Adds new '2ddeviation' DRAW command for 'ComputeDeviation()' functional testing |
Affected Issues 0030365 |
|
mod - src/GeomLib/GeomLib_Tool.cxx | Diff File | ||
mod - src/GeomLib/GeomLib_Tool.hxx | Diff File | ||
mod - src/GeomliteTest/GeomliteTest_API2dCommands.cxx | Diff File | ||
add - tests/lowalgos/2ddeviation/A1 | Diff File | ||
add - tests/lowalgos/2ddeviation/A2 | Diff File | ||
add - tests/lowalgos/2ddeviation/A3 | Diff File | ||
mod - tests/lowalgos/grids.list | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-11-12 16:48 |
|
New Issue | |
2018-11-12 16:48 |
|
Assigned To | => msv |
2018-11-12 16:48 |
|
Assigned To | msv => nbv |
2018-11-12 16:48 |
|
Status | new => assigned |
2018-11-12 16:51 |
|
Severity | minor => integration request |
2018-11-12 16:52 |
|
Relationship added | related to 0029203 |
2018-11-12 17:02 | git | Note Added: 0081063 | |
2018-11-13 09:28 |
|
Note Added: 0081065 | |
2018-11-13 09:28 |
|
Assigned To | nbv => msv |
2018-11-13 09:28 |
|
Status | assigned => resolved |
2018-11-13 09:28 |
|
Steps to Reproduce Updated | |
2018-11-19 10:04 | git | Note Added: 0081162 | |
2018-11-19 10:43 |
|
Note Added: 0081163 | |
2018-11-23 12:57 |
|
Relationship added | related to 0029421 |
2018-12-03 16:27 |
|
Note Added: 0081366 | |
2018-12-04 10:07 | git | Note Added: 0081378 | |
2018-12-04 10:07 |
|
Note Added: 0081379 | |
2018-12-04 10:08 |
|
Note Edited: 0081379 | |
2019-07-18 12:34 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-14 23:03 |
|
Status | resolved => feedback |
2020-09-14 23:03 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-08-29 18:24 |
|
Target Version | 7.6.0 => 7.7.0 |
2021-08-29 18:26 |
|
Status | feedback => resolved |
2021-11-15 12:55 |
|
Assigned To | msv => asuraven |
2021-11-15 13:58 | kgv | Summary | Create tool to compute deviation between any 2D-curve and some its segment => Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment |
2021-11-15 14:30 | git | Note Added: 0105195 | |
2021-11-15 14:31 | git | Note Added: 0105196 | |
2021-11-15 17:50 |
|
Assigned To | asuraven => msv |
2021-11-15 17:52 |
|
Note Added: 0105199 | |
2021-11-16 10:38 |
|
Note Added: 0105205 | |
2021-11-16 10:40 |
|
Note Added: 0105206 | |
2021-11-16 11:07 | kgv | Note Added: 0105207 | |
2021-11-16 11:07 | kgv | Note Edited: 0105207 | |
2021-11-16 12:32 |
|
Note Added: 0105210 | |
2021-11-16 12:33 |
|
Assigned To | msv => asuraven |
2021-11-16 12:33 |
|
Status | resolved => assigned |
2021-11-18 18:28 |
|
Note Added: 0105246 | |
2021-11-22 14:01 | git | Note Added: 0105350 | |
2021-11-22 16:41 | git | Note Added: 0105357 | |
2021-11-23 13:11 |
|
Note Added: 0105370 | |
2021-11-23 13:11 |
|
Assigned To | asuraven => msv |
2021-11-23 13:11 |
|
Status | assigned => resolved |
2021-11-23 15:16 | kgv | Note Added: 0105372 | |
2021-11-23 23:07 |
|
Note Added: 0105384 | |
2021-11-23 23:07 |
|
Assigned To | msv => asuraven |
2021-11-23 23:07 |
|
Status | resolved => assigned |
2021-11-24 18:36 | git | Note Added: 0105395 | |
2021-11-24 18:40 |
|
Note Added: 0105396 | |
2021-11-24 18:40 |
|
Assigned To | asuraven => msv |
2021-11-24 18:40 |
|
Status | assigned => resolved |
2021-11-24 19:20 |
|
Note Added: 0105397 | |
2021-11-24 19:21 |
|
Note Edited: 0105397 | |
2021-11-24 19:22 |
|
Assigned To | msv => asuraven |
2021-11-24 19:22 |
|
Status | resolved => assigned |
2021-11-24 20:16 |
|
Note Added: 0105402 | |
2021-11-24 20:16 |
|
Assigned To | asuraven => msv |
2021-11-24 20:16 |
|
Status | assigned => resolved |
2021-11-24 20:17 | git | Note Added: 0105404 | |
2021-11-24 21:20 | kgv | Note Added: 0105406 | |
2021-11-24 23:28 |
|
Note Added: 0105407 | |
2021-11-24 23:28 |
|
Assigned To | msv => asuraven |
2021-11-24 23:28 |
|
Status | resolved => assigned |
2021-11-25 14:21 | git | Note Added: 0105419 | |
2021-11-25 14:22 |
|
Note Added: 0105420 | |
2021-11-25 14:22 |
|
Assigned To | asuraven => msv |
2021-11-25 14:22 |
|
Status | assigned => resolved |
2021-11-25 18:42 |
|
Note Added: 0105428 | |
2021-11-25 18:42 |
|
Assigned To | msv => bugmaster |
2021-11-25 18:42 |
|
Status | resolved => reviewed |
2021-11-25 20:41 | kgv | Note Added: 0105436 | |
2021-11-25 20:41 | kgv | Assigned To | bugmaster => asuraven |
2021-11-25 20:41 | kgv | Status | reviewed => feedback |
2021-11-25 20:41 | kgv | Note Edited: 0105436 | |
2021-11-26 11:31 | git | Note Added: 0105445 | |
2021-11-26 11:32 |
|
Note Added: 0105446 | |
2021-11-26 11:32 |
|
Assigned To | asuraven => msv |
2021-11-26 11:32 |
|
Status | feedback => resolved |
2021-11-26 12:21 |
|
Assigned To | msv => kgv |
2021-11-26 12:26 | kgv | Assigned To | kgv => bugmaster |
2021-11-26 12:26 | kgv | Status | resolved => reviewed |
2021-11-27 14:25 |
|
Note Added: 0105470 | |
2021-11-27 14:25 |
|
Status | reviewed => tested |
2021-11-27 14:28 |
|
Test case number | => lowalgos/2ddeviation/A1, A2, A3 |
2021-11-27 14:52 |
|
Changeset attached | => occt master 323e88ad |
2021-11-27 14:52 |
|
Assigned To | bugmaster => smoskvin |
2021-11-27 14:52 |
|
Status | tested => verified |
2021-11-27 14:52 |
|
Resolution | open => fixed |
2021-11-27 15:04 | git | Note Added: 0105478 | |
2021-11-27 15:04 | git | Note Added: 0105479 | |
2021-11-27 15:04 | git | Note Added: 0105480 | |
2023-02-03 04:56 | vglukhik | Status | verified => closed |
2023-02-03 04:56 | vglukhik | Fixed in Version | => 7.7.0 |