View Issue Details

IDProjectCategoryView StatusLast Update
0031479CommunityOCCT:Modeling Algorithmspublic2023-03-19 19:29
ReporterVico Liang Assigned Toazv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.3.1 
Target Version7.7.0Fixed in Version7.6.3 
Summary0031479: Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)
DescriptionThe uploaded file just with shape with triangles, without geometry surface.

It works when apply move and rotate operation. it's break with scale or mirror.

Neither BRepBuilderAPI_Transform or BRepBuilderAPI_GTransform works with scale or mirror transform.
Steps To Reproduce
test de_mesh obj_read prism 1
XGetOneShape s D
tscale s 0 0 0 10


Result:
An exception was caught 000001F39E054090 : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000000 during 'READ' operation
** Exception ** 000001F39E054090 : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at address 0x0000000000000000 during 'READ' operation
TagsNo tags attached.
Test case numberbugs/modalg_8/bug31479_1, bug31479_2

Attached Files

  • P-51 Mustang 2.brep (611,453 bytes)

Relationships

related to 0032716 closedabulyche Open CASCADE Modeling Algorithms - BRepBuilderAPI_Transform discards triangulation 
related to 0032717 closedsmoskvin Open CASCADE Modeling Algorithms - BRepBuilderAPI_Copy should not remove triangulation from surface-less faces 
child of 0028125 newmsv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 

Activities

Vico Liang

2020-04-01 18:40

developer  

P-51 Mustang 2.brep (611,453 bytes)

git

2022-06-29 15:39

administrator   ~0109385

Branch CR31479 has been created by abulychev-ext.

SHA-1: c2491d80fcd9e53fdd512427e2051264ad711276


Detailed log of new commits:

Author: abulyche
Date: Wed Apr 20 17:14:07 2022 +0300

    0031479: Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)
    
    Added the test to reproduce this problem.
    The methods for BRepTools_TrsfModification are defined and modified to keep the triangulation during 'tscale' operation (without geometry).

git

2022-06-29 16:13

administrator   ~0109391

Branch CR31479 has been updated forcibly by abulychev-ext.

SHA-1: 4efe578d4e0bddbfe35bada66ee20c92d5a628c9

git

2022-06-30 11:47

administrator   ~0109412

Branch CR31479 has been updated forcibly by abulychev-ext.

SHA-1: e8adcb8b64adc916eec8ab61cc62da03f6626ba6

azv

2022-07-05 12:41

administrator   ~0109566

Please, review OCCT branch CR32716_2.
Test results: http://jenkins-test-occt/view/CR32716_2-master-AZV/view/COMPARE/

msv

2022-07-06 17:50

developer   ~0109624

src/BRepTools/BRepTools_GTrsfModification.hxx
Please use coding rules for new code.

It is needed to invalidate myCachedMinMax of the copy.
  theTriangulation = theTriangulation->Copy();

Use const&
      Poly_Triangle aTria = theTriangulation->Triangle(anInd);

It is needed to check if the face contains a surface. Also, newUV returns bool that is not checked.
  if (theTri->HasUVNodes())
  {
    Standard_Real aTol = BRep_Tool::Tolerance(theFace);
    for (Standard_Integer anInd = 1; anInd <= theTri->NbNodes(); ++anInd)
    {
      gp_Pnt2d aP2d = theTri->UVNode(anInd);
      newUV(aP2d, theFace, myMap, aTol);
      theTri->SetUVNode(anInd, aP2d);
    }
  }

It is needed to check if the surface and curve 2d are not null.
  if (thePoly->HasParameters())
  {
    Standard_Real aTol = Max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection());
    TopLoc_Location aLoc;
    Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
    Standard_Real aFirst, aLast;
    Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast);

The edge can be not SameParameter. Therefore, it is incorrect to project 3D point on 3D curve. Instead, it is needed to project the 2D point on the new 2D curve. Or, may be project 3D point on new surface, and then the result new 2D point to the new 2D curve.
      Standard_Real aParam = thePoly->Parameter(anInd);
      gp_Pnt2d aUV = aC2d->Value(aParam);
      gp_Pnt aPoint = aSurf->Value(aUV.X(), aUV.Y());
      newParameter(aPoint, theEdge, myMap, aParam, aTol);
      thePoly->SetParameter(anInd, aParam);

