Notes about Coordinate systems

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!
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Notes about Coordinate systems

Post by manos »

chrisb wrote: Sat Jul 02, 2022 11:38 pm
manos wrote: Sat Jul 02, 2022 10:22 pm
The phrase should be "Objects with shape have their own Coordinate System"
Not true, all PartDesign features have a shape but no coordinate system.
OK .Would you complete the sentence : ..........have their own Coordinate System. ?
If not the only alternative for me would be: Objects with coordinate system have their own coordinate system.!!!
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Notes about Coordinate systems

Post by chrisb »

manos wrote: Sun Jul 03, 2022 4:16 pm OK .Would you complete the sentence : ..........have their own Coordinate System. ?
"Many" would be the right word here. If they have a placement they have their own coordinate system. But there are objects where the Placement is hidden, so I would not go into detail here on this intro level.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Notes about Coordinate systems

Post by manos »

chrisb wrote: Sun Jul 03, 2022 4:22 pm
manos wrote: Sun Jul 03, 2022 4:16 pm OK .Would you complete the sentence : ..........have their own Coordinate System. ?
"Many" would be the right word here.
OK So the sentence will be: "Many objects have their own Coordinate System"

Thanks and Done.
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Notes about Coordinate systems

Post by manos »

So this is the new version -0.5- of Notes about Coordinate Systems Part 1.

Most info of this text has been gathered from Posts:
https://forum.freecadweb.org/viewtopic. ... an#p607052

https://forum.freecadweb.org/viewtopic.php?f=3&t=69950.

Thank you so much for the help.

I will start the: Notes about Coordinate Systems Part 2, with notes mostly about Attachments

The text of this Notes Part 1 follows:
-------------------------------------------------------------------------------------------------------------------------------------
COORDINATE SYSTEMS AT FreeCad Part 1 V 0.5 2022-07-03
The objects at space are positioned using Coordinate systems. The most used system is the Cartesian.

In this system the three axis are perpendicular to each other.
The most "general" Cartesian Coordinate system in FC is the global axis system. It is a system with invariable axis.
We can view the Global axis system using the command Std AxisCross.

Most FC objects comprise their own Coordinate system. It is very important to know every moment when with FC, to which axis system we are referred. If not, error messages will appear and the outcome will be a mess.

Many objects have their own Coordinate system: Body, Std Part, Sketch, and many other Objects

The following objects do not have their own axis system: Group and some other.

We can view the (Local) Coordinate system of the Body: Tree view ->Body->Origin and hitting Space. The same for Std Part.

Sketches have their own Coordinate system too. So it is OK telling “Point A is at 5,32 mm along the X axis of SketchB" ”. We can see their C. System only while editing. Then axis X, Y, Z of the sketch are the X,Y,Z axis of the Local Coordinate System of the sketch.

Many Objects contained in a Body have their own Coordinate system. But we can’t see their Origin neither at Tree nor at 3D View. We use it through Attachment and Placement properties.

Inside the Body we can create an Auxiliary Local Coordinate system using the command: PartDesign CoordinateSystem. It can be used by objects inside the Body and not only .

If we want to combine more bodies to make an Assembly we can use a Std Part. A Std Part provides its own (Local) Coordinate System. It can be used by objects inside the Std Part (e.g. bodies) and not only.
Bodies inside a Std Part keep their own coordinate System.

------------------------------------------------------------------------------..
Most info of this text has been gathered from Posts:
https://forum.freecadweb.org/viewtopic. ... an#p607052

https://forum.freecadweb.org/viewtopic.php?f=3&t=69950
Attachments
CoordSystems_4.txt
(2.04 KiB) Downloaded 10 times
CoordSystems_4.doc
(14.5 KiB) Downloaded 8 times
User avatar
onekk
Veteran
Posts: 6149
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Notes about Coordinate systems

Post by onekk »

manos wrote: Sun Jul 03, 2022 4:00 pm Or simply that a mess up of terms has occured followed by misjudgement of data, facts and text.
Mea culpa.
I apologize for my rude sentence, thanks for the plain reply.
:oops:

