What is the size of the drawing area?

Next
 From:  ggagnon
4128.1 
I hope I can express my question clearly.
When I use Ctrl-P, an image of the drawing area (2560x2048 pixels) is transfered to the clipboard.
I then paste the image in Irfanview and print it.
I can print with a scale 1:1 but to do so I need to know the size of the image in inches when Ctrl-P was depressed.
Without having to resort to measuring it, is there a way to know precisely what the size of the image is in inches?
Thanks,
Gaston
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.2 In reply to 4128.1 
Hi Gaston, are you talking about in a particular view?

One problem with what you are asking for, is that in a perspective view there is not a 1 to 1 mapping between model units and the screen, because of perspective foreshortening. For example in a perspective view an object that is 1000 inches in width can actually be smaller on the screen than something that is only 1 inch in width, if the 1000 inch one is far off in the distance away from the eye point and the 1 inch one is close to the eye point.

So that's one issue - that there does not exist a constant model unit to image size conversion at all if you're referring to the 3D perspective view.

Are you trying to do something in the something like the Top view or in the 3D view with Projection = Parallel enabled? If so then I think it could be possible to come up with a solution for that. With an orthographic view there is a constant relationship between model units and displayed size, which is controlled by the viewport zoom factor, and it is possible to set the viewport zoom factor through script, here is a previous post relating to that:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3913.1

It could be possible to retrieve the viewport zoom factor by script and copy it to the clipboard or something so that you could then calculate how many model units the image was spanning, but would you maybe like it better if your Ctrl+P script was modified to set the view zoom factor during the screenshot process to a set value so that you would always be producing screenshots at a specific model unit size?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  ggagnon
4128.3 In reply to 4128.2 
Thanks Michael,
Yes, sorry, I only want to print one of the orthographic view (Top, Front, right) with a scale 1:1 ie a 1" model is 1" on the paper.
What I did so far, and it seem to work, is:
1. Maximize the model;
2. Ctrl-P;
3. Measure the width of the viewport with Alt-D script

then open IrfanView

4. Paste the image already in the clipboard from 2:
5. Select Print ;
6. Set radio button Custom in Print size;
7. Change Width with the value measured is 3 with Aspect ratio ticked;
8. Press Print

That prints a 1:1 drawing of the viewport.

My question is for an easier way to do step 3. Could I add a line Viewport size under X;, Y:, Z: in the Alt-D script popup ? If yes what should it read? That would be perfect.

Gaston
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.4 In reply to 4128.3 
Hi Gaston,

> My question is for an easier way to do step 3.

I think I should be able to create a script for you that will calculate the answer for step #3 automatically. An easy way for it to work is to put the answer as text in the clipboard and then you can paste it into the width control in Irfanview.

I'll give it a try later tonight.

- Michael

EDITED: 19 Mar 2011 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  ggagnon
4128.5 In reply to 4128.4 
Excellent, thanks.
Gaston
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  NightCabbage
4128.6 
Heh, yes, I'm still interested in this :P

I mapped the script you wrote to F12:

script: /* Set top viewport zoom to 1 pixel = 1 unit */ moi.ui.mainWindow.viewpanel.getViewport('Top').fieldOfViewAngle = 1110;

Ideally, I'd (of course) love some basic 2d rendering capability ^_^

But for now, I'm just exporting to .ai and then using a bounding box around the object, so I can resize it to the correct size - as the .ai export seems to be of pretty much random size lol

EDITED: 19 Mar 2011 by NIGHTCABBAGE

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.7 In reply to 4128.6 
Hi NightCabbage - for AI export to be a predictable size make sure you uncheck the "Fit to page" option at export time, and also you should have your unit system in MoI set to millimeters, centimeters, or inches.

When that is the case the scale should be converted from either mm, cm, or inches into AI's native unit system which is "Points" where 1 Point = 1/72 of an inch, so that will preserve the unit size of your curves in that case.