git

2022-07-06 22:26

administrator   ~0109632

Branch CR31479_2 has been created by azv.

SHA-1: 7e67daf439289153bdb47927a345afedc0bdbd6d


Detailed log of new commits:

Author: azv
Date: Wed Jul 6 17:25:10 2022 +0300

    # remarks

Author: azv
Date: Fri Jul 1 16:46:55 2022 +0300

    0031479: Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)
    
    * Avoid crash in BRepBuilderAPI_GTransform algorithm. The crash in BRepBuilder_Transform has been solved by 0032716.
    * Move copying modifier to BRepTools package.
    * Implement copying of triangulation in BRepTools_NurbsConvertModification.
    * Implement transformation of a triangulation in BRepTools_GTrsfModification.
    * Update test case bugs/mesh/bug22778 to clean the triangulation after conversion to NURBS (reproduce the same behavior as before).

git

2022-07-07 07:11

administrator   ~0109643

Branch CR31479_2 has been updated forcibly by azv.

SHA-1: 8bc2a6d2cad07fba6fff16266e41c2362dd9d7f6

git

2022-07-07 16:48

administrator   ~0109672

Branch CR31479_2 has been updated forcibly by azv.

SHA-1: 2a4e9272ea19a5771e7ee07e0d5c049653684667

azv

2022-07-07 21:53

administrator   ~0109678

Mikhail, please review OCCT branch CR31479_2.
Branch CR32716_3 contains the same changes, but squashed to a single commit.
Test results: http://jenkins-test-occt/view/CR32716_3-master-AZV/view/COMPARE/

msv

2022-07-08 00:22

developer   ~0109679

src/BRepTools/BRepTools_GTrsfModification.hxx
108: theTri

src/BRepTools/BRepTools_NurbsConvertModification.cxx
921: it is incorrect to use 3D tolerance to compare 2D points.

git

2022-07-08 06:22

administrator   ~0109680

Branch CR31479_2 has been updated by azv.

SHA-1: 248e6faf85f1ae8c5aace4dfec129a6a7c45b7d1


Detailed log of new commits:

Author: azv
Date: Fri Jul 8 06:22:42 2022 +0300

    # remarks 2

azv

2022-07-08 14:02

administrator   ~0109691

Remarks were fixed. Please, review once again.

msv

2022-07-08 15:48

developer   ~0109696

For integration:
occt - CR32716_3
products - none

smoskvin

2022-07-10 11:22

administrator   ~0109720

Combination -
OCCT branch : IR-2022-07-08
master SHA - changes and them, and you can discard any commits you make in this
33c8a72788661285860902f261062e39f32a2d46
changes and them, and you can discard any commits you make in this
e0ceb716c70188b98130b1550914140d0502a6f9
Products branch : IR-2022-07-08 SHA - 79a687f1cd4081ec53ec08c201360e89fce62abc
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: 18685.930000000586 / 18908.870000000694 [-1.18%]
Products
Total CPU difference: 11796.890000000125 / 11832.130000000114 [-0.30%]
Windows-64-VC14:
OCCT
Total CPU difference: 20784.828125 / 20752.59375 [+0.16%]
Products
Total CPU difference: 13361.3125 / 13368.90625 [-0.06%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-07-10 12:08

administrator   ~0109722

Branch CR31479 has been deleted by mnt.

SHA-1: e8adcb8b64adc916eec8ab61cc62da03f6626ba6

git

2022-07-10 12:08

administrator   ~0109723

Branch CR31479_2 has been deleted by mnt.

SHA-1: 248e6faf85f1ae8c5aace4dfec129a6a7c45b7d1

Related Changesets

occt: master 33c8a727

2022-07-01 16:46:55

azv


Committer: smoskvin Details Diff
0031479: Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)

