diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 040712235..982b2c6bf 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -2184,7 +2184,12 @@ def locationAt( T = gp_Trsf() if planar: T.SetTransformation( - gp_Ax3(pnt, gp_Dir(0, 0, 1), gp_Dir(normal.XYZ())), gp_Ax3() + gp_Ax3( + pnt, + gp_Dir(0, 0, 1), + gp_Dir(Vector(0, 0, 1).cross(Vector(tangent)).normalized().wrapped), + ), + gp_Ax3(), ) else: T.SetTransformation( diff --git a/tests/test_sketch.py b/tests/test_sketch.py index 2e21ae482..a75241d40 100644 --- a/tests/test_sketch.py +++ b/tests/test_sketch.py @@ -193,6 +193,9 @@ def test_distribute(): assert s5._selection[0].Center().toTuple() == approx((0.0, 6.0, 0.0)) + # make sure that we can use distribute on straight lines + _ = Sketch().segment((0, 0), (10, 0)).edges().distribute(3).rect(1, 2) + def test_rarray():