If you have the "Fit to page" option checked, then instead of trying to preserve units it will instead scale the output to fit within a typical printed page size, and if you have fit to page disabled but some unit system set other than mm, cm, or inches it won't try to map the units into points because mapping something like meters into points will tend to make for quite large coordinate values, so it instead just applies a scale factor of 20 in those cases to try and get some reasonable range of point values but with a constant factor applied that is reversible.

If you have a case where you are having a problem with the exported size, could you post an example here so I can test it?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  NightCabbage
4128.8 
Thanks Michael - but I can't seem to get it to work :(

My process for testing was as follows:

- Export a 26x26 mm box to .ai without the fit to page option selected

- Import into Expression 3

- Export as Illustrator 9.0 format

- Import into Inkscape

and it's 70.866 units squared lol

-EDIT-

LOL I just tried the same thing again, creating a new document with another 26mm box, and this time it randomly came out to be 92.125 units squared.

Seems to be completely random :D
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.9 In reply to 4128.8 
Hi NightCabbage, did you save the 3DM file of each of these boxes? That would help if I could see the 3DM files you were using, to double check that they were identical 26x26mm boxes and to see if I could repeat your steps and get the same results. Are you certain you had units set to mm in both cases?

Here's what I tested so far - I created a 26x26mm rectangle, which I've attached as ai_test.3dm.

Then I exported to AI format, using settings like this:



That produced the attached ai_test.ai file.

Then in Expression 3, I used File > Open and opened that AI file, and I got a 26x26mm square in there, you can check the size in Expression 3 by first setting the stroke width of the rectangle to 0 or off (because the width of the stroke is included in the bounding size readout), and then going to its size readout.

To do that, select the square and then push this button here to set no line stroke:



Then under the Transform toolbox, push this button here to get the bounding size controls:



And as you can see there, it shows a size of 26mmx26mm which seems to be what you are looking for...


Are you able to repeat these steps and get the proper results up to this stage in a repeatable manner?

If so then it means that your problem is happening either at the export from Expression or at the import into Inkscape, one of those particular steps is applying some kind of scaling to the coordinates, maybe there is some kind of setting you can adjust to avoid that.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.10 In reply to 4128.8 
Hi NightCabbage, I also did a quick test of PDF export from Expression, and as far as I can tell the PDF it produces has the correct size in it.

So possibly the scaling is happening during the import into Inkscape, look for an option in there to turn that off.

Also you might try going MoI to AI , AI to Mayura Draw, Mayura Draw to SVG, SVG into Inkscape and see if that works better for preserving unit size into Inkscape.

Also make sure in Inkscape you have your units set to mm, and not something like "px" units or something like that, if you had different units set there that could explain why you were seeing the size as different values at different times.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4128.11 In reply to 4128.5 
Hi Gaston, I think the following script should do what you want:

script: /* Output print width to clipboard */ var pix_width = 2560; var pix_height = 2048; var zoom = moi.ui.getActiveViewport().fieldOfViewAngle; var width = zoom * pix_width / pix_height; moi.copyTextToClipboard( width.toFixed(3) );

So to use it, set up a keyboard shortcut for it and paste that in for the command part.

If you're in the split view mode, click once inside the view that you are using before running the script so that it will target the correct viewport. If you're in a maximized view mode it will target that maximized view automatically so you don't need to click on a view in that case.

Note that this is tied specifically to the 2560x2048 pixel resolution of your current Ctrl+P script - if you switch that to some other resolution then you'll also need to update the pix_width = and pix_height = pieces of this script to match it.

When you run this script, it should calculate the width in units of the view that is being displayed in that 2560x2048 screenshot, and put that value as text into the clipboard so you can paste it into the width field in IrfanView.

I have not tested it with an actual printout myself, please do a test first to make sure it's working right and let me know if it does not seem to be correct.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ggagnon
4128.12 In reply to 4128.11 
It works. Now I can print with scale 1:1 I find this method faster then having to go via Rhino.
Thanks Michael,
Gaston
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All