ezdxf icon indicating copy to clipboard operation
ezdxf copied to clipboard

Error in math.distance_point_line_2d

Open sato1214syun opened this issue 6 years ago • 2 comments

ezdxf.math.distance_point_line_2d shows following error when I use it.

"ezdxf\math\construct2d.py", line 333, in distance_point_line_2d
    return math.fabs((start - point).det(end - point)) / (end - start).magnitude
AttributeError: 'Vector' object has no attribute 'det'

sato1214syun avatar May 29 '20 05:05 sato1214syun

Is this function called by ezdxf or by yourself, it is a bug if it is called by ezdxf and i need more context to fix it. It is a type error if it is called by yourself use Vec2() as input as the function signature says.

This is a low level function, so I don't do extra type checking here, Python is already slow enough.

mozman avatar May 29 '20 07:05 mozman

Sorry, I found out my mistake. I have put vector (not vec2) directory into this function.

sato1214syun avatar May 29 '20 08:05 sato1214syun