POV-Ray : Newsgroups : povray.general : Units of Measure : Re: Units of Measure Server Time
4 Aug 2024 06:18:36 EDT (-0400)
  Re: Units of Measure  
From: Alan Smith
Date: 26 Aug 2003 13:58:14
Message: <3f4b9fb6$1@news.povray.org>
box { <-3cm, 4, 8mm>, <2, 14, 5cm> }
would mean exactly what you said, the non-unitised measurements
would be native POVRay units.   Of course you could build all sorts
of rule checking into the parser to provide warnings etc ... but I'm not
suggesting this, as I agree this would be a great deal more effort to code
and is taking things too far.

As far as :-
box { <-2in, -5ft, 3m>, <3cm, 5in, -2ft> }

is would mean exactly what you said, some of the objects in my house
including the room dimensions are in ft and in and many of my objects
are clearly designed in cm & mm - so why not!   A agree that if you
passed these kind of measurements to your local builder he might query
it, but again I'm not suggesting that level of sophistication in the parser
would be needed.   One has to rely on a little common sense.

However,  in one of my scenes I have a very nice fancy plastic transparent
ruler :- box { <0,0,0>, <31, 2.8, 0.3> etc etc}.   Wouldn't it be nice if
you
could just cut and paste it instantly into yours if I said :-
box { <0,0,0>, <31cm, 2.8cm, 3mm> etc etc}.   Or any of my other office
objects for that matter.

#declare Location = -2cm*3in*<3ft, 5cm*3in, 2km>;
We'll, like any language computer or otherwise it is always possible to
create
less readable or sensible but legitimate statements if one abandons common
sense and desires to do so.

I'm suggesting that if these units were incorporated as standard multipliers
into the parser, it would promote the quick interchange of objects without
the need for any scaling.

Alan Smith.



"Warp" <war### [at] tagpovrayorg> wrote in message
news:3f4b903a@news.povray.org...
> Alan Smith <ala### [at] aurora-ukcom> wrote:
> > Wouldn't it be nice if POV allowed something like :-
> > box { <-2cm, -1cm, 10mm>,  <2cm, 1cm, 1cm> }
>
> > This would lead to more readable code
>
>   So tell me what this would mean:
>
> box { <-3cm, 4, 8mm>, <2, 14, 5cm> }
>
>   Mixing unit types doesn't help readability either:
>
> box { <-2in, -5ft, 3m>, <3cm, 5in, -2ft> }
>
>   Of course we could obfuscate this even more:
>
> #declare Location = -2cm*3in*<3ft, 5cm*3in, 2km>;
>
>   One could wonder what is "2 centimeters times 3 inches"...
>
>   IMHO plain numbers are easier to read... :P
>
> -- 
> plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
> sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
> density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
> <1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.