To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 14596
Subject: 
LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Thu, 7 Jun 2007 21:40:03 GMT
Viewed: 
1822 times
  
I have a series of models (representing instruction steps) that I would like to
render at the same scale with LDView. I can use LDView to save snapshots from
the command line (LDView model.ldr -SaveSnapshot=model.png), but I cannot figure
out how to cause snapshots of different-sized models to be saved at the same
scale (so that individual parts are rendered at a constant size).

I thought that I might be able to use the -ModelSize or -cg options to force the
same camera perspective in each case, but this doesn't seem to do what I'd like.

Here are three example images:

http://www.brickshelf.com/gallery/anoved/Examples/step1.png
http://www.brickshelf.com/gallery/anoved/Examples/step2.png
http://www.brickshelf.com/gallery/anoved/Examples/step3.png

Notice how as the size of the model increases, the individual 2 x 4 plates are
scaled down to fit the snapshot size. Is there a way to circumvent this effect?

Perhaps not insignificantly, I am using the 3.2 alpha version built on my Mac,
as discussed here earlier this year. I realize that ldglite or L3P could be used
instead, but I'm just curious if it is possible to accomplish this with LDView.

Thanks,
Jim


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Thu, 7 Jun 2007 23:17:13 GMT
Viewed: 
2048 times
  
In lugnet.cad, Jim DeVona wrote:
   I thought that I might be able to use the -ModelSize or -cg options to force the same camera perspective in each case, but this doesn’t seem to do what I’d like.

Here are three example images:

http://www.brickshelf.com/gallery/anoved/Examples/step1.png http://www.brickshelf.com/gallery/anoved/Examples/step2.png http://www.brickshelf.com/gallery/anoved/Examples/step3.png

I’m not sure what your command line was for those, but -ModelSize=x should work fine, as long as you set x to be big enough. With the current source code, -cg (with radius) should also work fine. Despite the fact that -cg was documented to support the radius part in LDView 3.1, it in fact didn’t. I fixed that, but perhaps my fix happened after the LDView 3.2 alpha release. There will be a 3.2 Beta 1 release very shortly. (In fact, the Windows and Linux files have already been posted to SourceForge.net.) I’d suggest waiting for that, or building from source, because I know I did some command line fixes in this area after getting bug reports from someone else. (I know you built from source in the past; otherwise I wouldn’t bother even suggesting it.)

The thing to remember about -ModelSize is that you need to set it to be big enough so that your biggest model will fit. It’s good to combine this with -AutoCrop=1. So, I used the following command lines successfully with LDView 3.2 Beta 1 (built from current CVS source tree):

LDView.exe -ModelSize=600 -AutoCrop=1 D:LDRAW\parts3005.dat -SaveSnapshot=3005.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024

LDView.exe -ModelSize=600 -AutoCrop=1 D:LDRAW\parts3003.dat -SaveSnapshot=3003.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024

LDView.exe -ModelSize=600 -AutoCrop=1 D:LDRAW\parts3001.dat -SaveSnapshot=3001.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024

LDView.exe -ModelSize=600 -AutoCrop=1 D:LDRAW\parts2356.dat -SaveSnapshot=2356.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024

Notice that all of the above images were generated using 1024x1024 as the snapshot size. Notice also that AutoCrop=1 cropped them to the actual size needed.

--Travis


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Thu, 7 Jun 2007 23:20:17 GMT
Viewed: 
2055 times
  
That’s a first for me. The web Preview of my previous message looked different. The images were all placed on the line after their associated command line, which was what I wanted, and made it easier to read.

--Travis


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Fri, 8 Jun 2007 00:00:30 GMT
Viewed: 
2108 times
  
In lugnet.cad, Travis Cobbs wrote:
In lugnet.cad, Jim DeVona wrote:
I thought that I might be able to use the -ModelSize or -cg options to force
the same camera perspective in each case, but this doesn't seem to do what
I'd like.

Here are three example images:

http://www.brickshelf.com/gallery/anoved/Examples/step1.png
http://www.brickshelf.com/gallery/anoved/Examples/step2.png
http://www.brickshelf.com/gallery/anoved/Examples/step3.png

I'm not sure what your command line was for those but -ModelSize=x should
work fine, as long as you set x to be big enough.  With the current source
code, -cg (with radius) should also work fine.  Despite the fact that -cg was
documented to support the radius part in LDView 3.1, it in fact didn't.  I
fixed that, but perhaps my fix happened after the LDView 3.2 alpha release.
There will be a 3.2 Beta 1 release very shortly.  (In fact, the Windows and
Linux files have already been posted to SourceForge.net.)  I'd suggest
waiting for that, or building from source, because I know I did some command
line fixes in this area after getting bug reports from someone else.  (I know
you built from source in the past; otherwise I wouldn't bother even
suggesting it.)

