POV-Ray error


POV-Ray error
#1
I'm trying to convert LDraw ldr-files first to a POV-Ray pov-file using pyldraw and then to a png using POV-Ray.

On a Mac I have installed pyldraw using pip and POV-Ray using Homebrew.

As a first simple test I have tried to convert the car.pov from the testdata from pyldraw to png using POV-Ray (basically just using "povray car.pov"). Unfortunately I get the following error message:

Code:
==== [Parsing...] ==========================================================
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 7979:
Parse Warning: Should have at least 2 objects in csg.
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 11261:
Parse Warning: Should have at least 2 objects in csg.
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 16690:
Parse Error: Expected 'object or directive.', float function 'float constant'
found instead
Fatal error in parser: Cannot parse input.
Render failed

I have spent quite some time on Google to find a solution to this but I'm not finding anything closely related. Does anyone know what I'm doing wrong?
Reply
RE: POV-Ray error
#2
(2019-10-19, 6:49)Arjan Wrote: I'm trying to convert LDraw ldr-files first to a POV-Ray pov-file using pyldraw and then to a png using POV-Ray.

On a Mac I have installed pyldraw using pip and POV-Ray using Homebrew.

As a first simple test I have tried to convert the car.pov from the testdata from pyldraw to png using POV-Ray (basically just using "povray car.pov"). Unfortunately I get the following error message:

Code:
==== [Parsing...] ==========================================================
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 7979:
Parse Warning: Should have at least 2 objects in csg.
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 11261:
Parse Warning: Should have at least 2 objects in csg.
File '~/repos/pyldraw-0.8.2/tests/test_data/car.pov' line 16690:
Parse Error: Expected 'object or directive.', float function 'float constant'
found instead
Fatal error in parser: Cannot parse input.
Render failed

I have spent quite some time on Google to find a solution to this but I'm not finding anything closely related. Does anyone know what I'm doing wrong?

Hi
Do you really want to use Pov-ray or could it also be a other program?
Why do not you use Studio2. 0 for rendering?
If you want use Pov-ray, you could also use LDCad to export the model to a .pov file and then render with Pov-ray. You also can use LDCad and export directly to a .png File.
If nothing goes right, go left.
Reply
RE: POV-Ray error
#3
Since you're using MacOS, I recommend that you use LDView's POV-Ray export instead of pyldraw (which I have never heard of).
Reply
RE: POV-Ray error
#4
(2019-10-19, 14:15)Orion Pobursky Wrote: Since you're using MacOS, I recommend that you use LDView's POV-Ray export instead of pyldraw (which I have never heard of).

Sorry, didn't read that you use a mac.
If nothing goes right, go left.
Reply
RE: POV-Ray error
#5
(2019-10-19, 14:15)Orion Pobursky Wrote: Since you're using MacOS, I recommend that you use LDView's POV-Ray export instead of pyldraw (which I have never heard of).
Hi Orion and Johann,

Thanks for your help. I'm looking for a solution to create a large amount of rendered bricks from the ldraw library in png/jpg format, that is why I'm looking into packages like pyldraw to do this using python and command line tools like POV-Ray to enable automating this stuff, instead of tools having a GUI.

As a first test I tried to render just an example pov-file (from the pyldraw package) using the command line POV-Ray tool. So I haven't used pyldraw yet to convert ldr files to pov files.
Reply
RE: POV-Ray error
#6
(2019-10-20, 11:27)Arjan Wrote: Hi Orion and Johann,

Thanks for your help. I'm looking for a solution to create a large amount of rendered bricks from the ldraw library in png/jpg format, that is why I'm looking into packages like pyldraw to do this using python and command line tools like POV-Ray to enable automating this stuff, instead of tools having a GUI.

As a first test I tried to render just an example pov-file (from the pyldraw package) using the command line POV-Ray tool. So I haven't used pyldraw yet to convert ldr files to pov files.

While nobody (least of all me) ever accused LDView of being fast at loading files, its latest officially released version does support POV exports from the command line. So you can use it from any command line scripts you create, in Windows, Linux, and macOS.
Reply
RE: POV-Ray error
#7
Out of curiosity I had a look at the pyldraw package (because I'd never heard of it before). I presume the authors generated that car.pov file themselves and it does, indeed, contain 3 coding errors. So the problem probably isn't of your own making.

The first two are UNION statements, but each of them only has one object defined. They have to define two objects in order to calculate the union between them.

The third one is really wierd. It's the last statement in the file, and it looks like some incomplete template information has been left over. It's a PIGMENT definition, but:
-- It is missing the COLOR keyword (or something similar, depending what it's trying to specify)
-- The RGB parameter is supposed to be at least a 3-term vector (for the R, G and B components), not a single HTML-style hash value. The fact that the colour is given as #123456 makes me very suspicious - or it's a large coincidence!

You could try going back a step, and use pyldraw to do your own conversion of car.ldr to car.pov, to see if you get the same result. (And if you do, you need to get back to the package authors for assistance.) You could also try one of the other conversion tools, as suggested in previous replies, to see if things get better.

--
Martin James
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)