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

cadquery.Workplane.rarray arg handling implemented incorrectly. #451

Closed
JosiahBradley opened this issue Sep 20, 2020 · 1 comment
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@JosiahBradley
Copy link
Contributor

if xSpacing < 1 or ySpacing < 1 or xCount < 1 or yCount < 1:

According to https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.rarray
rarray's arguments need to be greater than 0. The implementation correctly does this for the integer arguments xCount and yCount, however xSpacing and ySpacing are floats and their check should be if arg less than or equal to 0
This simple code reproduces the error:

import cadquery as cq
cq.Workplane().box(5.0, 5.0, 5.0).faces(">Z").rarray(1.0, 0.625, 1, 3).hole(0.125)

Recommended Solution

if xSpacing <= 0 or ySpacing <= 0 or xCount < 1 or yCount < 1:
            raise ValueError("Spacing and count must be > 0 ")
@adam-urbanczyk adam-urbanczyk added bug Something isn't working good first issue Good for newcomers labels Sep 20, 2020
@jmwright
Copy link
Member

@JosiahBradley Good catch. Would you be interested in creating a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants