0.16 Features We'd Like To See

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
godblessfq
Posts: 109
Joined: Fri Jul 17, 2015 7:40 pm

Re: 0.16 Features We'd Like To See

Post by godblessfq »

Hello everyone,
Maybe the preference dilogue can be improved.
I'd like the tool icon size to have more options. I want the size 20 and it's not in the dropdown list.
I have to modify user.cfg file in my home folder:
<FCInt Name="ToolbarIconSize" Value="20"/>
But that is overwriten the next time preference is set and I need to change it back again.
Why not just left it as an editable box?
OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5632 (Git)
Build type: Release
godblessfq
Posts: 109
Joined: Fri Jul 17, 2015 7:40 pm

Re: 0.16 Features We'd Like To See

Post by godblessfq »

Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: 0.16 Features We'd Like To See

Post by cox »

godblessfq wrote:Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.
Sound intuitive :) +1
Need help? Feel free to ask, but please read the guidelines first
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: 0.16 Features We'd Like To See

Post by microelly2 »

godblessfq wrote:Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.

Code: Select all

import math
import FreeCAD,Draft
camera = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
a=str(camera.position.getValue().toString())
al=a.split(' ')

v=Draft.makeShape2DView(FreeCAD.ActiveDocument.YourObject)
v.Projection=(float(al[0]),float(al[1]),float(al[2]))
I still have to understand the rotation angle - tomorrow.
godblessfq
Posts: 109
Joined: Fri Jul 17, 2015 7:40 pm

Re: 0.16 Features We'd Like To See

Post by godblessfq »

Thank you for the macro. I am gonna to replace the shape2dview tool with it. :)
mario52
Veteran
Posts: 4674
Joined: Wed May 16, 2012 2:13 pm

Re: 0.16 Features We'd Like To See

Post by mario52 »

hi microelly2
i modify your code for use with one object selected
I would put it in the wiki, what name can we give it
if you agree !

Code: Select all

import math
import FreeCAD,Draft

try:
    sel = FreeCADGui.Selection.getSelection()[0]
    camera = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
    a=str(camera.position.getValue().toString())
    al=a.split(' ')

    v=Draft.makeShape2DView(FreeCAD.ActiveDocument.getObject(sel.Name))
    v.Projection=(float(al[0]),float(al[1]),float(al[2]))
    App.ActiveDocument.recompute()
except Exception:
    print "Select one object"
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: 0.16 Features We'd Like To See

Post by microelly2 »

Good idea mario,
I would it call 2DView and store into https://github.com/FreeCAD/FreeCAD-macros
There is already a macro Foto.FCMacro, which makes a picture (still works from top view)

Do you have access to that git or I can check it in.
I want to make some more modification next:

1. rotate to view in a way that the real z-axis maps to the y-axis of the 2dView

2. and we should make the exeption handling stronger.

Code: Select all

def errorDialog(msg):
    diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u"Error Message",msg )
    diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint)
    diag.exec_()
    
 ....    
except Exception:
    errorDialog( "Select one object")
mario52
Veteran
Posts: 4674
Joined: Wed May 16, 2012 2:13 pm

Re: 0.16 Features We'd Like To See

Post by mario52 »

hi
microelly2 wrote:I would it call 2DView
ok and the icon ?
microelly2 wrote:Do you have access to that git or I can check it in.
no
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: 0.16 Features We'd Like To See

Post by microelly2 »

I don't see a simple solution to get the right direction of generated figure by a script.
somewhere behind Drawing.projectEx and HLRAlgo_Projector may be a way to get the things right,
but for me a running script is better than hours to read.

So my proposal: Create a Draft.Clone of the part, Rotate this clone to get the right view from +z
and then create the shape2View from this clone.

May be someone can tell me how the rotation logic is :?
(otherwise I will put the proposal into a macro)
Post Reply