Image scaling Macro

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Image scaling Macro

Post by renatorivo »

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

Re: Image scaling Macro

Post by microelly2 »

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
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Image scaling Macro

Post by mario52 »

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, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
JAndersM
Posts: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

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
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Image scaling Macro

Post by microelly2 »

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: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

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
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Image scaling Macro

Post by microelly2 »

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
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Image scaling Macro

Post by ickby »

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: 63
Joined: Tue Dec 22, 2015 1:35 pm

Re: Image scaling Macro

Post by JAndersM »

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

Post by keithg »

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.
Post Reply