Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sketch parray fix #1005

Merged
merged 4 commits into from
Feb 25, 2022
Merged

Sketch parray fix #1005

merged 4 commits into from
Feb 25, 2022

Conversation

lorenzncode
Copy link
Member

With current PR changes:

s = cq.Sketch().parray(20, 20, -70, 8).circle(0.5)

e1

s = cq.Sketch().parray(4, 0, 180, 6).rect(1, 0.5)

e2

s = cq.Sketch().push([(5,5)]).parray(4, 20, 360, 6).rect(1, 0.5)

e3

* Start angle and rotation convention to be consistent with arc CadQuery#1001
* Fix parray bug when used with push
* Return n locations for 360 degree array
* Fix n=1
@lorenzncode lorenzncode marked this pull request as draft February 19, 2022 03:56
@codecov
Copy link

codecov bot commented Feb 19, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.27%. Comparing base (9e9b452) to head (d4070b4).
Report is 379 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1005   +/-   ##
=======================================
  Coverage   96.26%   96.27%           
=======================================
  Files          40       40           
  Lines        9344     9357   +13     
  Branches     1104     1103    -1     
=======================================
+ Hits         8995     9008   +13     
  Misses        205      205           
  Partials      144      144           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lorenzncode lorenzncode marked this pull request as ready for review February 19, 2022 16:08
cadquery/sketch.py Outdated Show resolved Hide resolved
cadquery/sketch.py Outdated Show resolved Hide resolved
cadquery/sketch.py Show resolved Hide resolved
cadquery/sketch.py Outdated Show resolved Hide resolved
cadquery/sketch.py Outdated Show resolved Hide resolved
@adam-urbanczyk
Copy link
Member

Thanks @lorenzncode , some minor points from my side.

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lorenzncode

Is this ready to merge?

@lorenzncode
Copy link
Member Author

It's ready to merge unless any additional review changes are requested. Regarding the following changes do let me know if there is an issue.

  1. Arg a2 changed to da. Initially I did not feel strongly about this part. After testing I leaned toward making this consistent with arc as well.
    Consider distributing over a half circle:

    • a2: parray(10, 70, 70+180, 6)
    • da: parray(10, 70, 180, 6)
  2. Distributing over a full circle - special handling was added to generate n requested locations.

@adam-urbanczyk
Copy link
Member

@lorenzncode LGTM!

@jmwright jmwright merged commit 5147dd8 into CadQuery:master Feb 25, 2022
@lorenzncode lorenzncode deleted the sketch-parray branch February 25, 2022 22:17
marcus7070 added a commit to vinszent/cq-flake that referenced this pull request Mar 26, 2022
marcus7070 added a commit to vinszent/cq-flake that referenced this pull request Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants