Do I need always the Rotation centre argument ?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Do I need always the Rotation centre argument ?

Post by manos »

I see some differences at the behaviour of objects when they are positioned away from Origin(0,0,0) and Rotated.
THere are two objects at this file both away from the Origin.
The prism is rotated as if the Axis of Rotation pass through the axis of symmetry of the prism i.e. no need for centre argument.
But the other object -the pad- rotates as if the Axis of Rotation passes through the Origin(0,0,0) i.e. there is need for centre argument.
Any explanation ?

Code: Select all

OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * workfeature-macro
  * Manipulator 1.4.9
  * Help 1.0.3
  * workfeature
Attachments
sent2.py
(950 Bytes) Downloaded 15 times
Box1.FCStd
(17.73 KiB) Downloaded 14 times
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Do I need always the Rotation centre argument ?

Post by onekk »

Hello,

This is due to the concept of "reference point" see at bottom of:

https://wiki.freecadweb.org/Placement

If for pad you intend a box that is build with the "lower left corner" at Origin (0,0,0), see:

Part.Box left (minx), front (miny), bottom (minz) vertex

This involve that if you want to rotate a box you have to specify a center,

In case of a sketch, if depends on how you have build the sketch, if you have build it with a centre in the Origin, you have no "dipsplacement" to do, if not you have to specify your "desired centre of rotation".

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Do I need always the Rotation centre argument ?

Post by manos »

onekk wrote: Tue Sep 27, 2022 7:21 am Hello,

This involve that if you want to rotate a box you have to specify a center,
In general if I do not specify any centre there is always a default one (centre of sphere, Part cylinder: centre of bottom face, etc) or not ?
Regards
Carlo D.
Thank you Carlo D.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Do I need always the Rotation centre argument ?

Post by onekk »

Yes at bit of the Placement page you will find the "reference points" of "primitive solids".

When building with scripting I usually build solids having the centre at the centre of the bottom face as most of the "primitive solids".

But is a way to avoid problems when calculating things.

Regards.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Do I need always the Rotation centre argument ?

Post by manos »

onekk wrote: Tue Sep 27, 2022 1:16 pm Yes at bit of the Placement page you will find the "reference points" of "primitive solids".

When building with scripting I usually build solids having the centre at the centre of the bottom face as most of the "primitive solids".

But is a way to avoid problems when calculating things.

Regards.

Carlo D.
Thanks Carlo.
Post Reply