cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Fix lineTo to do nothing instead of raising error when 0 length

Open endikallanomatxin opened this issue 1 year ago • 3 comments
trafficstars

Before the change it raised an error when startPoint and endPoint were equal

endikallanomatxin avatar Jun 18 '24 14:06 endikallanomatxin

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.83%. Comparing base (33f72d2) to head (e3d6907).

Files Patch % Lines
cadquery/cq.py 0.00% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1606      +/-   ##
==========================================
- Coverage   94.86%   94.83%   -0.04%     
==========================================
  Files          28       28              
  Lines        6231     6233       +2     
  Branches     1264     1265       +1     
==========================================
  Hits         5911     5911              
- Misses        193      194       +1     
- Partials      127      128       +1     

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

codecov[bot] avatar Jun 18 '24 14:06 codecov[bot]

Why is this desired? 0 length line sounds like a user mistake that should result in an error.

adam-urbanczyk avatar Nov 09 '24 21:11 adam-urbanczyk

When automating parametric design, it can be more comfortable not having to deal with the edge case of 0 length. At least in my case, it allowed for easier and more flexible parametric modelling. (A line that in some configurations has a finite length, can easily be omitted in other configurations when it is not needed)

endikallanomatxin avatar Dec 28 '24 18:12 endikallanomatxin