RotateTO Rotate ALONG and other 3D

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

RotateTO Rotate ALONG and other 3D

Post by benp »

Hello,

I have some problems with rotation in the 3D pannel.
I imported my 3D from solidedge with the stl format.
I can successfully successfully rotate "chassis" on the axis of "roues" with the command:
RotateAlong(Chassis,Roues,0,0,angleincrement,0)
Here is the result:
rotateALONG.jpg
(117.79 KiB) Downloaded 732 times
But the is an offset if I use the RotateTo
RotateTo(Chassis,Roues,0,0,angle,0)
Here is the result
rotateTO.jpg
(112.99 KiB) Downloaded 732 times
Is this a bug or I don't use RotateTo properly?
I can post the fcfx and mesh if necessary.

Another question:
Flowcode lose the link to the mesh if I open the file on another computer (the file system is the same because I work on NAS-Network attach storage and I mount it as a hard disk in windows). What can I do/you do for this?
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by benp »

I tried other 3D
MoveTo: work properly
MoveBy: work properly
GetCoods: work properly
GetEuler: Do not work. The exemple in help return the value just once and is not update with the component rotation
GetQuat: Do not work, same proplem as Euler

Is this bug to or I don't use the component properly?
Note: I use V6.0.4.0
Last edited by benp on Fri Feb 07, 2014 8:50 pm, edited 1 time in total.
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by JonnyW »

Hello.

The call RotateTo() can be confusing. It sets the angles to absolutes, so if you have positioned your model to exactly where you want then called RotateTo(0, 0, 0) it will in effect wipe your previous angles and reset the object.

This commonly causes confusing when you have previously rotated by 90-degrees in a specific axis, or if you are trying to rotate exactly around a pivot point (as it looks from your images), as Flowcode will then set the rotations and positions based on the assumption previous rotations have set your model to its current position.

The best way to restore the position of an object (if that is what you want to do) is create a copy of your objects position on start-up, then restore that position whenever you want (I recommend doing this in the start/stop simulation events).
000038_.png
Object handle
(14.79 KiB) Downloaded 3163 times
000039_Flowcode1 _.png
Sample
(9.5 KiB) Downloaded 3153 times
I hope this helps. I can provide examples, etc, as needed if you want to do something specific.

Cheers,

Jonny

benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by benp »

Thank you for your explanations.
I understand that one is absolute and one is relative.
I will do an exemple later because the rotateTO/RotateALONG take more time.



Here is the Get Euler bug (or misunderstanding):
GetEulerBug.fcfx
(6.95 KiB) Downloaded 256 times
This is the geteuler from the exemple on which I only add à rotateX and test.
The euler is not update from geteuler with live rotation.
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by benp »

Here is my RotateTO problem

This is the perfectly working exemple for rotateALONG:
rotate along.fcfx
(5.63 KiB) Downloaded 373 times
This is the rotateTO
rotate to.fcfx
(5.91 KiB) Downloaded 373 times
Why this quick movement at the first rotate TO
In my opinion, it should do exactly the same as RotateALONG exelple
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by benp »

You didn't answer to that question:
Another question:
Flowcode lose the link to the mesh if I open the file on another computer (the file system is the same because I work on NAS-Network attach storage and I mount it as a hard disk in windows). What can I do/you do for this?
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by JonnyW »

Hi. Sorry, I missed that.

I will have a good look into these functions and ensure they all operate as expected. It is possible the GetEuler() has a bug - if so it is an easy fix I think.

I will try to look through your examples today. I think I know what the problem will be anyway, and have a diagram in my head that may help explain things, as previous attempts to talk through the maths behind these things has resulted in greater confusion - perhaps I need to work on my teaching style!

Thank you for your patience.

Jonny

benp
Posts: 155
Joined: Sat Mar 28, 2009 5:44 pm
Location: LYON FRANCE
Has thanked: 3 times
Been thanked: 41 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by benp »

Do you have news for the GetEuler, rotateto and rotate along?
Regards
INSA 1er cycle GCP projects with or without eblocks:
http://www.youtube.com/user/INSAgcp

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by JonnyW »

Good morning.

I have attached a file that shows RotateTo() along an axis
000072_3D_ System Panel.png
Original position and axis
(10.3 KiB) Downloaded 3056 times
This shows how RotateTo() essentially resets the rotation of the object to an axis. On tests with this program it looks like it is taking the axis of the parent object - I am not sure this is correct but changing this now may have impact on all sorts so I will have to investigate that here.
rotate_to_06.fcfx
Rotations using RotateTo
(11.04 KiB) Downloaded 242 times
Basically 'RotateTo()' resets the rotation of the object to align it to the angle you want. Where as RotateAlong() is incremental, so takes the previous position into account, RotateTo() is absolute - it does not take the previous position into account so therefore it does not matter where you position the object.

I would use a combination of Position.Get(), Position.Set() and RotateAlong() if that is what you are doing - RotateTo() is to reset to absolute positions and probably not suitable for your demo purposes.

As far as the GetEuler() bug I have raised it as a high priority bug (I am anxious to find out what is going on) but as we are releasing 6.1 shortly I have been asked not to look into anything not on the 6.1 'critical path' - I will keep on trying to push more on this! It looks like the Rotate...() functions are not flagging the Euler as invalid (I use quaternions internally and only convert to Euler angles when necessary as this is costly) - the GetQuat() is working OK, just not the Euler() call.

I will keep pushing, thanks for your patience.

Jonny

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: RotateTO Rotate ALONG and other 3D

Post by JonnyW »

Hello. Just to let you know the Euler bug has been found and fixed.

This will be available in the next release.

Cheers,

Jonny

Post Reply