I believe that in pull request #2746 paullee changed the way the Draft.offset function works. This function depends on DraftGeomUtils.offsetWire which is what was actually changed.
Therefore the Draft tests now fail.
Code: Select all
freecad -t TestDraft
Code: Select all
rect = Draft.makeRectangle(length, width)
App.ActiveDocument.recompute()
offset = Vector(-1, -1, 0)
obj = Draft.offset(rect, offset, copy=True)
Code: Select all
Either Part.Wire or Part.Edges should be provided, returning None
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/opt/freecad-build-vocx/Mod/Draft/Draft.py", line 1688, in offset
if DraftGeomUtils.hasCurves(newwire) and copy:
File "/opt/freecad-build-vocx/Mod/Draft/DraftGeomUtils.py", line 120, in hasCurves
for e in shape.Edges:
AttributeError: 'NoneType' object has no attribute 'Edges'
Paullee, if you are going to make big changes to the code, you need to run the tests to make sure they pass. If they don't pass, you have to change your code so that they pass, or you have to change the tests themselves, adapting them to your new code.
Draft.offset already has a defined behavior, and possibly other code and macros depend on it, so I think we shouldn't change its behavior too much. Paullee maybe you need to write a new function on DraftGeomUtils so that it doesn't change the behavior of the original offset. Or at least you need to test it more extensively before making a pull request.