Scaling imported images?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Scaling imported images?

Colinfontaine
I am having trouble finding the answer to this...

I am interested in creating a scale for an entire image that I have imported to LibreCAD.  The image is a basemap of my house and I know definitive dimensions from the image.  My question is which tool I use to tell LibreCAD a dimension is a specific number (like 50') and then have LibreCAD automatically scale the rest of the image to that command.

I have seen people do this in AutoCAD with the scale command, what is the analog with LibreCAD?

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

dxli
The images are inserted in dimension of pixels. (not really desired behavior).

If you want to the imported image to be specific size in drawing units, say 50 feet. Assume the "Current drawing preferences -> units" is set to use feet.

1, in snaptoolbar, click "Snap to end points" only, disable other snapping options;
2, use Info -> Distance Point to Point, to find side length (currently, it's in pixels); For example, if the image square has side length at 1024 (pixels) from "Info -> Distance Point to Point"
3, Modify->Scale, to do isotropic scaling by a factor of 50/1024 (you can type this in dialog factor box.

Colinfontaine wrote
I am having trouble finding the answer to this...

I am interested in creating a scale for an entire image that I have imported to LibreCAD.  The image is a basemap of my house and I know definitive dimensions from the image.  My question is which tool I use to tell LibreCAD a dimension is a specific number (like 50') and then have LibreCAD automatically scale the rest of the image to that command.

I have seen people do this in AutoCAD with the scale command, what is the analog with LibreCAD?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

Colinfontaine
Okay I see what you're saying..however my issue is a little more complex than that.

https://www.youtube.com/watch?v=SCNkEh5-PBs

This video around 2:50 shows what I am trying to accomplish.  This part of the video basically shows someone using the scale command in AutoCAD to make it so all lines, objects, etc in the drawing are in accordance to the graphic scale at the bottom of the basemap.  

I think you're directions pertain to the dimensions of the image itself?
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

rherr
In reply to this post by dxli
Greetings,
I am having a similar problem importing a PNG image.  The original image is about 4.5" x 2.5", however, LCAD imports it at about 450" x 250", a 100:1 difference.  I tried the modify -> scale procedure given by dxli , however, I cannot select the image when instructed to do so by the command.  I am using LCAD 2.0.7 master downloaded about April 27.  I need to scale these images by about 100:1 in order to bring it into LCAD's scale and my drawing formats' scale.  Any help would be appreciated.

BTW: I also tried running the PNG image through Inkscape 0.91 r13725 and exporting it to DXF (ACAD 14), however, LCAD crashes when I try to import it as a "block".  That's not well-behaved.

I am enclosing a snapshot of the imported image.  The small block in the lower left corner is my drawing sheet.  You can see the image will not fit.Scaling imported image

Thanks.
Girvin Herr
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

LordOfBikes
Administrator
Girvin,

it is correct, that you can't select the image for modify action, as this is not supported by LibreCAD.
What dxli described, is to scale the drawing entities to fit the image.

Your image is in a pixel format and has a resolution of 100 DPI, therefore LibreCAD imports 4.5" * 100 pixel in width resp. 2.5" * 100 pixel in height.

You could reduce the image size, but at 4 * 2 pixel you can imagine, how much details of your image will be kept .

For your case, you must scale your CAD drawing by factor 100 to match the image size. You can adjust Current Drawing Preferences to keep dimensions working for the scaled drawing. Set General Factor to 0.01 to compensate drawing dimensions and General Scale to e.g. 5, to compensate the size of dimension labels and arrow heads.
For printing select an appropriate factor too, to match the paper size.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

rherr
Armin,
Thanks for your prompt reply.
Alas, I don't think I can change the scale of the original image.  It was generated from the gEDA PCB printed circuit board editor as a PNG file.  I had tried several adjustments to the PCB PNG output parameters, such as changing the Pixels Per inch (PPI) option, with virtually the same results in LCAD.  As I said, I even tried importing the PNG file into Inkscape and converting to a DXF file, as the LCAD manual suggests, with the fatal crash results in LCAD when I tried to import it.

I did try reducing the PCB PPI option, with the results you warn about.  It looked very coarse, but still the large size.

I cannot scale the original PCB drawing, since it is obvious it must be the size of the circuit board in the real world.  To maintain two scales of the same object in PCB is not acceptable.  The whole idea of CAD/EDA is to make the processes easier and less error-prone.  To that end, I wanted to use the PCB image output for the base LCAD drawing in order to keep the accuracy and not re-draw the image.

After posting my message, I ended up importing my image into the gEDA gschem schematic capture program, which has limited mechanical drawing capabilities.  That is why I wanted to use LCAD for this process.  It looks like I can continue to use LCAD for drawings not needing an image import, while continuing to use gschem for drawings I need to import an image for.

Note to the LCAD devs:  It might be a good thing to look into the gschem image import code.  The version of gschem I am using, 1.8.2, allows scaling the image prior to instantiation by dragging the opposite corner, as well as rescaling the instantiated image, by dragging a corner.  It keeps the x-y ratio when doing so.  It worked great.

Thanks again,
Girvin
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

Mike Hayes
Like Armin said in his post above, if you reduce the size of the bitmap image you will reduce its quality. For example, if you halve the size of the bitmap image then every block of 4 pixels will be downgraded to a single pixel.

Your problem is similar to the one that occurs when tracing old architectural plans which have been scanned from paper copies.

The practical solution is to import the highest resolution version of the bitmap image that you posess into LibreCAD. This will preserve the maximum amount of detail and enable you to make the best quality trace.

After you have imported the bitmap, just ignore the scale for the time being and trace it.

Once you have a vector trace, you no longer need the bitmap and you can delete it from LibreCAD.

Then, knowing the real world size of a particular component of the drawing, you can use the scale command to accurately resize the whole thing.

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

dellus
In reply to this post by rherr
Hello,
do I misunderstand something? For me scaling the image as dxli described works and does the job. Done in win 2.07 and lin 2.01.

greetings dellus

Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

LordOfBikes
Administrator
@dellus, it seems as if I misunderstood something. Testing this again on a Windows PC works for me too. I misinterpreted dxli's post, as scaling the image on my Ubuntu box doesn't work. I have to verify why.

@rherr, as dellus posted correctly, the scaling of imported image should work generally. I'll check, if I made a mistake or if there is a platform dependent issue with this.
On which platform do you use LibreCAD?
Did you install from binary installer or have you build from source?

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

LordOfBikes
Administrator
Well, after another test on my Ubuntu box, I have to apologize for bringing confusion to this thread, it works on Ubuntu too.
Next time I will think twice and post once .

@rherr, so forget my first post, scaling of imported images works in LibreCAD.
Thus, give the Modify->Scale tool a try again. When the imported image is factor 100:1, use a scale factor of 0.01. Watch the command line label, it tells you what to do next. After selecting the image, don't miss to hit ENTER or click the double arrows on the bottom of the selection tool bar to continue.
If you still have problems with scaling, please let us know.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Scaling imported images?

dieselsanddust
Another way to accomplish this is to first insert the image.

Then draw a single line on imported image along an entity of know length.(i.e. wall at 50 units or overall building length) Determine the length of the line drawn according to LibreCAD. In this case the line turned out to be 2 ft long.

Next select the image to scale and use the scale tool. For the scaling ratio type in 50/2 and the image will be increased in size 25x so now the image is 1:1 scale.

Finally, delete the single line used to determine the scale ratio...Not super intuitive, but it works.