Image scaling Macro

Need help, or want to share a macro? Post here!
renatorivo
Posts: 1856
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Postby renatorivo » Tue Jan 19, 2016 4:04 pm

the finished page
Image scaling
with both images, available for corrections, if necessary
User avatar
microelly2
Posts: 3668
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Image scaling Macro

Postby microelly2 » Wed Jan 20, 2016 5:34 am

Very nice and useful.
I have done a short movie to illustrate the workflow:
Given the blueprint of a model create it again .. https://youtu.be/2iFE40uHrA8

Making the Image half transparent would be helpful ...
mario52
Posts: 2288
Joined: Wed May 16, 2012 2:13 pm

Re: Image scaling Macro

Postby mario52 » Wed Jan 20, 2016 10:56 am

hi JAndersM
I added the title in your macro to history, nice work

Code: Select all

__title__   = "Macro Image Scaling"
__author__  = "JAndersM"
__url__     = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.01"
__date__    = "19/01/2016"
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets. My macros on Gist.github
JAndersM
Posts: 46
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Postby JAndersM » Wed Jan 20, 2016 6:49 pm

mario52 wrote:hi JAndersM
I added the title in your macro to history, nice work
Thanks!
microelly2 wrote:Very nice and useful.
I have done a short movie to illustrate the workflow:
Given the blueprint of a model create it again .. https://youtu.be/2iFE40uHrA8
:) Good video!
microelly2 wrote:Making the Image half transparent would be helpful ...
Yes.
Also noted from your video that a "move to origin" function would be useful. You click on the point in the image that you want to be in the 3D-origin and its moved there.

It seems to me that the Image Workbench can be improved a lot with a number of useful but not too complicated tools.
User avatar
microelly2
Posts: 3668
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Image scaling Macro

Postby microelly2 » Wed Jan 20, 2016 10:35 pm

JAndersM wrote: Also noted from your video that a "move to origin" function would be useful. You click on the point in the image that you want to be in the 3D-origin and its moved there.

It seems to me that the Image Workbench can be improved a lot with a number of useful but not too complicated tools.
Yes, indeed.

* Position markers/move to origin
* Change the transparency of images (its possible in open inventor)
* and cuted images

are interesting next steps.
JAndersM
Posts: 46
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Postby JAndersM » Thu Jan 21, 2016 8:36 am

The workbench is written in c++ so it's not as easily accessible as if it was coded in Python. The image importer seems to use alpha-cannel for the displayed image but it's not exposed to the user-interface so you need to change the c++ code to enable setting semi-transparent images if I understands how it works.
User avatar
microelly2
Posts: 3668
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Image scaling Macro

Postby microelly2 » Thu Jan 21, 2016 9:54 am

Programming in C++ is to to time consuming for me.

I see two steps
First have a prototype in pyhton with one or more macros
Then finding somebody who will port it into c++ and intergrate it to the workbench
ickby
Posts: 2779
Joined: Wed Oct 05, 2011 7:36 am

Re: Image scaling Macro

Postby ickby » Thu Jan 21, 2016 10:00 am

Or replace the workbench with python alltogether. I mean it only has two tools with very little functionlity, this could easily be done in python too, if someone is willing to put work into this.
JAndersM
Posts: 46
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Postby JAndersM » Thu Jan 21, 2016 11:41 am

ickby wrote:Or replace the workbench with python alltogether. I mean it only has two tools with very little functionlity, this could easily be done in python too, if someone is willing to put work into this.
This is probably the best solution
keithg
Posts: 1
Joined: Thu Aug 18, 2016 1:47 pm

Re: Image scaling Macro

Postby keithg » Thu Aug 18, 2016 1:59 pm

I registered on this forum simply to say thank you for this macro. I have to use reference drawings a lot and this will save me sooo much time. Well done.