* Avoid crash in BRepBuilderAPI_GTransform algorithm. The crash in BRepBuilder_Transform has been solved by 0032716.
* Move copying modifier to BRepTools package.
* Implement copying of triangulation in BRepTools_NurbsConvertModification.
* Implement transformation of a triangulation in BRepTools_GTrsfModification.
* Update test case bugs/mesh/bug22778 to clean the triangulation after conversion to NURBS (reproduce the same behavior as before).
Affected Issues
0031479
mod - src/BRepBuilderAPI/BRepBuilderAPI_Copy.cxx Diff File
add - src/BRepTools/BRepTools_CopyModification.cxx Diff File
add - src/BRepTools/BRepTools_CopyModification.hxx Diff File
mod - src/BRepTools/BRepTools_GTrsfModification.cxx Diff File
mod - src/BRepTools/BRepTools_GTrsfModification.hxx Diff File
mod - src/BRepTools/BRepTools_NurbsConvertModification.cxx Diff File
mod - src/BRepTools/BRepTools_NurbsConvertModification.hxx Diff File
mod - src/BRepTools/FILES Diff File
mod - tests/bugs/mesh/bug22778 Diff File
add - tests/bugs/modalg_8/bug31479_1 Diff File
add - tests/bugs/modalg_8/bug31479_2 Diff File

Issue History

Date Modified Username Field Change
2020-04-01 18:40 Vico Liang New Issue
2020-04-01 18:40 Vico Liang Assigned To => msv
2020-04-01 18:40 Vico Liang File Added: P-51 Mustang 2.brep
2020-05-08 00:24 kgv Summary Throw when scale or mirror shapes without geometry surface. => Modeling Algorithms - Throw when scale or mirror shapes without geometry surface.
2020-05-08 00:28 kgv Relationship added child of 0028125
2020-05-08 00:29 kgv Summary Modeling Algorithms - Throw when scale or mirror shapes without geometry surface. => Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)
2020-05-08 00:36 kgv Steps to Reproduce Updated
2020-05-08 00:36 kgv Product Version => 6.3.1
2020-09-15 11:58 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:53 msv Target Version 7.6.0 => 7.7.0
2022-03-24 11:54 azv Relationship added related to 0032716
2022-03-24 11:54 azv Relationship added related to 0032717
2022-04-15 12:42 azv Assigned To msv => abulychev-ext
2022-06-29 15:39 git Note Added: 0109385
2022-06-29 16:13 git Note Added: 0109391
2022-06-30 11:47 git Note Added: 0109412
2022-07-02 15:44 azv Assigned To abulychev-ext => azv
2022-07-02 15:44 azv Status new => assigned
2022-07-05 12:41 azv Assigned To azv => msv
2022-07-05 12:41 azv Status assigned => resolved
2022-07-05 12:41 azv Note Added: 0109566
2022-07-06 17:50 msv Note Added: 0109624
2022-07-06 17:50 msv Assigned To msv => azv
2022-07-06 17:50 msv Status resolved => assigned
2022-07-06 22:26 git Note Added: 0109632
2022-07-07 07:11 git Note Added: 0109643
2022-07-07 16:48 git Note Added: 0109672
2022-07-07 21:53 azv Assigned To azv => msv
2022-07-07 21:53 azv Status assigned => resolved
2022-07-07 21:53 azv Note Added: 0109678
2022-07-07 21:54 azv Test case number => bugs/modalg_8/bug31479_1, bug31479_2
2022-07-08 00:22 msv Note Added: 0109679
2022-07-08 00:22 msv Assigned To msv => azv
2022-07-08 00:22 msv Status resolved => assigned
2022-07-08 06:22 git Note Added: 0109680
2022-07-08 14:02 azv Assigned To azv => msv
2022-07-08 14:02 azv Status assigned => resolved
2022-07-08 14:02 azv Note Added: 0109691
2022-07-08 15:48 msv Assigned To msv => bugmaster
2022-07-08 15:48 msv Status resolved => reviewed
2022-07-08 15:48 msv Note Added: 0109696
2022-07-10 11:22 smoskvin Status reviewed => tested
2022-07-10 11:22 smoskvin Note Added: 0109720
2022-07-10 12:03 smoskvin Changeset attached => occt master 33c8a727
2022-07-10 12:03 azv Assigned To bugmaster => azv
2022-07-10 12:03 azv Status tested => verified
2022-07-10 12:03 azv Resolution open => fixed
2022-07-10 12:08 git Note Added: 0109722
2022-07-10 12:08 git Note Added: 0109723
2023-03-19 19:29 vglukhik Status verified => closed
2023-03-19 19:29 vglukhik Fixed in Version => 7.6.3