Archived issue #0032253

Mesh - The refactored Mesher fails to mesh correctly scaled (planar) faces

CommunityOCCT:Meshclosed27 public notes

Search issues

Description

This is a regression of the refactored Mesher introduced in 7.4.0 release. The refactored mesher incorrectly meshes the scaled faces.

Check the images and the model attached.

Steps to reproduce

XOpen Attachment 6 (XBF) a
vinit
XDisplay a -dispMode 1

Public activity

27 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Dzmitry Razmyslovich
Date: Sat Mar 27 19:38:16 2021 +0100

    0032253: Fix the incorrect parameters for end points - get parameters directly from curve instead of relying on the parameter provider
02Author
Hello, Oleg.

I am not sure if the fix I propose is the best one. Most probably, it is better to fix the parameter provider to gracefully handle the scaled (at least) planes. As far as I understand, currently for planes the parameters provider just projects a point on plane without taking the scaling into account which results in an error.

My fix demonstrates where the problem is located and fixes the problem in my particular case, therefore I haven't investigated it further.

[signature removed]
Dima

03Commenter 3
Hello Dmitry,

Please see the bug #0027457. We are going to forbid storing a location with scale factor in shapes. Instead, when one wants to scale a shape he should use the algorithm BRepBuilderAPI_Transform that will modify the geometry.

Even if your current patch fixes this particular problem with a scaled shape, you may face the same-cause problem in many other OCCT algorithms.

So, please think about using BRepBuilderAPI_Transform instead of patching OCCT codes against this issue.

[signature removed]
Mikhail
04Author
Hello, Mikhail,

thank you very much for providing this valuable information. We will adapt our code to have no scaling in the transformation matrices.

Do you also plan in the context of 0027457 to add some compatibility code for 'old' native occ files, which contain shapes with scaling transforms? Or should we develop such compatibility code ourselves? Our customers have definitely tons of projects with such xbf files.

[signature removed]
Dima
05Commenter 5
I will pass this wish into that ticket. We will try to consider it.
06Commenter 6
Dear Commenter 1, please close this bug.
07Commenter 3
Oleg,

could you please take a look onto proposed patch and comment if it looks reasonable / should be moved to another location?

I would prefer integrating a fix into BRepMesh if it would not require dramatic rewriting, as preventing scale factor in TopLoc_Location by #0027457 could take much time and we do not have yet elaborated when and how it will be raised.
08Commenter 4
DC,

Patch looks appropriate for this particular issue.
As I can see, in general case there are only two points for each edge in this case and modification works pretty well.

However, personally, I am concerned about scaled non-planar cases, i.e. NURBS when more than two points exist for each edge.

Dima, do you have any use cases of such shapes?
09Author
I will check and either find such a model or ask to create one.
10Commenter 2
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Wed Mar 31 14:54:00 2021 +0300

    0032253: Mesh - The refactored Mesher fails to mesh correctly scaled (planar) faces
    
    IMeshTools_ShapeExplorer: process face without any transformation
11Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 4.

[revision removed]
12Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 4.

[revision removed]
13Commenter 2
Branch [archived branch] has been updated by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Fri Apr 2 11:46:35 2021 +0300

    0032253: Mesh - The refactored Mesher fails to mesh correctly scaled (planar) faces
    
    IMeshTools_ShapeExplorer: use transformation without scale factor

14Commenter 2
Branch [archived branch] has been created by Commenter 4.

[revision removed]


No new revisions were added by this update.
15Commenter 4
Hello Dima,

I have checked your patch and added two alternative variants to fix the problem on common level (see commits in CR32253_base and CR32253).

However, all of them contain regressions due to which they could not be integrated yet.

The most stable is CR0032253 - leads mostly to absence of some triangles in the mesh along the frontier edges.

CR32253_base - it contains mostly async edges problem when points related to shared edges do not coincide on adjacent faces. In some specific cases where face has huge gaps between ends of the edges, triangulation could be absent.

CR32253 - produces the most number of regressions of the same nature as previous one.
16Commenter 4
17Commenter 17
According to the test results, none of the proposed patches passed the tests.
18Commenter 4
Yes, what do you think about further steps, should we wait for the patch #0027457 as a common solution or, maybe, some ideas regarding finalization of this one?
19Commenter 19
So, I again propose to close this bug.
20Commenter 3
> So, I again propose to close this bug.
OK, if solving the issue requires unjustified efforts for use case, that we would like to disallow at all, then it looks unreasonable pushing it forward.

21Commenter 21
Dear Commenter 1, please close this bug.
22Author
Dear Mikhail, Oleg and kgv,

thanks a lot for looking into the issue, considering my fix and proposing other fixes. We will then fix the issue on our end avoiding the scaled shapes to be produced.

[signature removed]
Dima
23Commenter 2
Branch [archived branch] has been deleted by Commenter 4.

[revision removed]
24Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
25Commenter 2
Branch [archived branch] has been created by [email removed] in OCCT Products internal repository.

[revision removed]


26Commenter 2
Branch [archived branch] has been updated by [email removed] in OCCT Products internal repository.

[revision removed]


27Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records