Sometimes it is difficult to have an overall view and make wrong judgements.

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: Notes about Coordinate systems

Post by manos »

onekk wrote: Mon Jul 04, 2022 9:11 am
OK onekk thanks also from me.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Notes about Coordinate systems

Post by Zolko »

onekk wrote: Sun Jul 03, 2022 10:12 am FC is build upon two "main" pieces of code:

1) OCCT or the "modelling engine", that is the "core" orf FC
2) Coin3D (Pivy) that is the "visualization engine" of FC
I think that this is the most important information: the core modelling kernel (OCC) describes an object, and the scenegraph (Coin3D) places that object somewhere in space. This placement is done with reference to a coordinate system, which needs 6 numbers, also called degrees of freedom: 3 numbers of position (X, Y Z) and 3 numbers for orientation (Eurler's angles). FreeCAD is "only" a glue between these 2, and provides a method to calculate the 6 numbers for the 6 degrees of freedom.

Such coordinate systems can be nested, meaning that an object can be in a coordinate system which is itself in another coordinate system: think of this like an object in a train : the object's position is defined relative to the train, and the position of the train is defined relative to the landscape. The absolute position of the object in the landscape is the combination of its position in the train + the position of the train in the landscape.

It's very different from the position given by the GPS, which is always absolute .... and is not Cartesian.

In FreeCAD, each document has a coordinate system, which could be called WCS for World Coordinate System. Then, there are objects that have their own Local Coordinate Systems (LCS) and that are called "containers" because they contain other "objects", and the position of these objects is defined in those LCS. Such containers can contain other containers.

In FreeCAD, the placement of any object is defined by a property called "Placement" and which contains the 6 numbers for the 6 degrees of freedom : a position (called "Base") and an orientation (called "Rotation"). This Placement is relative to the LCS of the container the object is in. If you change the object from a container to another, the object will keep its "Placement" properties values but they will now apply relative to the LCS of the new container. Managing those placement relative to a container is the job of the scenegraph (Coin3D)

In FreeCAD, there are several ways to change the values of this Placement property: manually by entering numbers in the property view, manually by moving the object with the "Transform" tool, by calculations through some ExpressionEngine (a FreeCAD internal tool), by Attachment where the Placement is calculated relative of other geometrical objects ... but in-fine, all these methods only calculate the 6 values of the Placement property. This is a core FreeCAD functionality.
try the Assembly4 workbench for FreCAD — tutorials here and here
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Notes about Coordinate systems

Post by manos »

Zolko wrote: Mon Jul 04, 2022 11:27 am
Lot of infos at your post Zolko. Those about placement very useful.
Thanks indeed
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Notes about Coordinate systems

Post by adrianinsaval »

Very good post by Zolko, but just to clarify internally FreeCAD doesn't directly use euler angles but a vector and an angle to rotate around said vector, the euler angles are exposed in some dialogs but they are then converted to axis+angle notation and this is shown in the property view.

Haven't looked at the latest version of the text yet but just as a reminder, IMO it's also very important to talk about attachment offsets.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Notes about Coordinate systems

Post by Zolko »

adrianinsaval wrote: Mon Jul 04, 2022 1:48 pm internally FreeCAD doesn't directly use euler angles but a vector and an angle to rotate around said vector
I think that internally a rotation is defined by quaternions, which is the proper way to do it :

Code: Select all

private:
    void normalize();
    void evaluateVector ();
    double quat[4];
    Vector3d _axis; // the axis kept not to lose direction when angle is 0
    double _angle; // this angle to keep the angle chosen by the user
axis and angle are only kept for reference

Code: Select all

bool Rotation::isIdentity() const
{
    return ((this->quat[0] == 0.0  &&
             this->quat[1] == 0.0  &&
             this->quat[2] == 0.0) &&
            (this->quat[3] == 1.0 ||
             this->quat[3] == -1.0));
}
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply