Skip to content

Commit

Permalink
Fix networkx detection, issue #443, and update readme to PR #442
Browse files Browse the repository at this point in the history
  • Loading branch information
shaise committed Jan 15, 2025
1 parent f7d32c9 commit f294490
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Starting from FreeCAD 0.17 it can be installed via the [Addon Manager](https://g
* FreeCAD Forum announcement/discussion [thread](https://forum.freecadweb.org/viewtopic.php?f=3&t=60818)

#### Release notes:
* V0.7.02 15 Jan 2025: Fix thickness detection by [@alexneufeld][alexneufeld].
- Improve detection of missing networkx dependency
* V0.7.01 13 Jan 2025: New Unfolder compatibility with FC0.21 and LS3 by [@alexneufeld][alexneufeld] and [@Syres916][Syres916].
* V0.7.00 11 Jan 2025: New SheetMetal Unfolder! by [@alexneufeld][alexneufeld].
- Unfolder backward compatibility fixes by [@GS90][GS90].
Expand Down
4 changes: 4 additions & 0 deletions SheetMetalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import math
import os
import re
import importlib
import FreeCAD
import importDXF
import importSVG
Expand Down Expand Up @@ -747,6 +748,9 @@ def smIsEqualAngle(ang1, ang2, p=5):
result = True
return result

def smIsNetworkxAvailable():
spec = importlib.util.find_spec("networkx")
return spec is not None

class SMLogger:
@classmethod
Expand Down
7 changes: 4 additions & 3 deletions SheetMetalUnfoldCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@

translate = FreeCAD.Qt.translate

try:
if SheetMetalTools.smIsNetworkxAvailable():
import SheetMetalNewUnfolder
from SheetMetalNewUnfolder import BendAllowanceCalculator
NewUnfolderAvailable = True
except ImportError:
else:
NewUnfolderAvailable = False
FreeCAD.Console.PrintWarning(
translate( "SheetMetal",
"Networkx dependency is missing or FreeCAD is too old. Reverting to old Unfolder\n"
"Networkx dependency is missing and required for the new Unfolder\n"
"Try uninstalling SheetMetal, refresh Addon Manager's cache, and reinstall\n"
)
)

Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>SheetMetal Workbench</name>
<description>A simple sheet metal tools workbench for FreeCAD.</description>
<version>0.7.01</version>
<date>2025-01-13</date>
<version>0.7.02</version>
<date>2025-01-15</date>
<maintainer email="shaise@gmail.com">Shai Seger</maintainer>
<license file="LICENSE">LGPL-2.1-or-later</license>
<url type="repository" branch="master">https://github.com/shaise/FreeCAD_SheetMetal</url>
Expand Down

0 comments on commit f294490

Please sign in to comment.