Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Checking Geometry Quality
darren_13
Member, Developers Posts: 119 PRO
Hi all, is there a way I can check to ensure there are no small faces or gaps in my geometry? I missed a gap when visually checking which lead me to a lot of troubles in CFD.
Any suggestions welcome, I was thinking about making a feature script and although I can get a readout that there are faces with an area smaller than 'x' I am not sure how best to visually convey the face (debug returns 'Query resolves to 1 faces' however gives no visualisation).
Cheers,
Darren
Any suggestions welcome, I was thinking about making a feature script and although I can get a readout that there are faces with an area smaller than 'x' I am not sure how best to visually convey the face (debug returns 'Query resolves to 1 faces' however gives no visualisation).
Cheers,
Darren
0
Comments
Cheers,
Darren
debug() in FeatureScript will make that 1 face highlight in red (but only when your feature dialog is open). It may be somewhat hard to find this face if it is small. Some things that could make it more noticeable:
For my small gaps script, I compare all edges and if the minimum distance is smaller than a certain tolerance it highlights the edges, this worked ok on a practice geometry but on a realistic one it times out saying possible infinite loop. Do you have any ideas how this could be done otherwise? I want thin channels to be highlighted, possibly even when faces meet at a sharp angle (i.e. where it would be hard to mesh).
Thanks,
Darren
It may be helpful if you post a link to a public document or paste a code snippet of the comparison code.
if you're currently doing an evDistance comparison between every pair of edges in the model, you could retool your algorithm to do a comparison between one edge and all the other edges, then the next edge and all the other edges:
https://cad.onshape.com/documents/a13b77c43656c4cf468905d9/w/2a6908c898e6f9a1fbf619ba/e/7438ad6ffd036af48532a5fa
I think what you describe above is what is implemented except I used distance = 0 to filter out the highlight, the above would reduce expenses but I'm not sure if it will make a difference.
Maybe evaluating minimum between faces might be more efficient.
Best,
Darren
This may work or it may not, but it's worth a try on your practical geometry:
https://cad.onshape.com/documents/afa0c241cd1560ed8fa971c0/w/8794fc3a086f99e464ad2b01/e/9f5b521630d61697dc8dc3cf
The difference between my algorithm and your algorithm is that mine uses 1 evDistance call to compare edge i to all the other edges, whereas yours uses n evDistance calls to compare i to all of the others (where n is the total number of edges).
Sorry that it wasn't clear that that was the distinction I was trying to make in my first message.
Let me know if this also times out.