Closed rupakbajgain closed 4 years ago
It is happening only for entity created using builder but it does not happen i create by spliting circle, Throws error Points describe a volume, not a area.
The issue seems to be in the setDragPoints function in arc.cpp in primitives. The new entity is not created properly (has inf and nan as the values), which causes the crash later on. https://github.com/LibreCAD/LibreCAD_3/blob/1dc4b410ba147f0a3c1c12af102e197f5200baa9/lckernel/cad/primitive/arc.cpp#L176
In createArcBulge function
auto isCCW = bulge>0.;
auto delta = atan(bulge) * 4.0;
auto middle = p1.mid(p2);
auto dist = p1.distanceTo(p2)/2.0;
auto radius = std::abs(dist / std::sin(delta/2.0));
Bulge is 0, so delta is 0 since tan(0)=0, this leads to sin(0)=0, which results in radius getting infinity as it's value.
We are passing in CCW() instead of bulge() as the third parameter to createArcBulge, which is the bug here.
thanks @Jedi18 , i fixed it, have you done it too? the bulge function is also not working properly.
Ok, i will remove that from my code to not create conflict.
That wont be a problem, it wont create a conflict if it's the same changes to that file.
@feragon This issue can be closed, it was fixed in #333
Use drag points in arc throws const char *