The thing to remember about -ModelSize is that you need to set it to be big
enough so that your biggest model will fit.

What units does the -ModelSize argument use?

...

Notice that all of the above images were generated using 1024x1024 as the
snapshot size.  Notice also that AutoCrop=1 cropped them to the actual size
needed.

Thanks for the examples! Those are helpful.

Your recent changes must indeed have fixed something relevant; the images I
generate with the first few example commands are very large (and not to scale):

http://www.brickshelf.com/gallery/anoved/Examples/3003.png
http://www.brickshelf.com/gallery/anoved/Examples/3005.png

Out of curiosity, do you anticipate a Mac binary of the beta will be available?
If so, I can wait for that. Otherwise, I probably will dust off my notes and
have a go at building the current code.

Thanks again,
Jim


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Fri, 8 Jun 2007 00:10:11 GMT
Viewed: 
2172 times
  
In lugnet.cad, Jim DeVona wrote:
What units does the -ModelSize argument use?

It uses LDraw units.


Out of curiosity, do you anticipate a Mac binary of the beta will be available?
If so, I can wait for that. Otherwise, I probably will dust off my notes and
have a go at building the current code.

I do plan to release a Mac binary of the Beta.  In fact, I'll probably get that
built and posted to sf.net before announcing it more officially and updating the
LDView web page.

--Travis


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Fri, 8 Jun 2007 00:42:10 GMT
Viewed: 
5814 times
  
In lugnet.cad, Travis Cobbs wrote:

Out of curiosity, do you anticipate a Mac binary of the beta will be available?
If so, I can wait for that. Otherwise, I probably will dust off my notes and
have a go at building the current code.

I do plan to release a Mac binary of the Beta.  In fact, I'll probably get that
built and posted to sf.net before announcing it more officially and updating the
LDView web page.

Neat!

Here's what I get with my quick attempt to try the examples with the current
code, built using the same Qt 3.3.7 I used for the alpha. The bricks appear
scaled correctly, but there are some large artifacts.

ldview -ModelSize=600 -AutoCrop=1 $LDRAWDIR/parts/3003.dat
-SaveSnapshot=3003-b.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024
http://www.brickshelf.com/gallery/anoved/Examples/3003-b.png

ldview -ModelSize=600 -AutoCrop=1 $LDRAWDIR/parts/3005.dat
-SaveSnapshot=3005-b.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024
http://www.brickshelf.com/gallery/anoved/Examples/3005-b.png

I'm not sure if that's due to a problem with my build procedure (such as it is,
./makeall basically) or what, but I'm content to wait for your beta.

Again, thanks for your response and the effort you put into LDView.

Jim


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Fri, 8 Jun 2007 17:47:06 GMT
Viewed: 
2053 times
  
In lugnet.cad, Jim DeVona wrote:

Here's what I get with my quick attempt to try the examples with the current
code, built using the same Qt 3.3.7 I used for the alpha. The bricks appear
scaled correctly, but there are some large artifacts.

ldview -ModelSize=600 -AutoCrop=1 $LDRAWDIR/parts/3003.dat
-SaveSnapshot=3003-b.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024
http://www.brickshelf.com/gallery/anoved/Examples/3003-b.png

ldview -ModelSize=600 -AutoCrop=1 $LDRAWDIR/parts/3005.dat
-SaveSnapshot=3005-b.png -SaveActualSize=0 -SaveWidth=1024 -SaveHeight=1024
http://www.brickshelf.com/gallery/anoved/Examples/3005-b.png

Hi all,

Adding -SaveZoomToFit=0 to the LDView command line resolves this problem. Thanks
to Travis for the suggestion.

Jim


Subject: 
Re: LDView command line snapshot scaling
Newsgroups: 
lugnet.cad
Date: 
Sat, 9 Jun 2007 06:27:48 GMT
Viewed: 
2380 times
  
In lugnet.cad, Travis Cobbs wrote:
I do plan to release a Mac binary of the Beta.  In fact, I'll probably get that
built and posted to sf.net before announcing it more officially and updating the
LDView web page.

It appears that some people read this.  There were 13 downloads of the Mac
Binary immediately after I posted my official release announcement for LDView
3.2 Beta 1 (one of which was my test download).  There were only 3 downloads of
each of the Windows executables (3 total of which were also me).

--Travis


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR