Assembly3 preview

Discussion about the development of the Assembly workbench.
User avatar
mnesarco
Posts: 289
Joined: Thu Mar 26, 2020 8:52 pm

Re: Assembly3 preview

Postby mnesarco » Thu Jan 28, 2021 6:05 pm

realthunder wrote:
Wed Jan 27, 2021 9:59 pm
For animation, you can consult the attached script in this post.
In case someone is interested, I have added a small animation controller class in mnesarco utils to help in creating animation macros.

Example animation macro:

Code: Select all

import FreeCAD as App, FreeCADGui as Gui
import freecad.mnesarco.asm3.animation as anim

class Anim:

    def prepare(self):
        self.cstr = App.ActiveDocument.getObject('Constraint')
        self.cstr.LockAngle = True

    def cleanup(self):
        self.cstr.LockAngle = False

    def run(self, frame):
        self.cstr.Angle = frame * 5


ctrl = anim.Asm3AnimationController("Assembly", Anim(), frames=72)
ctrl.animate(fps=10)

The basic ideas is that an animation is a class with three methods:
  • prepare: runs before animation code
  • run: is the animation loop, (uses cache technique from the original animation.py script)
  • cleanup: runs after animation
Solver is called only on Asm3AnimationController constructor, not in animation loop.

code in run method can change more than one constraint, so it is pretty easy to create compound animations.

Code for reference: https://github.com/mnesarco/FreeCAD_Uti ... imation.py

I will add async timer support, so the camera can be moved while the animation is running (as i do with Asm4 animations)
RDA
Posts: 34
Joined: Tue Oct 06, 2020 6:55 am

Re: Assembly3 preview

Postby RDA » Mon Feb 08, 2021 8:41 pm

Im 100% I have read about parts "reorienting" randomly but I cant for the life of me find the post anywhere.

Well the issue is that sometimes (randomly, means cant pin point how) when doing assemblies and adding a new part the whole assembly "flips" to match the new parts coordinate system. Sorry difficult to explain but maybe the picutre helps? So the small bloxk that shows the planes was imported and the "parent" assembly flipped to match that coordinate system. I would love to share the whole assembly, but altough available from the internet the agreement clause forbids to distribute the file.

As I dont know how this happens, is there an easy way to reorient? If I try to move the first/parent part it has been constrained and has 0 DoF so cant really move it.

PTC creo has this reorient tool where you click and show example top and side and it reorients the whole thing based on that. Maybe FreeCad has something similar?
Attachments
Capture.PNG
Capture.PNG (25.48 KiB) Viewed 1222 times
skopjanecot
Posts: 13
Joined: Wed Jan 20, 2021 6:58 pm

Re: Assembly3 preview

Postby skopjanecot » Thu Feb 11, 2021 9:34 pm

Are there plans to implement the newly available Helix Tool in the Part Design WB in this branch? Though I'm sure I will not use it on an everyday basis, it would be nice to have it available for creating custom threads without switching projects between the 0.19 Daily and this branch. Once you get accustomed to the custom PieMenu commands you don't want to go back :)

Also, is the latest .dmg image working with Big Sur on M1 Macs? Cannot find any info besides what is available for the main branch of FreeCAD. Thinking of upgrading my machine and having FreeCAD working is a major concern.

Thanks!
User avatar
jpg87
Posts: 499
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Assembly3 preview

Postby jpg87 » Sat Feb 13, 2021 7:57 am

realthunder wrote:
Wed Jan 27, 2021 9:59 pm
...
Hello Realthunder,
I notice that several Asm3 users have the same problem:
https://forum.freecadweb.org/viewtopic.php?t=52689
https://forum.freecadweb.org/viewtopic.php?t=53150
https://forum.freecadweb.org/viewtopic.php?f=20&t=55416

If an assembly built in a single file includes sub-assemblies and you need to add a constraint between two components of one of the sub-assemblies, then the constraint is automatically inserted in the upper assembly.

When this happened to me, I used a workaround (described in this post: https://forum.freecadweb.org/viewtopic.php?f=20&t=53150).

I also tried a drag-and-drop of the constraint towards the concerned sub-assembly: obviously that does not work!

Is there a direct way to answer this problem? Or is it simply missing a command that would make the subset on which we want to insert the constraint "active"?

I specify that if the sub-assemblies are saved in separate files, this problem obviously does not arise.
My website : http://help-freecad-jpg87.fr updated 2021/04/15
realthunder
Posts: 1950
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Feb 15, 2021 9:39 pm

jpg87 wrote:
Sat Feb 13, 2021 7:57 am
If an assembly built in a single file includes sub-assemblies and you need to add a constraint between two components of one of the sub-assemblies, then the constraint is automatically inserted in the upper assembly.

When this happened to me, I used a workaround (described in this post: https://forum.freecadweb.org/viewtopic.php?f=20&t=53150).

I also tried a drag-and-drop of the constraint towards the concerned sub-assembly: obviously that does not work!

Is there a direct way to answer this problem? Or is it simply missing a command that would make the subset on which we want to insert the constraint "active"?

I specify that if the sub-assemblies are saved in separate files, this problem obviously does not arise.
Yes, I am aware of the problem. And it is indeed quite an annoy one. I plan to add the 'Active Assembly' functionality, just haven't got time to do so. I'll try that soon. Meanwhile, there is another work around. Simply create a link to the sub-assembly you are currently working on. This shall bring it to the root level.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Posts: 1950
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Feb 15, 2021 9:43 pm

skopjanecot wrote:
Thu Feb 11, 2021 9:34 pm
Are there plans to implement the newly available Helix Tool in the Part Design WB in this branch? Though I'm sure I will not use it on an everyday basis, it would be nice to have it available for creating custom threads without switching projects between the 0.19 Daily and this branch. Once you get accustomed to the custom PieMenu commands you don't want to go back :)
Yes, it will be included in my next release, maybe sometime this week.

Also, is the latest .dmg image working with Big Sur on M1 Macs? Cannot find any info besides what is available for the main branch of FreeCAD. Thinking of upgrading my machine and having FreeCAD working is a major concern.
Thanks!
That one I am sure. Maybe you can ask around in the forum see if any has gotten FreeCAD working on M1.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Posts: 1950
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Feb 15, 2021 9:46 pm

RDA wrote:
Mon Feb 08, 2021 8:41 pm
Im 100% I have read about parts "reorienting" randomly but I cant for the life of me find the post anywhere.

Well the issue is that sometimes (randomly, means cant pin point how) when doing assemblies and adding a new part the whole assembly "flips" to match the new parts coordinate system. Sorry difficult to explain but maybe the picutre helps? So the small bloxk that shows the planes was imported and the "parent" assembly flipped to match that coordinate system. I would love to share the whole assembly, but altough available from the internet the agreement clause forbids to distribute the file.

As I dont know how this happens, is there an easy way to reorient? If I try to move the first/parent part it has been constrained and has 0 DoF so cant really move it.

PTC creo has this reorient tool where you click and show example top and side and it reorients the whole thing based on that. Maybe FreeCad has something similar?
It's difficult to say without seeing your constraints. Some constraints, like Attachment, PlaneCoincident, etc. has a context menu action to let your flip either the part or the constraining element. You can experiment on that.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Posts: 1950
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Thu Feb 25, 2021 2:30 am

jpg87 wrote:
Sat Feb 13, 2021 7:57 am
If an assembly built in a single file includes sub-assemblies and you need to add a constraint between two components of one of the sub-assemblies, then the constraint is automatically inserted in the upper assembly.
Support for active assembly is added to my latest release. Simply double click any assembly to make it active. Mover tool, and new element/constraint will be applied to this assembly if possible.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
jpg87
Posts: 499
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Assembly3 preview

Postby jpg87 » Thu Feb 25, 2021 7:40 am

realthunder wrote:
Thu Feb 25, 2021 2:30 am
Support for active assembly is added to my latest release. Simply double click any assembly to make it active. Mover tool, and new element/constraint will be applied to this assembly if possible.
Awesome, thank you very much !
My website : http://help-freecad-jpg87.fr updated 2021/04/15
skopjanecot
Posts: 13
Joined: Wed Jan 20, 2021 6:58 pm

Re: Assembly3 preview

Postby skopjanecot » Fri Feb 26, 2021 10:07 pm

realthunder wrote:
Mon Feb 15, 2021 9:43 pm
skopjanecot wrote:
Thu Feb 11, 2021 9:34 pm
Also, is the latest .dmg image working with Big Sur on M1 Macs? Cannot find any info besides what is available for the main branch of FreeCAD. Thinking of upgrading my machine and having FreeCAD working is a major concern.
Thanks!
That one I am sure. Maybe you can ask around in the forum see if any has gotten FreeCAD working on M1.
Since I have made the switch to macOS, I can confirm that the latests releases work well with the system. No need to hack around as with the FreeCAD 0.19 to get your Link Branch to work on Big Sur. That's amazing actually! Thanks! :D

I have updated the app to the latest release 2021.2402 on both my linux and macos machines and I'm getting an error "You need a planar face as a support for a sketch!" on both when trying to make a new sketch (if there is no plane selected from the origin). It doesn't promt me to select a plane as usual. Is this on purpose and maybe a new direction the branch is taking?