POV-Ray : Newsgroups : povray.advanced-users : POVRay and XML Server Time
29 Jul 2024 08:14:43 EDT (-0400)
  POVRay and XML (Message 28 to 37 of 107)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bernd Fuhrmann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 09:51:03
Message: <41d6b8d7$1@news.povray.org>
ingo wrote:
> in news:41d51598@news.povray.org Bernd Fuhrmann wrote:
> 
> 
>>What do you think about this idea?
>>
> 
> 
> After reading most of the thread, I get the impression that you have a 
> "problem" and that your "solution" to that "problem" is XML. I think I 
> have a simmilar "problem", 'all one can do with a .pov file is render it 
> with POV-Ray'.

Exactly. You got my point. I want to do more with my scenes.

> I.m.o XML itself is not the solution. You gave one reason: "Obviously 
> this works only in one direction". Others gave many other reasons.

Depends on what you see as solution. It's might be possible to parse 
POVRay SDL with XSLT. But it's slow and a lot of work. As long as there 
are no other solutions XML might be the best of many bad ones.

> What we'd need is a POV-Ray parser, and currently the only one available 
> is POV-Ray and we can't use that for other purposes. I tried writing one 
> in Python, but gave up due to severe lack of skills.

With the right help this is possible. Are you interested in anything 
like this? Write me an email.

> Once you have a POV-parser (with a liberal enough licence and with some 
> API or bindings or ...) you can do many things with a scene, even 
> convert it to some form of XML if you like.

Is (L)GPL ok?

Regards,
Bernd Fuhrmann


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: POVRay and XML
Date: 1 Jan 2005 09:53:18
Message: <41d6b95e$1@news.povray.org>
In article <41d6b8d7$1@news.povray.org> , Bernd Fuhrmann 
<Sil### [at] gmxde>  wrote:

>> Once you have a POV-parser (with a liberal enough licence and with some
>> API or bindings or ...) you can do many things with a scene, even
>> convert it to some form of XML if you like.
>
> Is (L)GPL ok?

No, only a BSD license would be OK to facilitate use of a format in
commercial applications and allow them to make changes to the code (not the
format, but that cannot be prevented by either license).

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Bernd Fuhrmann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 09:55:05
Message: <41d6b9c9$1@news.povray.org>
Thorsten Froehlich wrote:
  > No, only a BSD license would be OK to facilitate use of a format in
> commercial applications and allow them to make changes to the code (not the
> format, but that cannot be prevented by either license).

BSD? Agreed. Interested?

Regards,
Bernd Fuhrmann


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: POVRay and XML
Date: 1 Jan 2005 09:56:13
Message: <41d6ba0d$1@news.povray.org>
In article <41d6ae1a$1@news.povray.org> , Bernd Fuhrmann 
<Sil### [at] gmxde>  wrote:

> XML is just a way to give a document (which does include programs
> aswell) structure that is easy to parse. It does not specify the
> structure itself. I'd make the structure almost equivalent to POVRay's
> structure.

OK, please provide XSLT that transforms a non-trivial X3D XML mesh to a
POV-Ray mesh.  Just the geometry.  I would love to see the XSLT and its
complexity ... so show me that I am wrong if you can!

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Bernd Fuhrmann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 10:34:40
Message: <41d6c310$1@news.povray.org>
Thorsten Froehlich wrote:
> In article <41d6ae1a$1@news.povray.org> , Bernd Fuhrmann 
> <Sil### [at] gmxde>  wrote:
> 
> 
>>XML is just a way to give a document (which does include programs
>>aswell) structure that is easy to parse. It does not specify the
>>structure itself. I'd make the structure almost equivalent to POVRay's
>>structure.
> 
> 
> OK, please provide XSLT that transforms a non-trivial X3D XML mesh to a
> POV-Ray mesh.  Just the geometry.  I would love to see the XSLT and its
> complexity ... so show me that I am wrong if you can!

No I won't. Its quite a task to write such a XSLT. I have never worked 
with X3D. It would take me weeks to learn X3D just to proove that it is 
possible.

But if you want to see XSLT in action:

I have attached a little XSLT transformation that transforms data from a 
log file (almost plaintext, written by a simple PHP script), analyzes it 
and displays some statistical information about it. I hope the power of 
XSLT becomes visible. XSLT can also output plain text. So I could even 
render this data with POVRay. That would just be a few lines. Ok it 
would be useless. But at least it's possible. And I wouldn't have to 
write my own parser for it. This saves me a LOT of time. It would be 
cool if I could access POVRay SDL the same way and display automatic 
generated data from it aswell. That is what I try to achieve (among 
other things).

Regards,
Bernd Fuhrmann


Post a reply to this message


Attachments:
Download 'us-ascii' (3 KB)

From: Thorsten Froehlich
Subject: Re: POVRay and XML
Date: 1 Jan 2005 10:44:13
Message: <41d6c54d$1@news.povray.org>
In article <41d6c310$1@news.povray.org> , Bernd Fuhrmann 
<Sil### [at] gmxde>  wrote:

> No I won't. Its quite a task to write such a XSLT.

Exactly that was my point ;-)

> I have never worked
> with X3D. It would take me weeks to learn X3D just to proove that it is
> possible.

Well, the only real difference is that there are no commas (well, they are
optional in VRML, they are just like spaces) and no < > around vectors, and
X3D keeps all coordinates in a *single* string.  It takes almost nothing to
transform a classic VRML-style X3D mesh to POV-Ray (one can do it with a
simple regular expression), but to transform the same X3D XML lots of manual
tweaking is needed to just *remove* redundant XML syntax that serves no
useful purpose at all!

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Bernd Fuhrmann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 11:27:10
Message: <41d6cf5e$1@news.povray.org>
Thorsten Froehlich wrote:
> In article <41d6c310$1@news.povray.org> , Bernd Fuhrmann 
> <Sil### [at] gmxde>  wrote:
> 
> 
>>No I won't. Its quite a task to write such a XSLT.
> 
> 
> Exactly that was my point ;-)
> 
> 
>>I have never worked
>>with X3D. It would take me weeks to learn X3D just to proove that it is
>>possible.
> 
> 
> Well, the only real difference is that there are no commas (well, they are
> optional in VRML, they are just like spaces) and no < > around vectors, and
> X3D keeps all coordinates in a *single* string.  It takes almost nothing to
> transform a classic VRML-style X3D mesh to POV-Ray (one can do it with a
> simple regular expression), but to transform the same X3D XML lots of manual
> tweaking is needed to just *remove* redundant XML syntax that serves no
> useful purpose at all!

I just wrote a little demo XSLT that puts commas where once were spaces 
in transform/translation attributes and adds < and > to the beginning 
and end. If you want anything more complex please send me an example 
what transformation you want. Btw: I'm not a very good XSLT programmer. 
I just use it for the creation of my small private webpage. So don't 
expect me to write complex parsers that would take a pro months.

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet	version="2.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns=""
 >

<xsl:output method="xml" encoding="iso-8859-1"/>

<xsl:template match="*|@*|text()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="Transform">
<Transform>
<xsl:attribute name="translation"><<xsl:analyze-string 
select="@translation" regex=" +">
<xsl:matching-substring>,</xsl:matching-substring>
<xsl:non-matching-substring><xsl:value-of 
select="."/></xsl:non-matching-substring>
</xsl:analyze-string>></xsl:attribute>
</Transform>
</xsl:template>
</xsl:stylesheet>

Tested with this input:
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"

"http://www.web3d.org/specifications/x3d-3.0.dtd">

<X3D profile='Immersive' 
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'

xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
<head>
<meta name='filename' content='Figure02.1Hut.x3d'/>
<meta name='author' content='The VRML 2.0 Sourcebook, Copyright [1997] 
By Andrea L.

Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='translator' content='Don Brutzman'/>
<meta name='created' content='6 August 2000'/>
<meta name='revised' content='9 July 2003'/>
<meta name='description' content='Your first VRML world - a brown hut.'/>
<meta name='url'

content='http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter02-Introdu

ction/Figure02.1Hut.x3d'/>
<meta name='generator' content='X3D-Edit,

http://www.web3d.org/x3d/content/README.X3D-Edit.html'/>
</head>
<!--
Index for DEF node: BROWN
-->
<Scene>
<!-- This NavigationInfo node is added to many scenes, making 
examination of objects

easier -->
<NavigationInfo type='"EXAMINE" "ANY"'/>
<Group>
<Shape>
<Appearance DEF='BROWN'>
<Material diffuseColor='0.8 0.6 0.3'/>
</Appearance>
<!-- Default Cylinder height=2, centered about origin -->
<Cylinder radius='2'/>
</Shape>
<Transform translation='0 2 0'>
<Shape>
<Appearance USE='BROWN'/>
<!-- Default Cone height=2, centered about local origin -->
<Cone bottomRadius='2.5'/>
</Shape>
</Transform>
</Group>
</Scene>
</X3D>
---
[Taken from 
http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter02-Introduction/_pages/page01.html]
I know this is not what you wanted. But this script could be extended so 
that it might do things more complete. I do not yet know enough about 
X3D to write anything that actually makes sense. Please provide an 
example if you are interested.

Regards,
Bernd Fuhrmann


Post a reply to this message

From: Christoph Hormann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 12:45:01
Message: <cr6nei$a80$1@chho.imagico.de>
Bernd Fuhrmann wrote:
> But POVRay 
> files are rather small. Parsing speed does not matter that much.

I just wanted to point out this particular statement for those who do 
not follow this thread very closely...

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Bernd Fuhrmann
Subject: Re: POVRay and XML
Date: 1 Jan 2005 13:54:48
Message: <41d6f1f8@news.povray.org>
Darren New wrote:
> Bernd Fuhrmann wrote:
> 
>> Do you know any programming language what is able to access it's own 
>> objects that way?
> 
> 
> Quite a few. LISP, Tcl, Forth, etc. The term you're looking for is 
> either "introspection" or "reflection", depending on precisely what 
> kinds of data you're looking for.
Thanks for that hint. You're right. Some commonly used languages are 
indeed introspective.

Regards,
Bernd Fuhrmann


Post a reply to this message

From: ingo
Subject: Re: POVRay and XML
Date: 1 Jan 2005 14:22:43
Message: <Xns95D1CF4D9F7BDseed7@news.povray.org>
in news:41d6b8d7$1@news.povray.org Bernd Fuhrmann wrote:

>> I tried writing one in Python, but gave up due to severe lack of
>> skills. 
> 
> With the right help this is possible. Are you interested in anything 
> like this? Write me an email.

I'm interested in a POV-Ray parser, but I have no time to work on anything 
like that at the moment. And, I've set my hopes on POV-Ray 4, let it come 
with a libpovparse, libpovwrite (so we can have decent and uniform output 
from modellers), libpovNURBSs, libpovspline, .... (dream on).

>> Once you have a POV-parser (with a liberal enough licence and with
>> some API or bindings or ...)
> Is (L)GPL ok?

Nope, BSD/MIT or Public Domain.

Ingo


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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