rotation along a selected axis

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

rotation along a selected axis

Post by ollydbg »

Is there any feature that I can rotate on a selected axis?
Here is the screen shot:
2016-04-14 08 55 25.png
2016-04-14 08 55 25.png (49.15 KiB) Viewed 5404 times
I have three parts, and try to make a three links arm, I can use the assembly2 wb simply align the part 1 and part 2, but I have no idea how to rotate the part 2 along the axis (which is the axis of the cylinder).

I have see the Placement menu item, but that can only rotate an object along the standard X Y Z axis, and also if I choose the user specified axis, I still see the origin is not the center of the cylinder's circle, but the vertex point of the box.

Any suggestions? Do I need to reset the origin of the part2 to the center of the cylinder? (I have some experience of Blender, there, I can specify a rotation center using 3D cursor, so rotation in Blender is quite easy)

I have see there is a animation wb, but I don't see a detailed instruction on how to select an axis of the rotation center in this wb, I see many videos in the Youtube, but still not quite sure how to use it.

In the assembly2 wb, I have put one constraint, so the axis of the cylinder's axis get aligned, but I see I can still move the part2 from the draft's rotate tools, so is there a real constraint?

I have upload all the files(the all.FCStd file contains three objects, and the t1.FCStd file is the part file)

Thanks

OS: Windows XP
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.6698 (Git)
Build type: Release
Branch: master
Hash: ca7c5d31a4d61f32a25b71025b14641a6e378328
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attachments
all.FCStd
(7.11 KiB) Downloaded 77 times
t1.FCStd
(8.99 KiB) Downloaded 77 times
Last edited by ollydbg on Sun Apr 24, 2016 2:09 am, edited 1 time in total.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: rotation along a selected axis

Post by microelly2 »

ollydbg wrote: I have see there is a animation wb, but I don't see a detailed instruction on how to select an axis of the rotation center in this wb, I see many videos in the Youtube, but still not quite sure how to use it.
The simplest way is to place your componentes to the origin with an axis of the coordinate system as rotation axis.
so you can easy rotate them.
Then create a Part compound around them and move it to the right assembly position
see my example file

http://freecadbuch.de/doku.php?id=blog: ... dsteuerung
http://freecadbuch.de/doku.php?id=blog: ... r_animiert
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: rotation along a selected axis

Post by ollydbg »

microelly2 wrote:
ollydbg wrote: I have see there is a animation wb, but I don't see a detailed instruction on how to select an axis of the rotation center in this wb, I see many videos in the Youtube, but still not quite sure how to use it.
The simplest way is to place your componentes to the origin with an axis of the coordinate system as rotation axis.
so you can easy rotate them.
Then create a Part compound around them and move it to the right assembly position
see my example file

http://freecadbuch.de/doku.php?id=blog: ... dsteuerung
http://freecadbuch.de/doku.php?id=blog: ... r_animiert
Hi, thanks for the reply.
I did see your above two links, but sorry I still don't know how to do that
1, I use google translate to see your web links in English language, but I still don't know what is the steps to construct the arm
2, I can download the files you supplied in your links, but It looks like that are quite complex to run. What is needed to run those files? It looks like I need to download some third part of the GUI library (kivy?), this may be quite easy under Linux, but not quite easy under windows. Also, I think to demonstrate a simple movement and animation, a simple one degree of freedom robot should be OK.
3, do you have any simple tutorials about how to use your animate wb, I have only install the animate wb and the assembly2 wb. I see there are many icons when your wb activated, but I don't know how to use those toolbars. When I click on the toolbar, I see one item is added to the project tree, but how to use them? Any tutorials?
4, I have take several hours to try to learn myself, but sorry, I can't do that. I just see that there are quite little tutorials than Blender. I can see there are many tutorials one the internet for the later 3D tools.

EDIT: Even the downloaded file, such as "m03_dreiachsenroboter.fcstd", those names are in German, and also if you open the file, the part names and the compound names are all in German languages, so this is quite hard to understand. Sorry, this looks like a complain, but I do think you need to change them to english, so that more and more people can understand them.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: rotation along a selected axis

Post by microelly2 »

sorry, it's a problem, I see the statistics of my website and so I change sometimes the language.
I will download your parts and make an english spoken video tutorial this afternoon.
it's nearly this https://youtu.be/E63XLWiRkhM
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: rotation along a selected axis

Post by microelly2 »

Here is the video and the example data
https://youtu.be/RtaSgK3Jmic
animation_chain.fcstd
(35.39 KiB) Downloaded 109 times
You need the animation workbench
https://github.com/microelly2/Animation/tree/dev2

You can do an animation of the degrees of freedom with assembly2 too
but here you can animate all components absolutly free

instead of using the "compound of compound" you can use assembly2,
but assembly2 needs longer to solve the constrains
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: rotation along a selected axis

Post by ollydbg »

Hi, microelly2, thanks, this video tutorial clearly demonstrates how to use animation wb, great, at least I know how to put Pacers, and how to associate an object with the Pacer, and how to use the Manager. Some question remains.

1, to specify the rotation center, I see you have put a sphere in the center of the hole, it that necessary. If I make a compound of a arm link and the sphere, what is the origin of the compound? It is the center of the sphere? Is it possible that we do not need the sphere?

2, when I double click the icon of the My_toucher, I see such error messages:

Code: Select all

