Re: Are centimeters second class units?

At 4:51 PM -0800 12/11/00, Jon Ferraiolo wrote:

Thanks for your help. I've mostly been experimenting with Batik 
because the Adove viewer can't handle the candidate rec namespace 
URI, and possibly other recent issues, and I haven't gotten to 
animation yet. I suppose I should get the 2.0b1 from Adobe though and 
see if that works.

>>If SVG really doesn't allow me to describe shapes with arbitrary 
>>precision fixed units of known length like cm and in, rather than 
>>the very ambiguous pixel unit, then it seems seriously underpowered 
>>and unsuitable for many tasks. Some of the basic shapes like rect 
>>and circle let me use real units, but the most fundamental path 
>>element does not. How can I define a path that's a certain number 
>>of centimeters long? Any ideas? Am I missing something here?
>
>I gave one idea above. Does this help?
>

Yes it does as a practical matter. Thanks! However, there's a deeper 
issue here. Suppose I'm writing a CAD program or any similar program 
that needs to generate very precise, accurate representations of 2-D 
figures. For instance for a 144 square foot room I might want 
something like this:

<rect x="768in" y="987.5in" width="144in" height="144in" />

Without saying anything about how that rectangle will be placed on 
the screen, I now have a precise and accurate representation of the 
dimensions of that room. I know that it's 12 ft by 12 ft square. I 
know where it begins and ends, etc. I don't really care how it will 
be scaled when displayed on a screen. Indeed, depending on context 
(size of paper, size of screen, etc.) it might get displayed at a 
different sizes. I might zoom in or out on it or pan around a large 
drawing that doesn't all fit on the screen at once. Indeed I could 
use XInclude to mix and match different components (standard 
bedrooms, bathrooms, etc.) in different documents. I'm trying to get 
an accurate representation of the real world here. I'm not trying to 
represent what's displayed on the screen.

With rectangles and circles and ellipses and lines this works. 
However it fails with polylines and polygons and paths. For instance 
suppose I want my SVG blueprint to represent this hallway that turns 
a corner:


+--+
|  |
|  |
|  |
|  |______________
|                 |
|_________________|

It's a straightforward polygon, except that I can't say the hallway 
is 4 ft wide or turns the corner after 20 ft. I have to say it in 
pixels. Or at least it seems to me I do. Could I perhaps embed my 
polygon in an svg element, and let the svg element's width and height 
establish the real scale for the polygon relative to the user 
coordinate space? So far my attempts to do that have failed, but I 
may be bumping up against Batik bugs or my own incomplete 
understanding.  But even if I am, it would seem much more 
straight-forward to allow everything--polygons, polylines, and paths 
included--to be specified in absolute units.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+

Received on Tuesday, 12 December 2000 10:04:55 UTC