Closed
Description
from cadquery import Sketch
s1 = Sketch().segment((0, 0),(10, 0)).edges().distribute(3).rect(1, 2)
results in:
Traceback (most recent call last):
File "/var/home/lorenzn/test1.py", line 3, in <module>
s1 = Sketch().segment((0, 0),(10, 0)).edges().distribute(3).rect(1, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/micromamba/envs/cq/lib/python3.12/site-packages/cadquery/sketch.py", line 475, in distribute
locs.extend(el.locations(params, planar=True,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/micromamba/envs/cq/lib/python3.12/site-packages/cadquery/occ_impl/shapes.py", line 2213, in locations
return [self.locationAt(d, mode, frame, planar) for d in ds]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/micromamba/envs/cq/lib/python3.12/site-packages/cadquery/occ_impl/shapes.py", line 2187, in locationAt
gp_Ax3(pnt, gp_Dir(0, 0, 1), gp_Dir(normal.XYZ())), gp_Ax3()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OCP.Standard.Standard_ConstructionError: gp_Dir::CrossCross() - result vector has zero norm
This succeeds:
s2 = Sketch().segment((0, 0),(10, 0)).edges().distribute(3, rotate=False).rect(1, 2)