gumyr / build123d

A python CAD programming library
Apache License 2.0
395 stars 72 forks source link

Hole doesn't work with Location context #12

Closed gumyr closed 1 year ago

gumyr commented 1 year ago
import build123d as bd

diam, height, hole_diam = 5, 2, 2
with bd.BuildPart() as washer:
    bd.Cylinder(diam, height)
    with bd.Locations( (2, 2, height) ):
        bd.Hole(hole_diam)
  File "/home/somed/projets/machine_vote_jm/my_asm.py", line 16, in <module>
    bd.Hole(hole_diam)
  File "/home/somed/projets/machine_vote_jm/.venv/lib/python3.10/site-packages/build123d/build_part.py", line 526, in __init__
    new_solids = [
  File "/home/somed/projets/machine_vote_jm/.venv/lib/python3.10/site-packages/build123d/build_part.py", line 527, in <listcomp>
    Solid.makeCylinder(radius, hole_depth, (0, 0, 0), (0, 0, -1), 360).moved(
  File "/home/somed/projets/machine_vote_jm/.venv/lib/python3.10/site-packages/cadquery/occ_impl/shapes.py", line 2797, in makeCylinder
    gp_Ax2(pnt.toPnt(), dir.toDir()), radius, height, angleDegrees * DEG2RAD
AttributeError: 'tuple' object has no attribute 'toPnt'. Did you mean: 'count'?
gumyr commented 1 year ago

Fixed with commit https://github.com/gumyr/build123d/commit/a375a37cc645f46133f66544c56e82d5a3274520 image