Coder Social home page Coder Social logo

jmg1 / explodedassembly Goto Github PK

View Code? Open in Web Editor NEW
110.0 18.0 25.0 789 KB

FreeCAD workbench to create exploded views and animations of assemblies

License: GNU Lesser General Public License v2.1

Python 100.00%
freecad workbench addon-manager assemblies freecad-workbench exploded-views animation

explodedassembly's People

Contributors

evanlf6768 avatar jmg1 avatar luzpaz avatar morganrallen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

explodedassembly's Issues

Select from the Object Tree

It looks like the selection from the Object tree does not work. I would like to select a hidden part that is going to be accessed in the nexts steps/trajectories. Any idea how can I achieve that?

exploded can not apply for assembly4

bug_exploded.zip
FreeCAD version 0.20

(1) Select one face
(2)Select another face
(3)Then following error occurs:
ViewProviderExt.cpp(1267): Cannot compute Inventor representation for the shape of _1#trajectory_line001: Bnd_Box is void

Color change of part

Hello!

I have a transpartent red part in my freecad file. If i put an animation to it and start the animation it brings up the recompute sign in the tree view and changes it color it transparency. Can send you an example file if you would like.

Greets and thanks for this awesome tool

Update: Problem connected to other error. Nothing to do with workbench!!

Initialization fails on FreeCAD 0.18.3

With that error (seems different from #12 ) :

During initialization the error 'ascii' codec can't decode byte 0xc3 in position 98: ordinal not in range(128) occurred in /Users/dxp/Library/Preferences/FreeCAD/Mod/ExplodedAssembly/InitGui.py
Please look into the log file for further information

FC infos :

OS: macOS 10.14
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git)
Build type: Release
Branch: (HEAD detached at 0.18.3)
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Switzerland (fr_CH)

One step forward/backward

It is missing a button to advance the animation in a single step. I would like to use it to explain how to assembly my design. In this way, it is much better to have a button that animates one step forward (and on to animate one step back)

ExplodedAssembly workbench does not work in FreeCAD 0.18

See https://forum.freecadweb.org/viewtopic.php?f=3&t=36400
I installed the bank from addons manager.

OS: Debian GNU/Linux 9 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16110 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.1)
Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Spanish/Argentina (es_AR)

Error:

Exploded Assembly workbench loaded
Running the Python command 'PlayForward' failed:
Traceback (most recent call last):
  File "/home/dcapeletti/.FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 221, in Activated
    ea.runAnimation()
  File "/home/dcapeletti/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 337, in runAnimation
    traj_iterator = xrange(number_of_trajectories)

name 'xrange' is not defined

The file to test is this https://github.com/JMG1/ExplodedAssembly/blob/master/example.fcstd

from exploded status to TechDraw

I am not able to maintain the exploded status and to take it into a techdraw page. Some movements are taken and some not and there is no apparently reason. As soon as I press the button to add a view in the techdraw WB the object steps back to a previous status so some part are disassembled and some not.

Errors when using assembly workbench

If trying to use this tool with an assembly workbench (eg. Assembly 3) always fails with:

Running the Python command 'CreateSimpleGroup' failed:
Traceback (most recent call last):
  File "/home/evan/.FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 71, in Activated
    ea.createSimpleDisassemble()
  File "/home/evan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 213, in createSimpleDisassemble
    dir_vector = selection[-1].SubObjects[-1].normalAt(0, 0)

function takes exactly 1 argument (2 given)Running the Python command 'CreateSimpleGroup' failed:
Traceback (most recent call last):
  File "/home/evan/.FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 71, in Activated
    ea.createSimpleDisassemble()
  File "/home/evan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 245, in createSimpleDisassemble
    plm = an_object.Placement

'NoneType' object has no attribute 'Placement'

This appears to be because selecting a face in an assembly selects the face inside the of the part hierarchy (eg. on a pad), instead of the face on the part itself.

