ExplodedAssembly icon indicating copy to clipboard operation
ExplodedAssembly copied to clipboard

Trajectory lines not visible

Open 7h0mas-R opened this issue 1 year ago • 8 comments

Setup: System: Macbook Pro 14", 2021, M1 Pro, 16GB

OS: macOS 12.6.7
Word size of FreeCAD: 64-bit
Version: 0.21.1.33694 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.10.12, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * fasteners 0.5.0
  * ExplodedAssembly
  * Help 1.0.3
  * Assembly4 0.50.6
  * Assembly3 0.12.0
  • Installed ExplodedAssembly three days ago from the Addon Manager
  • Select ExplodedAssembly → Load Example File
  • Press Play Forward, Disassemble, Play Backward, Assemble
  • Parts are moving as expected and as shown in the Youtube video, but trajectories are not visible
  • Situation is not changing, when I press the Trajectory Visibility button (even if I manually Refresh)
  • Below is a printout from the python console
  • The only remarkable thing I see is a red exclamation mark at Pocket005 and when I try to open an recompute it, I get an error (see also in the log below) - but as far as I can see, this is unrelated, because in my own drawings I observe the same thing.
# Gui.runCommand('Std_Workbench',15)
# Gui.runCommand('Std_ViewStatusBar',1)
### Begin command Std_Workbench
# Gui.activateWorkbench("ExplodedAssembly")
# App.setActiveDocument("Unnamed")
# App.ActiveDocument=App.getDocument("Unnamed")
# Gui.ActiveDocument=Gui.getDocument("Unnamed")
### End command Std_Workbench
# Gui.runCommand('Std_OrthographicCamera',1)
# Gui.runCommand('LoadExampleFile',0)
# Gui.runCommand('GoToEnd',0)
# Gui.runCommand('GoToStart',0)
# Gui.runCommand('PlayForward',0)
# Gui.runCommand('ToggleTrajectoryVisibility',0)
# Gui.runCommand('GoToStart',0)
# Gui.runCommand('GoToEnd',0)
# Gui.runCommand('Std_FreeCADUserHub',0)
# Gui.runCommand('Std_About',0)
# Gui.runCommand('Std_AddonMgr',0)
# Gui.runCommand('ToggleTrajectoryVisibility',0)
App.activeDocument().recompute(None,True,True)
# Gui.runCommand('ToggleTrajectoryVisibility',0)
App.activeDocument().recompute(None,True,True)
Gui.runCommand('ToggleTrajectoryVisibility',1)
# Gui.runCommand('Std_CloseActiveWindow',0)
App.closeDocument("example")
# Gui.runCommand('Std_OrthographicCamera',1)
# Gui.runCommand('Std_PerspectiveCamera',0)
# Gui.runCommand('Std_CloseActiveWindow',0)
App.closeDocument("Unnamed")
# App.setActiveDocument("")
# App.ActiveDocument=None
# Gui.ActiveDocument=None
# Gui.runCommand('LoadExampleFile',0)
# Gui.runCommand('PlayForward',0)
# Gui.runCommand('ToggleTrajectoryVisibility',0)
# Gui.runCommand('PlayBackward',0)
# Gui.runCommand('GoToStart',0)
# Gui.runCommand('GoToEnd',0)
# Gui.runCommand('ToggleTrajectoryVisibility',0)
# Gui.Selection.addSelection('example','Pocket005')
App.activeDocument().recompute(None,True,True)
# Gui.ActiveDocument.setEdit(App.getDocument('example').getObject('Pocket005'), 0)
# Gui.activateWorkbench('PartDesignWorkbench')
# Gui.Selection.clearSelection()
App.getDocument('example').getObject('Pocket005').Length = 5.000000
App.getDocument('example').getObject('Pocket005').Length2 = 5.000000
App.getDocument('example').getObject('Pocket005').TaperAngle = 0.000000
App.getDocument('example').getObject('Pocket005').TaperAngle2 = 0.000000
App.getDocument('example').getObject('Pocket005').UseCustomVector = 0
App.getDocument('example').getObject('Pocket005').Direction = (1, 1, 1)
App.getDocument('example').getObject('Pocket005').ReferenceAxis = None
App.getDocument('example').getObject('Pocket005').AlongSketchNormal = 1
App.getDocument('example').getObject('Pocket005').Type = 0
App.getDocument('example').getObject('Pocket005').UpToFace = None
App.getDocument('example').getObject('Pocket005').Reversed = 0
App.getDocument('example').getObject('Pocket005').Midplane = 0
App.getDocument('example').getObject('Pocket005').Offset = 0
App.getDocument('example').recompute()
App.getDocument('example').recompute()
# Gui.getDocument('example').resetEdit()
# Gui.activateWorkbench('ExplodedAssembly')
import PartDesignGui
20:51:13  Recompute failed!
20:51:37  Recompute failed!
20:53:29  Recompute failed!
20:53:29  Exploded Assembly workbench loaded

