JMG1 / ExplodedAssembly

FreeCAD workbench to create exploded views and animations of assemblies
GNU Lesser General Public License v2.1
115 stars 27 forks source link

Trajectory lines not visible #35

Open 7h0mas-R opened 8 months ago

7h0mas-R commented 8 months ago

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
# 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

dannystaple commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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.

7h0mas-R commented 8 months ago

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...

dannystaple commented 8 months ago

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

JMG1 commented 7 months ago

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.

cfunseth commented 7 months ago

@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!

furgo16 commented 6 months ago

@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.