jimy-byerley / pymadcad

Simple yet powerful CAD (Computer Aided Design) library, written with Python.
https://madcad.netlify.app/
GNU Lesser General Public License v3.0
205 stars 15 forks source link

Unable to bevel one only edge #76

Open jimy-byerley opened 1 year ago

jimy-byerley commented 1 year ago

This is a bug reported by @Boehm92 in #74

How can i use the bevel function for only one edge of a cube? Maybe i'm confused but i dont get it running. If i only apply it on one edge it throws folloging exception:

My code:

cube = mdc.brick(width=mdc.vec3(2))

mdc.bevel(
        cube,
        [(1, 2)],  # Edges to smooth
        ("width", 0.3),  # Cutting description, known as 'cutter'
    )
line 648, in mesh_bevel
r.reverse()
UnboundLocalError: local variable 'r' referenced before assignment
jimy-byerley commented 1 year ago

This bug only concerns madcad.cut.bevel() and not madcad.cut.chamfer(), it is due to the cutted edge ending resolution which is failing when both cut endings belong to the same edge. I will have to fix that

Boehm92 commented 1 year ago

I wanted to ask, if there is an update to the problem?

jimy-byerley commented 1 year ago

Erf ... no I'm sorry, I had not enough time past months ... This doesn't seems so difficult to fix, so I need to find some time for it