[['forward', <bound method _ViewProviderToucher.animforward of <Toucher._ViewProviderToucher instance at 0x0B9A78A0>>], ['backward', <bound method _ViewProviderToucher.animbackward of <Toucher._ViewProviderToucher instance at 0x0B9A78A0>>], ['ping pong', <bound method _ViewProviderToucher.animpingpong of <Toucher._ViewProviderToucher instance at 0x0B9A78A0>>]]
Traceback (most recent call last):
  File "D:\software\sci\freecad\FreeCAD_0.16.6698_x86_dev_win\Mod\Animation\Animation.py", line 230, in doubleClicked
    self.setEdit(vobj,1)
  File "D:\software\sci\freecad\FreeCAD_0.16.6698_x86_dev_win\Mod\Animation\Animation.py", line 222, in setEdit
    self.edit()
  File "D:\software\sci\freecad\FreeCAD_0.16.6698_x86_dev_win\Mod\Animation\Animation.py", line 218, in edit
    self.dialog=EditWidget(self,self.emenu + anims,False)
  File "D:\software\sci\freecad\FreeCAD_0.16.6698_x86_dev_win\Mod\Animation\EditWidget.py", line 51, in __init__
    _EditWidget.__init__(self, True, obj,menu,noclose,*args)
  File "D:\software\sci\freecad\FreeCAD_0.16.6698_x86_dev_win\Mod\Animation\EditWidget.py", line 24, in __init__
    dial.valueChanged.connect(obj.dialer);
<type 'exceptions.AttributeError'>: _ViewProviderToucher instance has no attribute 'dialer'
3, Is it possible to change the icons of your animation plugin? I see the icons are not clear enough to recognize, it is some blur compared with the standard FreeCAD toolbar icons. For me, I need to select a menu item instead of click on the toolbar, because it is hard to distinguish from each toolbar items.

Thanks.
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: rotation along a selected axis

Post by ollydbg »

Ok, it looks like I can implement this with out extra reference sphere, see the screen shot below:
the 2R plane robot
the 2R plane robot
2016-04-15 12 41 03.png (62.14 KiB) Viewed 5293 times
This is two degree of freedom plane robot. There are three links (the green base link, the red middle link and the gray end link)
1, I first put the end link on the middle link, and place a Placer on the end link
2, then I make a compound object of the middle and end link, and the compound name is "end_on_middle"
3, I place a Placer on the "end_on_middle" object, and now it works.
I need to adjust the parameters of the Placer, see the image below, especially the displacement and the rotation center.
set the parameter of the Placer
set the parameter of the Placer
2016-04-15 12 34 16.png (57.45 KiB) Viewed 5293 times
Thank you very much!

BTW: I found a bug that in the setting of Placer, if I set the the "src" parameter, I have NO way to remove it. I mean I have no idea how to clear the edit control. What does the "src" means? because I leave it as blank(as I see from your video tutorials)
Last edited by ollydbg on Sun Apr 24, 2016 2:14 am, edited 1 time in total.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: rotation along a selected axis

Post by microelly2 »

Nice to see it work.

The dialer error for the toucher will be fixed, its is not critical, because I never used a widget for the toucher, so no test :oops:

The src property can be used to read placement information from another object, so I can place objects in parallel.
The src placement can be used with the variables sx, sy, sz in the formulas.
There is no possibility to clear that property from gui. So once set you have to use the python console

I used the compouind with the extra sphere. This is not neccesary. But the compound command in the gui requires two objects.
From command line you can create a compound from a single object.

Working with two compounds leads to a good logic:
one compund is the "assembly compount" where you combine some objects to a group - example put a ring on a finger or the clock to thge arm.
the other compound is the "animation compounts" which controls the movement of the assembly compound.

So you can separate assembly and animation.
I have used re-assambling in combination of assembly2 and animation workbench too, it works but as said is sometime slow and not for realtime animations
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: rotation along a selected axis

Post by ollydbg »

ollydbg wrote: 1, to specify the rotation center, I see you have put a sphere in the center of the hole, it that necessary. If I make a compound of a arm link and the sphere, what is the origin of the compound? It is the center of the sphere? Is it possible that we do not need the sphere?
I just tested it myself, I see that when a compound object is created, the current global origin is becomes the origin of the compound object. ;)
ollydbg
Posts: 36
Joined: Thu Apr 07, 2016 2:54 pm

Re: rotation along a selected axis

Post by ollydbg »

I have just create a four degree of freedom robot. See the image shot below:
4 degree of freedom robot
4 degree of freedom robot
2016-04-15 21 59 29.png (67.3 KiB) Viewed 5264 times
microelly2 wrote:...I used the compound with the extra sphere. This is not necessary....
I just found that using an extra component like a small sphere(for me, I think it is a reference, I just construct a point) will make it quite easy to construct the robot. Because I can first let the point be the rotation center, and later I just combine the point and the moving arm as a compound, after that, I can use the assembly2 wb to align the compound to some base arm links. This is a combination of animation and assembly2, in fact, I think I can remove the assembly2's constraint, because I will later make a larger compound with the the previous created compound. That's looks like I just attach the reference to its base.

BTW, I see some issues or suggestions:
1, Could you show the time value in the Placer's dialog, inside the needle?
2, I see some log text in German language, looks like:
Vorgabe arcv 3.6 ->Rotation ...Vector (0.0, 0.0, 1.0000000000000435)winkel 0.0628318530718
What does "Vorgabe" means?
Post Reply