CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
2.93k stars 276 forks source link

Allow zero x or y spacing Workplane rarray #1603

Open lorenzncode opened 2 weeks ago

lorenzncode commented 2 weeks ago

These are equivalent:

import cadquery as cq

r1 = cq.Workplane().rarray(2, 1, 5, 1).box(1, 1, 1)
r2 = cq.Workplane().rarray(2, 1000, 5, 1).box(1, 1, 1)

I would like to specify zero spacing for y for this case instead of arbitrary non-zero value.

r3 = cq.Workplane().rarray(2, 0, 5, 1).box(1, 1, 1)

It's a minor issue. To me, it would slightly improve readability of code if 0 was allowed and specified for spacing when count is 1.

Sketch allows it:

s = cq.Sketch().rarray(2, 0, 5, 1).rect(1, 1)
r = cq.Workplane().placeSketch(s).extrude(1)