|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
It is possible to read values by the #read-statement.
It is no problem when the used file has only one line.
But for typing it is much easier if the file has more lines.
But this causes an error. Any hints how to read a multi-line
file?
Example : <0,0,0>,<2,3,5>,<5,7,8> reads correct
but
<0,0,0),
<2,3,5>,
<5,7,8>
causes an error.
Hartmut
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> It is possible to read values by the #read-statement.
> It is no problem when the used file has only one line.
> But for typing it is much easier if the file has more lines.
> But this causes an error. Any hints how to read a multi-line
> file?
Normally, Multiline-Files don't pose a problem as long as the remaining
setup is proper. With "proper setup" I mean: comma after every data. Have a
look at my I/O-Macs, looking at them you might find out where you're doing
something wrong.
Aside of that: how about posting the code-snippet doing the writing and
reading, and an excerpt from the file with the data? Someone might give you
a pointer with that.
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27.10.2003
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Hartmut Wagener who wrote:
>It is possible to read values by the #read-statement.
>It is no problem when the used file has only one line.
>But for typing it is much easier if the file has more lines.
>But this causes an error. Any hints how to read a multi-line
>file?
>
>Example : <0,0,0>,<2,3,5>,<5,7,8> reads correct
>but
><0,0,0),
><2,3,5>,
><5,7,8>
>causes an error.
>
It's not the line breaks that are causing your problem, it's the fact
that there's a slight typo in line 1.
It should be <0,0,0>, not <0,0,0),.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Williams <nos### [at] econymdemoncouk> wrote:
> It's not the line breaks that are causing your problem, it's the fact
> that there's a slight typo in line 1.
We can learn from this that you should never assume that an error
is happening due to something which doesn't make sense (why in the
earth would POV-Ray care about newlines?) unless you are *completely*
sure there's no other error in your code/input data.
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
My guess would be:
Compilers (and interpreters, like povray) are told to ignore whitespace
charachters, ' ', '\n' and the like. However, when you read from a file,
you are simply reading a stream of data. The computer doesn't care, or
know, what the data is, it just assumes that it is what the reading program
thinks it is. So, when you read your multilined file, you read a vector
<0,0,0>, then you try to read another vector, so pov eats the ',' and
notices that the next charachter, which should be '<' is actually a newline
charachter, '\n'. As I see it, you have three options. Either deal with
reading a one line file, read a newline charachter after each line (I'm just
guessing that will work), or you could do what I do and output your data in
a form that pov can parse, and then simply #include it. Yes, it makes
writing considerably more complicated, but it pretty much eliminates
reading, which means you have less code to write, giving you fewer
opportunities to write bugs into your code. And probably best of all, when
you want to change the data being written in the file, you only have to
change your code in one place, and you know it will work.
Barron Gillon
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> My guess would be:
> Compilers (and interpreters, like povray) are told to ignore whitespace
> charachters, ' ', '\n' and the like. However, when you read from a file,
> you are simply reading a stream of data. The computer doesn't care, or
> know, what the data is, it just assumes that it is what the reading
program
> thinks it is.
*SNIP*
I think you've misunderstood how POV handles I/O. If you put a "\n" and
write that to a file, it won't be reduced to \n, but to "return / new line".
When writing, POV doesn't write the quotation marks. As someone else
mentioned, he had a typo in his vector ( "<0,0,0)," instead of "<0,0,0>," )
which was the problem.
You can't read new line characters, they simply don't exist in the file.
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
One good way of avoiding any such problem is to write data with the
povray syntax, so that you can read it back with a simple #include
JC
Hartmut Wagener wrote:
> It is possible to read values by the #read-statement.
> It is no problem when the used file has only one line.
> But for typing it is much easier if the file has more lines.
> But this causes an error. Any hints how to read a multi-line
> file?
>
> Example : <0,0,0>,<2,3,5>,<5,7,8> reads correct
> but
> <0,0,0),
> <2,3,5>,
> <5,7,8>
> causes an error.
>
> Hartmut
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"JC (Exether)" <no### [at] spamfr> wrote:
> One good way of avoiding any such problem is to write data with the
> povray syntax, so that you can read it back with a simple #include
Well, if you write "<0,0,0)" to an include file and then #include it,
an error will happen as well, so it isn't really a solution. ;)
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yes Warp, and Tim, we all saw how you pointed that out. However, I for one
am going to assume he is smart enough that he would have caught the ')'
before comming to the newsgroup. It seems likely to me that it was a typo
from when he was typing his post. Furthermore, JC's idea is a good one,
that deserves some consideration.
> Well, if you write "<0,0,0)" to an include file and then #include it,
> an error will happen as well, so it isn't really a solution. ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Yes Warp, and Tim, we all saw how you pointed that out.
*SNIP*
Well, you must have overread another post I made in this thread, I didn't
only go for "he missed the )", but also added some information that new
lines aren't keeping POV-Ray from doing things properly. But it's hard to
tell what's causing the problem when we don't get replies.
> Furthermore, JC's idea is a good one, that deserves
> some consideration.
*SNIP*
Aside of the above, yup, it is nice to simply #include some stuff, but I've
found in several cases that using the File I/O more like a database rather
than a crude POV-Editor has some advantages: the code is more compact and,
though I'm not sure of that, depending on how you use, say, an amount of 500
Vectors (directly in an array or load them one after another as need) might
use less memory, but some guru might know more about that (or tell me to
experiment, which I can't do properly at the moment).
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27.10.2003
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|