To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10710
10709  |  10711
Subject: 
Re: LPub DPI control?
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 5 Mar 2008 17:03:09 GMT
Viewed: 
8006 times
  
In lugnet.cad.dev, Kevin L. Clague wrote:
In lugnet.cad.dev, Kevin L. Clague wrote:
In lugnet.cad.dev, Remi Gagne wrote:
Hello,

In LPub, is it possible to specify the physical resolution for generated images?
Not the pixel width & height, but the physical document width & height in
inches, and the resolution in pixels/inches.  Of course, this affects only
printed documents.

Sorry.  No not yet.

Kevin

Hi Remi,
  I'm working on DPM and DPI now.

  Here is what I plan on doing:

  You set the page size in either inches or centimeters.  You define the
resolution in terms of DPI or DPM.  You control the magnification.  For example,
if I have a 1 inch page size, and a lego part that appears a half an inch wide,
with a magnification of 1.0, the part should take up half the page.  With a 2x
magnification, the part should take up the whole page.

  Changing DPM/DPI does not change the relative sizes of things with respect to
the page size, it just makes sure everything has more or less pixels.

  Now I just have to figure out how to compute everything down to pixels and
we're good to go.

Kevin

Most of this feature is done.  I had to identify every LPub meta-command that
had something with the units of pixels, and treat them as a new class of
"units", meaning known absolute distances (i.e. meters or inches.)  Every time
these values are used, the class they're in automatically converts the results
to pixels (simple multiplication), and voila, we've solved almost all the
resolution dependent issues.  The size of the window used is the same size as
the page.

I've got a bit of math to figure out, but the plan is to give the user a control
called magnification (or zoom).  Changing magnification changes the image size
of the model relative to the page.

Magnification of 1.0 makes a model that is 8 inches wide when measured from the
viewer's vantage point exactly fit in an 8 inch page.  Decreasing the
magnification makes the model image smaller than the page, increasing the
magnification to greater than provides a magnifying affect.

I'm told the new L3P will provide true orthographic projection, but with the
current version of L3P, I approximate orthographic (no perspective) with a very
small camera lens angle.  I'll have to use trigonometry to figure out the camera
distance for the current L3P.

The only issue left is fonts.  I have to figure out how to express fonts in real
world units and how to map that to points or whatever.  Time to learn more new
stuff.  If anyone is knows much about this topic let me know.

Scalable fonts would probably be best to use (if they can be found).

Kevin



Message has 3 Replies:
  Re: LPub DPI control?
 
In lugnet.cad.dev, Kevin L. Clague wrote: SNIP (...) Maybe the following link does help you a little bit: (URL) you use truetype fonts it should not be a problem to print them in the correct size. cu mikeheide (17 years ago, 5-Mar-08, to lugnet.cad.dev)
  Re: LPub DPI control?
 
(...) I learnt a fair bit fiddling with (URL) Freetype> in (URL) txt2dat>, which has to translate point size to ldraw units. Freetype makes it pretty easy, as it gives you a nice API that works for lots of scalable fonts. I chose not to support (...) (17 years ago, 6-Mar-08, to lugnet.cad.dev, FTX)
  LPub 4 Status
 
I've got the math and implementation of resolution (dots per inch/meter/millimeter) as well as magnification for controlling model size relative to the page all worked out. Magnification 1.0 means a model that appears 8 inches wide will just fit in (...) (17 years ago, 6-Mar-08, to lugnet.cad.dev) ! 

Message is in Reply To:
  Re: LPub DPI control?
 
(...) Hi Remi, I'm working on DPM and DPI now. Here is what I plan on doing: You set the page size in either inches or centimeters. You define the resolution in terms of DPI or DPM. You control the magnification. For example, if I have a 1 inch page (...) (17 years ago, 4-Mar-08, to lugnet.cad.dev)

81 Messages in This Thread:




















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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