[TD] fix centerline crashes and bugs

the PR fixes the following things:
- change the way centerlines between 2 lines are calculated. The current implementation leads to many bugs and even crashes (e.g. when the 2 selected lines are parallel ones of a square). There are different forum threads from the last 1.5 years.
The new endpoint line sorting is the one described here: https://forum.freecadweb.org/viewtopic.php?f=35&start=20&t=44255&sid=989a668890f954c13ef81e4a04ee6912#p501179

- as consequence the erroneous and misleading line end flipping can go and is removed (only used internally)

- when creating a new centerline, you see it immediately

- when creating a new or editing an existing centerline and press Cancel, the creation/editing is aborted

- fix crash when the 2 selected lines are bot horizontal and one tries to create a vertical centerline

- fix crash when changing the orientation  of an existing centerline and the result would be invalid

- cleanup the code a bit
This commit is contained in:
donovaly
2021-05-14 23:48:12 +02:00
parent bb434d3ff2
commit 2bc5ac2e4b
5 changed files with 173 additions and 155 deletions

View File

@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>360</width>
<height>385</height>
<width>250</width>
<height>352</height>
</rect>
</property>
<property name="sizePolicy">
@@ -371,20 +371,6 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="cbFlip">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Flips endpoints of selected lines for centerline creation,
see the FreeCAD Wiki '2LineCenterLine' for a description</string>
</property>
<property name="text">
<string>Flip Ends</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>