image

7h0mas-R avatar Jan 15 '24 19:01 7h0mas-R

I do not see the errors about recompute, but I am also unable to see any trajectory lines. I too am on macOS 12.6.8:

OS: macOS 12.6.8
Word size of FreeCAD: 64-bit
Version: 0.21.1.33694 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.10.12, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * A2plus 0.4.61
  * Manipulator 1.5.6
  * ExplodedAssembly
  * Help 1.0.3
  * Assembly3 0.12.0

dannystaple avatar Jan 15 '24 21:01 dannystaple

This looks like a recent change to the code: https://github.com/JMG1/ExplodedAssembly/blob/a7f000c9573d8d4786260bdebbb2bbde97a3ebaf/ExplodedAssembly.py#L597C1-L599C11

I wonder if I can force FreeCAD to use a version before that change?

dannystaple avatar Jan 15 '24 21:01 dannystaple

My plan: Go to /Library/Application Support/FreeCAD/Mod/ExplodedAssembly in a terminal. Then do a checkout to the version prior to this change. This is a risky attempt to work around until it's fixed, and may damage your files! Probably only something to try if comfortable with Git and have a backup of your project files.

This got lines back, but they were not where I expected them to be, which may be the reason they have been disabled.

dannystaple avatar Jan 15 '24 21:01 dannystaple

Thanks for the quick confirmation. Though familiar with GIT I am currently not urgently requiring it, so I won't start developing. Saw the the workbench used by a colleague in windows and wanted to test its capabilities. Even without the trajectories amazing. I'll probably just wait for a fix...

7h0mas-R avatar Jan 15 '24 22:01 7h0mas-R

I've only started using this workbench this week, but I am also thrilled with the results it's getting me!

dannystaple avatar Jan 15 '24 22:01 dannystaple

Added a exception handler to line generation with commit 781a3ff This feature should be reworked for complicated groups, but lines are showing for the test cases I have.

JMG1 avatar Feb 24 '24 12:02 JMG1

@JMG1 Would you mind sharing what needs re-working or what your comment about "no longer accurate and needs conversion to new placement" means?

I was starting to dig into this thinking that maybe a Draft Wire would be a more appropriate object to use than a Part Line, as it would allow for more complex trajectories. I just want to be sure I understand your concerns with the current implementation before I go messing with a potentially new solution.

Have you started work on something yourself, or do you plan to?

Thanks!

cfunseth avatar Feb 25 '24 05:02 cfunseth

@JMG1 I was very glad to see this update, thanks! However, at least in the FreeCAD dev version (0.22), updating the workbench via the Addon Manager does not work for this particular update. When pressing install update, it hangs while downloading it, whereas updating any other workbench/macro/etc. does work. Could this be related to https://github.com/JMG1/ExplodedAssembly/pull/33?

The workaround was to remove and reinstall the workbench.

furgo16 avatar Mar 02 '24 05:03 furgo16