Assembly 4 workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Assembly 4 workbench
parts from assembly were hidden for me too, but i noticed when clicking create new assembly4 Model button (yellow with blue box) there a folder parts appear, i think i placed parts there and after reopening there were not hidden. But i'm not sure because i did another files to see if it happens again and it is not.
Re: Assembly 4 workbench
what I noticed is that objects are hidden and show sequentially: if you make an assembly in 1 file, and link into the assembly a part that is in the same document, then the original part must be hidden and the link shown. So if in the document, the link is parsed first, which shows the part, and then the part is parsed, which is hidden, the end-result is that the solid is hidden. If the part is parsed first, it is hidden, then the link is parsed, which shows it, the end-result is that the solids are shown.im7thson wrote: ↑Sat Nov 16, 2019 5:09 pm parts from assembly were hidden for me too, but i noticed when clicking create new assembly4 Model button (yellow with blue box) there a folder parts appear, i think i placed parts there and after reopening there were not hidden. But i'm not sure because i did another files to see if it happens again and it is not.
That's why I create first a Part group before creating the Model App::Part, and all subsequent Parts are placed in that group, even if created later, so they are parsed before the assembly Model. Thus, the App::Links in the Model decide what is shown and not.
Re: Assembly 4 workbench
hum .. doesn't seem completely kosher to me. If you mix Assembly4 methods and manual copy of objects, I don't know what's going to happen. Is there a particular reason you did all that ? Is there a missing functionality in Assembly4 that made you manually copy the (partial ?) assembly ?joe.belladonna wrote: ↑Sat Nov 16, 2019 2:29 pm Everything was assembled with the Assembly4. [...] Then I twice copied that assembly into a new document and have created the "AssemblyOfBoxes_WithCopy", and have imported one "Box" assembly with "Insert link..."
- alonso_jamm
- Posts: 77
- Joined: Mon Nov 11, 2019 11:32 pm
Re: Assembly 4 workbench
Hello.
I have been testing Assembly 4 and so far I have like it quite a bit. I like the simplicity of the workbench, you have done a really good job! I also have been looking at your examples of animations and tried to do a small animation for a planetary gear set. It turned out to be quite simple, I added a small gif of the animation.
And here is the code I used:
I also included the files I used to make the animation. The only issue I could think about this approach is that it is kind of tedious to create all the LCSs, attach them to the sketch and then to link and attach all the gears to these LCSs. So I was wondering whether there could be some kind of way to automate this process.
For example, a sketch containing a polygon (like the pentagon used in the file I linked) could be created first. Then, LCSs would be created and attached to each vertex of the polygon. Using the Expression engine, the rotation of each new LCSs could be locked to the rotation of the center LCS (like how I did in my python script). Finally, links to the desired part are imported and attached to the new LCSs.
The problem I see with the example I mentioned is that it is not parametric and if we wanted to change the part or the number of linked parts we would have to delete pretty much everything.
So another method I thought was to directly attach each new LCS to the center LCS and use the attachment offset to change the placement of each LCS. I tried to something like that; however, the placement of each LCS become a little bit more complex. Here is, the piece of code that I used to run the animation using AttachmentOffset.
As I said, it is kind of complex and I am not completely sure about why the coefficients I used worked (like multiplying boxAnlge by 1.5).
So I would like to know what you think about this idea of automatizing the creation and attachment of LCSs and links into assemblies.
I have been testing Assembly 4 and so far I have like it quite a bit. I like the simplicity of the workbench, you have done a really good job! I also have been looking at your examples of animations and tried to do a small animation for a planetary gear set. It turned out to be quite simple, I added a small gif of the animation.
And here is the code I used:
Code: Select all
import time
from math import degrees
step = 1
for angle in range(0, 1440, step):
App.getDocument("GearAssembly").LCS_0.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1), angle))
carrierRatio = 15/(15+46)
planetRatio = ((46/15) - 1)*(15/61)
boxRot = App.getDocument("GearAssembly").LCS_0.Placement.Rotation # Get the current rotation of the sun gear
boxAngle = degrees(boxRot.Angle)
boxAx = boxRot.Axis
# Setting up the rotation of the carrier
App.getDocument("GearAssembly").Sketch_1.Placement.Rotation = App.Rotation(boxAx, boxAngle*carrierRatio)
# Now set up the rotation of each planet gear
App.getDocument("GearAssembly").LCS_1.Placement.Rotation = App.Rotation(boxAx, (-boxAngle - 0)*planetRatio)
App.getDocument("GearAssembly").LCS_1001.Placement.Rotation = App.Rotation(boxAx, (-boxAngle - 0)*planetRatio)
App.getDocument("GearAssembly").LCS_1002.Placement.Rotation = App.Rotation(boxAx, (-boxAngle - 0)*planetRatio)
App.getDocument("GearAssembly").LCS_1003.Placement.Rotation = App.Rotation(boxAx, (-boxAngle - 0)*planetRatio)
App.getDocument("GearAssembly").LCS_1004.Placement.Rotation = App.Rotation(boxAx, (-boxAngle - 0)*planetRatio)
App.ActiveDocument.recompute()
Gui.updateGui()
time.sleep(0.001)
For example, a sketch containing a polygon (like the pentagon used in the file I linked) could be created first. Then, LCSs would be created and attached to each vertex of the polygon. Using the Expression engine, the rotation of each new LCSs could be locked to the rotation of the center LCS (like how I did in my python script). Finally, links to the desired part are imported and attached to the new LCSs.
The problem I see with the example I mentioned is that it is not parametric and if we wanted to change the part or the number of linked parts we would have to delete pretty much everything.
So another method I thought was to directly attach each new LCS to the center LCS and use the attachment offset to change the placement of each LCS. I tried to something like that; however, the placement of each LCS become a little bit more complex. Here is, the piece of code that I used to run the animation using AttachmentOffset.
Code: Select all
boxRot = App.getDocument("GearAssembly").LCS_0.Placement.Rotation
boxAngle = degrees(boxRot.Angle)
boxAx = boxRot.Axis
App.getDocument("GearAssembly").LCS_1.AttachmentOffset.Rotation = App.Rotation(boxAx, (-boxAngle*1.5))
App.getDocument("GearAssembly").LCS_1.AttachmentOffset.Base = App.Vector(15*cos(radians(boxAngle*-0.75)), 15*sin(radians(boxAngle*-0.75)), 0)
So I would like to know what you think about this idea of automatizing the creation and attachment of LCSs and links into assemblies.
- Attachments
-
- GearAssembly.FCStd
- (13.12 KiB) Downloaded 91 times
-
- Gear.FCStd
- (30.16 KiB) Downloaded 64 times
-
- Gears.gif (819.04 KiB) Viewed 2171 times
-
- Posts: 18
- Joined: Sat Nov 09, 2019 9:18 pm
Re: Assembly 4 workbench
I have been testing Assembly4 to see will it suit my needs. Unlike with mechanical engineering in woodworking process, you have one part in many different shapes and forms. In my particular case, I use a chipboard panels. I cut it in smaller parts and then assemble those parts into a cabinet. I use it to build kitchens and wardrobe cabinets, and I need to draw many cabinets with different dimensions. My intention was to use FreeCAD to draw one parametric chipboard cabinet, and import it several times but with different dimensions. If I would use links in Assembly4, the first time I change dimensions of my linked part, all my cabinets would change their dimensions. I would like to import link of a part, or to copy that part, to an assembly and set its dimensions. Then I would like to import second part and to set its dimensions, but I would like to have first part with its already set dimensions without changing it when I set second cabinet dimensions. And I need to do this many times.Zolko wrote: ↑Sat Nov 16, 2019 8:01 pm hum .. doesn't seem completely kosher to me. If you mix Assembly4 methods and manual copy of objects, I don't know what's going to happen. Is there a particular reason you did all that ? Is there a missing functionality in Assembly4 that made you manually copy the (partial ?) assembly ?
In short that was my intention. I need to somehow, unlink parts after import so I can change dimensions. I don't care if that would be simple copying, and I don't care about file sizes. I just need to avoid to draw cabinets all over again for every single cabinets case I need to build. I tried with Assembly4 and copying and it worked until I close the file. When I open it again, linked parts were hidden.
Re: Assembly 4 workbench
What about cloning your original Part and then resizing the clones?
And about the hidden Parts: that problem was described just two posts earlier.
And about the hidden Parts: that problem was described just two posts earlier.
-
- Posts: 18
- Joined: Sat Nov 09, 2019 9:18 pm
Re: Assembly 4 workbench
I think I would clone the original part (or the Body inside it) and put this clone in its own part.joe.belladonna wrote: ↑Sun Nov 17, 2019 3:56 pmDo you mean to link my part within Assembly4 and then to clone it?
-
- Posts: 18
- Joined: Sat Nov 09, 2019 9:18 pm
Re: Assembly 4 workbench
I'm not sure that I understand you correctly. Here are my files. Can you please show me what you mean in those files. Thanks in advance.
- Attachments
-
- AssemblyOfBoxesWithCloning.FCStd
- (6.91 KiB) Downloaded 111 times
-
- Box.FCStd
- (44.13 KiB) Downloaded 89 times
Re: Assembly 4 workbench
thank-you for testing, and thank-you for your commentalonso_jamm wrote: ↑Sun Nov 17, 2019 5:26 am I have been testing Assembly 4 and so far I have like it quite a bit. I like the simplicity of the workbench, you have done a really good job!
great stuff !alonso_jamm wrote: ↑Sun Nov 17, 2019 5:26 am I also have been looking at your examples of animations and tried to do a small animation for a planetary gear set. It turned out to be quite simple, I added a small gif of the animation.
I think it would be very useful. The point I see though is that you might be able to come up with an automagic solution for some use-cases, but I also think that many people have many needs, and also many different ways of doing their stuff, so I don't see how an automatic solution would look like. But for some uses, that could turn out to cover a very large user-base, I definitively think that it is possible to do (much) better than today.alonso_jamm wrote: ↑Sun Nov 17, 2019 5:26 am The only issue I could think about this approach is that it is kind of tedious to create all the LCSs, attach them to the sketch and then to link and attach all the gears to these LCSs. So I was wondering whether there could be some kind of way to automate this process.
...
So I would like to know what you think about this idea of automatizing the creation and attachment of LCSs and links into assemblies.
So if you have ideas, please tell them.