nolanyee / blender-path-extrude

Blender Polygon Path Extrusion Tool
3 stars 2 forks source link

math domain error from acos? #8

Closed tnakagome closed 2 months ago

tnakagome commented 2 months ago

Hello again. It's been a while.

I am using this library with Blender 4.1 now, and experiencing this error.

Python: Traceback (most recent call last): File "C:\PathExtrude.py", line 236, in execute ValueError: math domain error

It seems to come from acos() in

factor_list.append(1/math.sin(math.acos(np.dot(-1*normalized_differences[i],normalized_differences[i+1]))/2))

This is the .blend that reproduces the problem. It would be great if it can be fixed.

DomainError.zip

Thank you!

nolanyee commented 2 months ago

This was probably due to a floating point error. I modified the code to force the arguments to be within the acos() range. It should work now.

tnakagome commented 2 months ago

Great! Thank you very much.