Sketcher: Ellipse support

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

abdullah wrote:Case 1: I select the ellipse first so I constraint it with respect to the reference line. So for example if I would start with an original situation as the second figure, I select first the ellipse and then the line and give 45º, I will get to an end result of figure 1.
Yes, exactly. :-) Which could initially confuse, or more likely just surprise, a newbie but at least the behaviour would be totally consistent, predictable and give a guarantee of a clearly defined out put. If the above happened in error, then a user can just click undo, reverse the selection order and repeat applying the constraint or just change the value of the angle to give the same result.

If we use this logic then someone can equally easily apply an "Ellipse axis angle" constraint to either the internal or external angle...whichever is the most convenient for their specific situation.

But as we have both said these are our opinions. I am happy to be told I am wrong, if I am... :)

I would seriously like to know what Norm and others with a lot of CAD experience think about this.


I'll fix up the xpm.

By the way, I normally make an icon in Inkscape, if I want a bit map of it I export as bitmap from Inkscape which gives you a PNG. I then import it into the Gimp, then export as xpm. Like you said though, for small edits I just use a text editor. :)

Jim
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

This is an extremelly alpha stage, just for those who want to play (basically I expect Jim to play with it).

The code is ugly :oops: and do not expect too much :?

To https://github.com/abdullahtahiriyo/Fre ... master.git
* [new branch] sketcher_elipse -> sketcher_elipse

Specially:
- Do not expect the ellipse to be draggable.
- Do not expect that the angle with reference to a line works.
- Do not expect Tangent, Point on object, ... constraints to work.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

abdullah wrote: (basically I expect Jim to play with it)
And I am!!! :)

I have pulled it, configured with OCE from their master with TBB on and it is compiling now.

I have to go now for a few hours...

Jim
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

I'll fix up the xpm.

By the way, I normally make an icon in Inkscape, if I want a bit map of it I export as bitmap from Inkscape which gives you a PNG. I then import it into the Gimp, then export as xpm. Like you said though, for small edits I just use a text editor. :)
Well, it is certainly a way of doing it... I just ask Jim for help... :lol:

I use the liboce of the daily PPA... BTW what is TBB?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

abdullah wrote:I use the liboce of the daily PPA... BTW what is TBB?
After Norm has updated the PPA which he said should be there, was it today or tomorrow?, I think,...then the daily PPA liboce will be close to the same. It will be oce 0.16 where as I have master that is what will become 0.17. :-)

TBB is multi threading stuff from Intel, oce can use it for a few limited uses.

This is it in wikipedia
http://en.wikipedia.org/wiki/Threading_Building_Blocks

I see it stand for Threading Building Blocks...
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

Hi Abdullah

I get a build error, compiling from you ellipse branch.

94%] Building CXX object src/Mod/Import/Gui/CMakeFiles/ImportGui.dir/Workbench.cpp.o
[ 94%] Building CXX object src/Mod/MeshPart/Gui/CMakeFiles/MeshPartGui.dir/Workbench.cpp.o
Linking CXX shared library ../../../../Mod/Import/ImportGui.so
Linking CXX shared library ../../../../Mod/MeshPart/MeshPartGui.so
[ 94%] Built target ImportGui
make[2]: *** No rule to make target `/home/user/Downloads/cad/FreeCAD/abdullah/code/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg', needed by `src/Mod/Sketcher/Gui/qrc_Sketcher.cxx'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 94%] Generating moc_TaskDlgEditSketch.cpp
make[1]: *** [src/Mod/Sketcher/Gui/CMakeFiles/SketcherGui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 94%] Built target MeshPartGui
make: *** [all] Error 2
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

I get a build error, compiling from you ellipse branch.
I forgot to add your art files to the repo. I have just pushed a fix...
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

and here is a screen shot.
ellipsesinsketcherabdullah.jpg
ellipsesinsketcherabdullah.jpg (88.04 KiB) Viewed 2409 times

You probably don't want bug reports and comments yet...but in case it helps

I see that you have to create the major diameter thus define the axis first then the minor radius via the second point anywhere on the circumference.

If I put a centre point lock constraint first, then it will only let me use major radius constraint ...whenever I try to use minor radius constraint it will always pop-up an error message that the minor radius must be smaller than the major axis...even though it is it still thinks it isn't.

otherwise its a great so far. :-)

Jim
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

You probably don't want bug reports and comments yet...but in case it helps

I see that you have to create the major diameter thus define the axis first then the minor radius via the second point anywhere on the circumference.

If I put a centre point lock constraint first, then it will only let me use major radius constraint ...whenever I try to use minor radius constraint it will always pop-up an error message that the minor radius must be smaller than the major axis...even though it is it still thinks it isn't.
Bug reports about basic features are welcome (please do not report Tangent constraint is not working yet !!! ;) ). In fact this bug report made me realise that I had a problem from where phi was measured if the user created an ellipse in the CW sense. This has been fixed now.

This was the source of many (but not all) the problems relating to major<minor when not true.

I will look further into that error message (I rushed a lot yesterday to publish the code... and when one rushes... :oops: )
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

Here is a test model
ellipsetests1.jpg
ellipsetests1.jpg (99.25 KiB) Viewed 2376 times

here is the file
ellipsetests1.fcstd
(1.98 MiB) Downloaded 74 times

I noticed that the two radii and axis constraints don't show up in the property editor for the sketches...you probably just haven't got that far yet. :)

Jim
Post Reply