View Issue Details

IDProjectCategoryView StatusLast Update
0032716Open CASCADEOCCT:Modeling Algorithmspublic2022-05-18 15:36
Reporterkgv Assigned Toabulychev-ext  
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Product Version7.6.0 
Target Version7.7.0 
Summary0032716: Modeling Algorithms - BRepBuilderAPI_Transform discards triangulation
DescriptionBRepBuilderAPI_ModifyShape has severe issue in handling faces - existing triangulation is always removed.
This leads to two issues:
- User has to re-triangulate shape, which might be much more expensive than transforming triangulation nodes.
- Triangulation-only shapes are corrupted or lead to NULL-dereference in algorithm.
Steps To Reproduce
pload MODELING
psphere s 1
incmesh s 1
trinfo s
tscale s 0 0 0 0.5
trinfo s
# KO - triangulation is empty

incmesh s 1
tclean -geom s
tscale s 0 0 0 0.5
# KO - crash in the algorithm
trinfo s
TagsNo tags attached.
Test case number

Relationships

related to 0031479 newabulychev-ext Community Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface) 
child of 0028125 newmsv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 

Activities

git

2022-04-01 16:45

administrator   ~0107545

Branch CR32716 has been created by AndreyLA.

SHA-1: 6260a581acda84cfc96c5c2589b21b36dd09651a


Detailed log of new commits:

Author: Andrei LATYSHEV
Date: Fri Apr 1 16:45:02 2022 +0300

    0032716: Modeling Algorithms - BRepBuilderAPI_Transform discards triangulation
    
    The methods for BRepTools_TrsfModification are defined and modified to keep the triangulation during 'tscale' operation.

kgv

2022-04-03 15:02

developer   ~0107572

+    //Applying the transformation to each node of triangulation
+    aP = theTriangulation->Node(i).Transformed(myTrsf);
+    theTriangulation->SetNode(i, aP);

It might be better adding the method `Poly_Triangulation::Transform (const gp_Trsf& theT)` / `Poly_Polygon3D::Transform()`.
It is not enough transforming triangulation nodes, normals should be transformed as well.

+Standard_EXPORT Standard_Boolean BRepTools_TrsfModification::NewPolygon

`Standard_EXPORT` should not appear in .cxx files.

+    TColgp_Array1OfPnt aNodesArray = aPolygon->Nodes();

Would be nice adding `Poly_Polygon3D::Copy()` for consistency with other classes.

git

2022-04-04 11:28

administrator   ~0107584

Branch CR32716 has been updated by AndreyLA.

SHA-1: f103aaf0b774ec20944279f60fbb6ba484712a57


Detailed log of new commits:

Author: Andrei LATYSHEV
Date: Mon Apr 4 11:28:10 2022 +0300

    0031479: Modeling Algorithms - exception on geometry transformation of triangulation-only shapes (without geometry surface)
    
    Added test for user's problem case

git

2022-04-04 18:54

administrator   ~0107598

Branch CR32716 has been updated forcibly by AndreyLA.

SHA-1: 032b35fe3756570da94b8000b649d90af95c768c

kgv

2022-04-04 19:32

developer   ~0107600

+    aV = gp_Vec(myNormals(i).x(), myNormals(i).y(), myNormals(i).z()).Transformed(theT);
+    Standard_Real aCoef = aV.Magnitude();
+    aV = aV / aCoef;

Normal vectors couldn't be transformed like that - see gp_Dir::Transform() implementation.

+  // Apply the transformation to the triangulation
+  Standard_EXPORT void Transform(const gp_Trsf& theT);

`//!`

+  for (Standard_Integer i = 1; i < myNodes.Length(); ++i)
+  {

Indexation of `myNodes` doesn't start from `1`.

+//function : RemoveNormals
+//purpose  :
+//=======================================================================
+void Poly_Triangulation::Transform(const gp_Trsf& theT)

Inconsistent header.

git

2022-04-05 13:15

administrator   ~0107637

Branch CR32716 has been updated forcibly by AndreyLA.

SHA-1: 18006ef5d72ea6c26c6db5d286523b8771b26b8c

git

2022-04-20 17:14

administrator   ~0108051

Branch CR32716_1 has been created by abulychev-ext.

SHA-1: ab0770a8a2ece7d17f10b87bb66999d6232c35d9


Detailed log of new commits:

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

    0032716: Modeling Algorithms - BRepBuilderAPI_Transform discards triangulation
    
    Added the test to reproduce this problem.
    The methods for BRepTools_TrsfModification are defined and modified to keep the triangulation during 'tscale' operation.

git

2022-04-25 11:43

administrator   ~0108143

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: c60dffcbd8213545868226ea5988cb3d1d56ed8a

git

2022-04-27 20:51

administrator   ~0108229

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: 0f03881816c15a866589716244c521a54ee9b3cd

git

2022-04-28 03:00

administrator   ~0108230

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: bc663ebe7339d8506c1f7151760e279f3ca26c79

git

2022-05-03 14:23

administrator   ~0108284

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: 119d50b9108dafa8cccddc29b7ba3fcb0f3768ca

kgv

2022-05-04 14:42

developer   ~0108303

It is desired to create screenshots within the test to be able to verify visually that transformed mesh has correct vertex normals.
+++ b/tests/bugs/mesh/bug32716

git

2022-05-05 01:50

administrator   ~0108330

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: 4f79f2608234a088a9e62f6d87505d525f795b5c

git

2022-05-16 14:55

administrator   ~0108443

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: fccc483a4a4d1e50fe65d67666cc04b3c5cdcb7d

git

2022-05-16 16:47

administrator   ~0108447

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: d0f2f33afec724c570e5cb7481b5d94367b1313b

git

2022-05-17 20:07

administrator   ~0108476

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: da5f2b9674fe02cd4cf70e2e60fc78b9e484682b

git

2022-05-18 15:36

administrator   ~0108485

Branch CR32716_1 has been updated forcibly by abulychev-ext.

SHA-1: b4f9584d53ed31ef06f75003d2dc1566a9b67c65

Issue History

Date Modified Username Field Change
2021-12-06 21:23 kgv New Issue
2021-12-06 21:23 kgv Assigned To => msv
2021-12-06 21:24 kgv Relationship added child of 0028125
2022-03-21 20:25 azv Assigned To msv => AndreyLA
2022-03-21 20:25 azv Status new => assigned
2022-03-24 11:54 azv Relationship added related to 0031479
2022-04-01 16:45 git Note Added: 0107545
2022-04-03 15:02 kgv Note Added: 0107572
2022-04-04 11:28 git Note Added: 0107584
2022-04-04 18:54 git Note Added: 0107598
2022-04-04 19:32 kgv Note Added: 0107600
2022-04-05 13:15 git Note Added: 0107637
2022-04-15 12:42 azv Assigned To AndreyLA => abulychev-ext
2022-04-20 17:14 git Note Added: 0108051
2022-04-25 11:43 git Note Added: 0108143
2022-04-27 20:51 git Note Added: 0108229
2022-04-28 03:00 git Note Added: 0108230
2022-05-03 14:23 git Note Added: 0108284
2022-05-04 14:42 kgv Note Added: 0108303
2022-05-05 01:50 git Note Added: 0108330
2022-05-16 14:55 git Note Added: 0108443
2022-05-16 16:47 git Note Added: 0108447
2022-05-17 20:07 git Note Added: 0108476
2022-05-18 15:36 git Note Added: 0108485