cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Fix crash on invalid faces

Open openvmp opened this issue 1 year ago • 5 comments

openvmp avatar Mar 19 '24 02:03 openvmp

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.86%. Comparing base (153ed3f) to head (596087d). Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1541      +/-   ##
==========================================
+ Coverage   94.48%   94.86%   +0.38%     
==========================================
  Files          28       28              
  Lines        5780     6228     +448     
  Branches     1071     1262     +191     
==========================================
+ Hits         5461     5908     +447     
  Misses        193      193              
- Partials      126      127       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 19 '24 02:03 codecov[bot]

@openvmp thanks, what is the background of this fix? How can I reproduce the issue and can a test be added?

adam-urbanczyk avatar May 09 '24 14:05 adam-urbanczyk

I was trying to use CadQuery to render models for PartCAD.org. Specifically this model: https://partcad.org/repository/assembly/robotics/multimodal/openvmp/robots/don1:robot

It was larger than 1GB back then. And CadQuery was crashing on some triangle. It was too much for me to find which one and why. I stopped using CadQuery for that purpose, so it's impossible to investigate any further now.

openvmp avatar May 11 '24 04:05 openvmp

Could you share this model as a .brep file?

adam-urbanczyk avatar May 11 '24 09:05 adam-urbanczyk

Give me some time to add this export feature and to try reproducing the crash (I operate on much smaller models now).

openvmp avatar May 11 '24 22:05 openvmp

@openvmp I think I found a MRE:

cq.Face.makePlane(1e-9,1e-9).tessellate(1e-3)

adam-urbanczyk avatar May 28 '24 16:05 adam-urbanczyk

Yes, me too.

adam-urbanczyk avatar May 28 '24 19:05 adam-urbanczyk

@jmwright are you OK with merging this PR?

adam-urbanczyk avatar May 29 '24 17:05 adam-urbanczyk

@adam-urbanczyk +1 to merge

jmwright avatar May 29 '24 17:05 jmwright

Thanks @openvmp !

adam-urbanczyk avatar May 30 '24 19:05 adam-urbanczyk