POV-Ray : Newsgroups : povray.general : Need of a macro or a trick : Re: Need of a macro or a trick Server Time
1 Aug 2024 16:26:19 EDT (-0400)
  Re: Need of a macro or a trick  
From: Jim Charter
Date: 24 Jul 2005 17:07:44
Message: <42e40320$1@news.povray.org>
bancquart.sebastien wrote:
> Hi ! I need the help of good POVers. Here is my problem.
> I've a big .ini file (generated by ARBARO), most of this file looking like 
> this
> 
> #declare leaves=union {
>     object {leave} matrix <....>
>     object {leave} matrix <....>
>     object {leave} matrix <....>
> ...   ... about 24000 lines like that
> }
> 
> I'd like to paint the leaves with several textures. So I need to split this 
> big union into, say, 3 unions of about 8000 lines.
> BUT ! the lines are ordered, so I wanted to take about 8000 random line in 
> this list, or one line every three, cut them in the editor and paste them 
> elsewhere. Looks very tricky for me.
> 
> Do you know if it is feasible with macros in the GUI, or with an external 
> editor ? I really don't want to move all lines one by one at hand...
> 
> Thanks a lot, il will greatly help me !
> 
> 
> 
Well, my instinct would be to go external.  My tool of choice for 
parsing files is Python. I think the text manipulation tools are quite 
powerful and intuitive.  I no longer speak programmerese well, but the 
ease seems to come from its abilities to shift data typing without a lot 
of fuss. Beyond that there is a lot of flexibility for substr indexing 
type work. I am sure similar scripting languages do this too but Python 
is the one I can vouch for. And the file access is simple and okay for 
writing little personal tools like this.  Believe me, if I could learn 
this language, it is a very shallow learning curve.

I think some people here would also use Excel for the sort of thing you 
want to do.  But I don't know much about it.

SDL could also handle this with a little coaxing.  Seems to me Mike 
William's posted a routine for producing mesh2 and obj. format using sdl 
that also featured some tight syntax for reading and processing files 
easily. But I can't seem to find it now, so maybe I was just dreaming :|


Post a reply to this message

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