A pmc method question

R G W

CAD community veteran
I'm trying use pmc method on a stp model.
But it doesn't work, it seems like there is a face in the model can not get Poly_Triangulation.
How can i solve this problem?
Thanks for your help as always.
 

Quaoar

Administrator
Staff member
PMC tools normally assume you have a solid input. In your case, it's an assembly containing open shells and sometimes faces whose orientation looks flipped. See gray faces and red edges here:

1672406087468.png

This input makes me think that you're trying to conduct PMC for an assembly. If so, can you elaborate a bit more on the use case? Why do you need PMC for such an input?
 

R G W

CAD community veteran
I want to implement some isogeometric analysis methods with the help of occ, in which I need to judge whether each element intersects with the model, so I try to use pmc method.
Yes, this is an assembly. Is there any way to use pmc method for this structure? Or is there any way to solve this problem?
Thank you for your kind help.
 

Quaoar

Administrator
Staff member
PMC is essentially nothing but ray casting that counts the number of intersection points of a model with a ray and checks if this number is odd or even. A properly implemented PMC will also do this in several random directions to avoid falling into "singularities," such as gaps or geometrically dirty corners of a model. It does not seem like the right tool for the task you mentioned, but it uses the right engine, which is BVH. Something similar was done in Analysis Situs for projecting a point onto a mesh but it uses square distance that would not tell you if a point falls inside the model. Still, if you have shells in the model, I'm not sure what would be "inside" and "outside".
 

R G W

CAD community veteran
I tried to close the opening part of the model. After doing this, the pmc algorithm can run, but the results obtained are not satisfactory, as shown below.
1673151431909.png
I checked the model and found that the directions of some faces are reversed. If I can unify the directions of these faces, will the results obtained by pmc be better?
1673151472029.png
At the same time, after trying, I found that the direction of all faces is TopAbs_FORWARD, so i tried:
if (face. Orientation() == TopAbs_FORWARD)
std::swap(iNodes[1], iNodes[2]);
But the result obtained is that the original flipped face is right, and the positive face is flipped.
Maybe you can give me some help.
Sincere thanks for your generous help.
The model with the opening closed is in the attachment.
 

Attachments

  • wr_4.zip
    2.6 MB · Views: 0
Top