OS: Arch Linux (i3//usr/share/xsessions/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21911 +2545 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: 04c80c99eee0f7d2f761bdc7d8b32c077adefdec
Python version: 3.7.8
Qt version: 5.12.1
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

Failure to Load example

I've just started playing with freecad and tried to use this to get a better view of what I'm working on, however loading the example causes it to crash.

App::DocumentObjectGroupPython: No property found with name ExpressionEngine and type App::PropertyExpressionEngine
*** Abort *** an exception was raised, but no catch was found.
        ... The exception is:SIGSEGV 'segmentation violation' detected. Address 51

This is using the latest mint freecad (0.15 Revision: 4671 git)

name 'xrange' is not definedRunning the Python command 'CreateSimpleGroup' failed

Hello, trying to get started with Exploded Assembly but it doesn't look like it's working with FreeCAD 0.18.1

name 'xrange' is not definedRunning the Python command 'CreateSimpleGroup' failed:
Traceback (most recent call last):
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 71, in Activated
    ea.createSimpleDisassemble()
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 249, in createSimpleDisassemble
    updateTrajectoryLines()
  File "/home/morgan/.FreeCAD/Mod/ExplodedAssembly/ExplodedAssembly.py", line 627, in updateTrajectoryLines
    for s in xrange(len(objects)):

name 'xrange' is not defined
OS: Ubuntu 18.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Let me know if there is any additional info I can provide.

Trajectory lines not visible

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

How to move objects that does not have a face normal to the trajectory?

Hey, I am trying to use this workbench but I don't know how to make trajectories when the object doesn't have a valid face that is normal to the movement? How can I do in this case? Suppose I want to move a sphere. Is there any other way to create trajectories manually, so they could be more complex or they could be reused?

Workbench unusable in FC 0.19 due to changed Python functions

  • use the menu to load the example file

result: you get this warning: "Enumeration index -1 is out of range, ignore it"

  • let's ignore this and move on by pressing the button "Create Bolt Group"

result: <Part> ViewProviderExt.cpp(1325): Cannot compute Inventor representation for the shape of example#trajectory_line021 <Part> ViewProviderExt.cpp(1325): Cannot compute Inventor representation for the shape of example#trajectory_line021 264.696 <App> Document.cpp(3462): Failed to recompute example#Pocket005: No object linked Recompute failed! Please check report view.

This might come because of the new link feature of FC. If so, I can bring this issue to the FC forum.

  • now select 2 edges of your choice and press the button "Create Simple Group"

result: you get this error: Running the Python command 'CreateSimpleGroup' failed: Traceback (most recent call last): File "C:\Users\stoehr\AppData\Roaming\FreeCAD\Mod\ExplodedAssembly\EAInit.py", line 71, in Activated ea.createSimpleDisassemble() File "C:\Users\stoehr\AppData\Roaming\FreeCAD\Mod\ExplodedAssembly\ExplodedAssembly.py", line 213, in createSimpleDisassemble dir_vector = selection[-1].SubObjects[-1].normalAt(0, 0) function takes exactly 1 argument (2 given)

It seems the FC python functions have changed and ExplodedAssembly must be adapted accordingly.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19127 (Git)
Build type: Release
Branch: master
Hash: ec18f070d13b195d946c3d955d8c21b2e60550e2
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

Conflict with `git sumodule foreach git pull origin master`

I have a conflict when using https://github.com/FreeCAD/FreeCAD-addons and the command git sumodule foreach git pull origin master (each time I run the command).

The command output the last time I had the conflict is

From https://github.com/JMG1/ExplodedAssembly
 * branch            master     -> FETCH_HEAD
Auto-merging LICENSE
CONFLICT (add/add): Merge conflict in LICENSE
Auto-merging InitGui.py
CONFLICT (add/add): Merge conflict in InitGui.py

I don't know if this comes from your repository or FreeCAD-addons. Can you please have a look at it?

Corrupted data after save

The ExplodedAssembly and the groups therein fail to load their data after an application restart.

Investigating the .FcStd it turns out that it fails already when attempting to save. Each of the following properties get set to a value bnVsbA==, which is null in base64:

  • ExplodedAssembly:
    • InitialPlacements
    • Proxy
  • SimpleGroup/BoltGroup:
    • Proxy
    • dir_vectors
    • names
    • rot_centers
    • rot_vectors

This means all the data about the assembly is lost and neither retrievable from the project file or backup file(s), except for the trajectory lines. (To be clear, the rest of the objects in your model are not affected, though their placement might be wrong, since the InitialPlacement data is lost.)

This makes this addon pretty much unusable currently, sadly.

Program versions:

FreeCAD 0.21.1
Python 3.11.5

Allow simultaneous movements

It would be nice to be able to animate several parts at the same time. I'm not sure the best way to handle this but have a couple loose ideas.

Nested Groups
After an animation group has been created, it could be dragged into another Group in the Model view. EA could traverse each Group and start all the animations at the same time.

Animation Group Property
Give a new property that would determine the true animation order. This would default to the 00x ID already given to each Group. This could then be changed to any other valid number and those would animate together

Time Offset
Another new property, that might even be useful outside of simultaneous. It would represent the amount of time an animation would start before the previous one was finished. Default to 0 would mean it waited until the previous is complete. 1 (or -1) would mean the animation starts 1 steps before the previous was done.

Bug creating a Simple Group

When using FreeCAD 0.21.2 with a freshly installed version of the Exploded Assembly add-on, on 3/28/2024, not all selected parts are added to a new Simple Group. . If I select 5 objects to be added, only the first 4 are animated. If I select 2, only one object is animated. It seems that the last object selected is not added to the group.

Delete last feature/movement/step

It is missing a button to delete the last step. This button would reset the initial position otherwise, the user has always to fix it manually.

Add/Remove parts from a step

It would be nice to have, inside the feature, the parts that are going to perform the movement.
This way, the user could add/remove parts to this movement.

Explode Assembly seems to be broken?

Currently for me it is not possible to explode drawings with Freecad 0.21.1 (Win). If i use an older version of ExplodeAssembly there are no problems. The following error message appears:

09:35:08  Exploded Assembly workbench loaded
09:35:10  Running the Python command 'GoToEnd' failed:
Traceback (most recent call last):
  File "C:\Users\ragae\AppData\Roaming\FreeCAD\Mod\ExplodedAssembly\EAInit.py", line 315, in Activated
    ea.goToEnd()
  File "C:\Users\ragae\AppData\Roaming\FreeCAD\Mod\ExplodedAssembly\ExplodedAssembly.py", line 450, in goToEnd
    obj_base = traj.dir_vectors[n]*inc_D

can't multiply sequence by non-int of type 'float'

Maybe it is due the setup of AnimationStepTime?
image

I didn´t test if the problems are comming from there but if the code was changed to only accept int it would be necessary to change all my project. I haven´t checked the code of the last commit but possible this is a #bug?

Group of objects

Hi, I am trying to use this plugin and it is awesome. I have a question.
Is it possible to apply the trajectory to more than 1 object at the same time? I have two objects that are separated because they will be 3d-printed separated but I want to explore them as a single piece.
I tried to use the "Yellow toolbar button" to make a part with multiples objects but I was not able to do what I want yet. Do you have any idea how to achieve this?

Unable to use the align to edge tool

The tool help suggests that I select the edge of an object to align, then an edge as a reference. So I select an edge from part 1, and holding command (MacOS) select an edge from part 2.

I then click the "Align to Edge" button in Exploded Assembly

The edges were both straight edges on the parts.

Screenshot 2024-01-11 at 22 49 12

What I expected to happen

The two edges would be mated, perhaps without changing the orientation of the parts, since I saw no way to specify the orientation for this.

What actually happens

  • No objects move.
  • Nothing is created in the "ExplodedAssembly" object in the tree.
  • The following error appears:
'Part.Line' object has no attribute 'EndPoint'Running the Python command 'AlignToEdge' failed:
Traceback (most recent call last):
  File "/Users/danielstaple/Library/Application Support/FreeCAD/Mod/ExplodedAssembly/EAInit.py", line 386, in Activated
    va = (edgeA.Curve.EndPoint - edgeA.Curve.StartPoint).normalize()

Console output:

>>> # Gui.Selection.addSelection('fitting_distance_sensor','Body','Pocket003.Edge40',-22.5046,-97.5,3)
>>> # Gui.Selection.addSelection('fitting_distance_sensor','Part','Body001.Pocket001.Edge13',-10.6663,-89.25,35)
>>> # Gui.runCommand('AlignToEdge',0)

About my FreeCAD

I am running v0.21.1:

[code]
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.60k
  * ExplodedAssembly
[/code]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.