Create and display local coordinate system
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Create and display local coordinate system
Well my first argument for it would be that mostly all parametric cad systems have it, here is a quick search around the internet for some screenshots of nx, creo, inventor, solidworks, catia (see videos before),... I am sure other have it also.
Use cases... I guess more or less all use cases that airplanes are used for in Lattice; things seen in the few catia videos I have posted in this topic; Zolko's case for Part placement in assemblies; Pauvres_honteux also talked about this before https://forum.freecadweb.org/viewtopic. ... 79#p140379 (check also pdf's),...
<Edit>I guess it can be useful also for Path WB, to set different, user defined coordinate systems, for cnc machines...<End of edit>
I guess to understand csys compared to existing datum elements (point, planes, lines) one can think about the different degrees of freedom that each of them sets for the user, a point in space defines the three coordinates (x,y,z) but generally does not define the orientation; a plane defines the orientation and one coordinate (lets say z) the other two (x,y) are defined when something is placed on that plane; an csys defines everything... sort of
Use cases... I guess more or less all use cases that airplanes are used for in Lattice; things seen in the few catia videos I have posted in this topic; Zolko's case for Part placement in assemblies; Pauvres_honteux also talked about this before https://forum.freecadweb.org/viewtopic. ... 79#p140379 (check also pdf's),...
<Edit>I guess it can be useful also for Path WB, to set different, user defined coordinate systems, for cnc machines...<End of edit>
I guess to understand csys compared to existing datum elements (point, planes, lines) one can think about the different degrees of freedom that each of them sets for the user, a point in space defines the three coordinates (x,y,z) but generally does not define the orientation; a plane defines the orientation and one coordinate (lets say z) the other two (x,y) are defined when something is placed on that plane; an csys defines everything... sort of
- Attachments
-
- solidworks.png (18.47 KiB) Viewed 2522 times
-
- inventor.png (19.64 KiB) Viewed 2522 times
-
- creo.png (28.73 KiB) Viewed 2522 times
-
- nx.png (12.44 KiB) Viewed 2522 times
Last edited by saso on Tue Aug 06, 2019 11:56 pm, edited 3 times in total.
Re: Create and display local coordinate system
I would say for my self. i use coordinate system most to define placement on higher/ lower level.
I use it less often for modeling purposes.
but in any case why are creating datum planes and datum axis seen as an need but is a datum coordinate system not needed.
all datum features have it's own (personal) use case. off course some are used more often but i think all should be implemented.
I use it less often for modeling purposes.
but in any case why are creating datum planes and datum axis seen as an need but is a datum coordinate system not needed.
all datum features have it's own (personal) use case. off course some are used more often but i think all should be implemented.
I agree on this. Maybe we should make an separate topic from this. that it don't get lost in this topic and it's more easy to find it back.
Re: Create and display local coordinate system
Did you find where to enable this in the sourcecode, or was that screenshot photoshopped ?
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Create and display local coordinate system
Well, these are potential uses, not ones that we get working for free (well, except I made Lattice support them already). As a result, the request to include them into 0.18 that is probably to be released soon seems strange: we get a thing that doesn't do much, yet has a lot of potential... kinda disappointing.
But it can be done... after all, something can be much better than nothing. I'm for! Who's up to write the code?
Re: Create and display local coordinate system
In the file ~/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc there is mention of <file>icons/PartDesign_CoordinateSystem.svg</file> , and indeed the icon file exists. Therefore I believe it's only a matter of enabling the button.
Then there is another subject about the LCS: it is visually defined in ~/src/Mod/PartDesign/Gui/ViewProviderDatumCS.cpp, in "void ViewProviderDatumCoordinateSystem::attach ( App::DocumentObject *obj )". It is not very satisfactory.
But a much nicer LCS implementation exists, it's called AxisCross, and can be (visually) enabled in the menu "View → Toggle axis Cross". That is defined in ~/src/Gui/View3DInventorViewer.cpp, in the function "void View3DInventorViewer::setAxisCross(bool on)"
If it were be possible to use the same visual for the LCS as for AxisCross, it would be awesome.
- Attachments
-
- LCS_AxisCross.png (190.84 KiB) Viewed 2407 times
Re: Create and display local coordinate system
It was Gimped For testing and playing I am ok with the command line, so I will wait to hopefully see an official solution for the gui, but if you really want it you can add it as a macro.
Re: Create and display local coordinate system
Likely, as it was suggested back then, we should have introduced a coordinate system feature named Coordinate system. We named it Part feature instead, and have left the door for ambiguity wide open.
Re: Create and display local coordinate system
gotcha, succeeded at last:
And it's not GIMP'ed either (well, apart from the red circle). Unfortunately, I don't completely remember what did the thing, because I've been modifying loads of files. If someone wants to try, it's at least in the file ~/src/Mod/PartDesign/Gui/Command.cpp, and you have to duplicate the section about "Datum feature commands", and add before DEF_STD_CMD_A(CmdPartDesignPlane);
Code: Select all
DEF_STD_CMD_A(CmdPartDesignCS);
CmdPartDesignCS::CmdPartDesignCS()
:Command("PartDesign_CoordinateSystem")
{
sAppModule = "PartDesign";
sGroup = QT_TR_NOOP("PartDesign");
sMenuText = QT_TR_NOOP("Create a local coordinate system");
sToolTipText = QT_TR_NOOP("Create a new local coordinate system");
sWhatsThis = "PartDesign_CoordinateSystem";
sStatusTip = sToolTipText;
sPixmap = "PartDesign_CoordinateSystem";
}
void CmdPartDesignCS::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::CoordinateSystem"),"LCS");
}
bool CmdPartDesignCS::isActive(void)
{
if (getActiveGuiDocument())
return true;
else
return false;
}
Code: Select all
rcCmdMgr.addCommand(new CmdPartDesignCS());
and recompile.
Re: Create and display local coordinate system
... and you also have to add them to the menu and toolbar, in ~/src/Mod/PartDesign/Gui/Workbench.cpp, add in Gui::MenuItem* Workbench::setupMenuBar and in Gui::ToolBarItem* Workbench::setupToolBars
Code: Select all
Gui::MenuItem* Workbench::setupMenuBar() const
...
<< "PartDesign_Plane"
<< "PartDesign_CoordinateSystem"
Code: Select all
Gui::ToolBarItem* Workbench::setupToolBars() const
...
<< "PartDesign_Plane"
<< "PartDesign_CoordinateSystem"
-
- Veteran
- Posts: 7790
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: Create and display local coordinate system
Whow, after a while the axis cross is here. Very nice, Thank's to the developer.Zolko wrote: ↑Mon Jan 07, 2019 8:27 pmgotcha, succeeded at last:
Create_LCS.png
And it's not GIMP'ed either (well, apart from the red circle). Unfortunately, I don't completely remember what did the thing, because I've been modifying loads of files. If someone wants to try, it's at least in the file ~/src/Mod/PartDesign/Gui/Command.cpp, and you have to duplicate the section about "Datum feature commands", and add before DEF_STD_CMD_A(CmdPartDesignPlane);
also, at the end, in CreatePartDesignCommands, addCode: Select all
DEF_STD_CMD_A(CmdPartDesignCS); CmdPartDesignCS::CmdPartDesignCS() :Command("PartDesign_CoordinateSystem") { sAppModule = "PartDesign"; sGroup = QT_TR_NOOP("PartDesign"); sMenuText = QT_TR_NOOP("Create a local coordinate system"); sToolTipText = QT_TR_NOOP("Create a new local coordinate system"); sWhatsThis = "PartDesign_CoordinateSystem"; sStatusTip = sToolTipText; sPixmap = "PartDesign_CoordinateSystem"; } void CmdPartDesignCS::activated(int iMsg) { Q_UNUSED(iMsg); UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::CoordinateSystem"),"LCS"); } bool CmdPartDesignCS::isActive(void) { if (getActiveGuiDocument()) return true; else return false; }
Code: Select all
rcCmdMgr.addCommand(new CmdPartDesignCS());
and recompile.