Do you see icons on the other drop-down tool buttons, e.g. arc, circle?I wonder, should icons appear besides the labels in the drop down menu? I'm guessing from a previous screen capture that they should...
[Merged]Regular polygons
Re: [Merged]Regular polygons
Re: [Merged]Regular polygons
I don't see icons in the other drop-downs. I see the icons in the workbench switcher.
I will reboot in Ubuntu 12.04 to compare... FYI my desktop is Unity/GNOME.
I will reboot in Ubuntu 12.04 to compare... FYI my desktop is Unity/GNOME.
Re: [Merged]Regular polygons
Well, then it's a general issue. On 12.04 I also use Unity/Gnome and menus in general don't show any icons there.
Re: [Merged]Regular polygons
Hi guys
OS: Ubuntu 14.04.1 LTS
Word size: 64-bit
Version: 0.15.3789 (Git)
Branch: master
Hash: a1da4bb4fbd0c715edf7b9eecc9d19c0a84511b0
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1
Jim
The icons appear OK for me in Kubuntu 14.04 64bit.normandc wrote: I wonder, should icons appear besides the labels in the drop down menu? I'm guessing from a previous screen capture that they should...
I can see that it could be a good idea, is there any "down side"? I was thinking that for now we could at least add one manually by creating a circle with three points on line constraints and setting it to construction mode, although that is quite a few clicks and therefore not very convenient.normandc wrote:normandc wrote:I agree, I like to have a construction circle so the polygon can be centered.wmayer wrote:+ maybe we should think about creating the regular polygon using the construction circle.
OS: Ubuntu 14.04.1 LTS
Word size: 64-bit
Version: 0.15.3789 (Git)
Branch: master
Hash: a1da4bb4fbd0c715edf7b9eecc9d19c0a84511b0
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1
Jim
Re: [Merged]Regular polygons
Just did a clean out-of-source build and the icons in dropdowns work fine. FWIW, I'm using KDE 4.11.3 at the moment. -Ian-wmayer wrote:Well, then it's a general issue. On 12.04 I also use Unity/Gnome and menus in general don't show any icons there.
OS: "Fedora release 20 (Heisenbug)"
Word size: 64-bit
Version: 0.15.3789 (Git)
Branch: master
Hash: a1da4bb4fbd0c715edf7b9eecc9d19c0a84511b0
Python version: 2.7.5
Qt version: 4.8.6
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Re: Regular polygons
Hi,
I've been away these last couple of days.
Regarding the second point, another way of achieving similar speedups would be to hold back the recompute() command from these python script commands. I think this would be a more straight forward way when using c++. An alternative would be to delegate the creations of regular polygons to a python script in the Profile library just like the hexagon script. Similar to
we could generate a command like
What do you think?
/Johan
I've been away these last couple of days.
I totally agree, I can look into making the appropriate changes.wmayer wrote: Two points:
+ maybe we should think about creating the regular polygon using the construction circle. Then we can support arbitrary regular polygons.
+ I noticed that after adding a few profiles the adding of new elements becomes very slow. You can even see that new lines and constraints are added step by step. To solve this issue I extended the interface of addGeometry() and addConstraint() a while ago so that all geometries and all constraints can be added in one step. This reduces the required time dramatically.
Regarding the second point, another way of achieving similar speedups would be to hold back the recompute() command from these python script commands. I think this would be a more straight forward way when using c++. An alternative would be to delegate the creations of regular polygons to a python script in the Profile library just like the hexagon script. Similar to
Code: Select all
import ProfileLib.Hexagon
ProfileLib.Hexagon.makeHexagonSimple('Sketch')
Code: Select all
import ProfileLib.RegularPolygon
ProfileLib.RegularPolygon.makeRegularPolygon('Sketch',"centerpoint", "first corner point")
/Johan
Re: [Merged]Regular polygons
It's not the document's recompute() function because this isn't called at all at this time. The bottleneck is that the sketch solver is called for every little addition of a constraint. See the method SketchObjectPy::addConstraint.Regarding the second point, another way of achieving similar speedups would be to hold back the recompute() command from these python script commands. I think this would be a more straight forward way when using c++.
That would be pretty good because it's much easier to write down and fix this Python code.An alternative would be to delegate the creations of regular polygons to a python script in the Profile library just like the hexagon script. Similar to
Re: [Merged]Regular polygons
I've done the discussed changes now. In ProfileLib there is a RegularPolygon.py defining makeRegularPolygon(...), which takes the name of the sketch, the number of corners, the center point as an App.Vector and the first corner as an App.Vector as arguments in that order.
The code
will create a hexagon centered at (-5,1) and has one corner at (10,-5). The creation is much faster than before, but for regular polygons with many corners ( I tried 45), my debug build is very slow when modifying the sketch.
I've so far noticed that the version with construction circle is quite sensitive to large changes ( a pentagon became a triangle and so forth). The code is once again available at https://github.com/DevJohan/FreeCAD_sf_ ... cherguihex.
The code
Code: Select all
import ProfileLib.RegularPolygon
ProfileLib.RegularPolygon.makeRegularPolygon('Sketch',6,App.Vector(-5,1,0),App.Vector(10,-5,0))
I've so far noticed that the version with construction circle is quite sensitive to large changes ( a pentagon became a triangle and so forth). The code is once again available at https://github.com/DevJohan/FreeCAD_sf_ ... cherguihex.
Re: [Merged]Regular polygons
Oh, something seems wrong. I get some merge conflicts when trying to rebase on master but I can also copy&paste the changes. Then it seems you forgot to add the file RegularPolygon.py
Re: [Merged]Regular polygons
Ok, thanksThen it seems you forgot to add the file RegularPolygon.py
Will look at the other stuff as well