POV-Ray : Newsgroups : povray.off-topic : kd-trees rule! : Re: kd-trees rule! Server Time
6 Sep 2024 11:17:08 EDT (-0400)
  Re: kd-trees rule!  
From: Darren New
Date: 13 Feb 2009 15:56:58
Message: <4995de9a$1@news.povray.org>
triple_r wrote:
> Good advice.  This is what happens, though, when people with no business
> programming try to solve common problems.  They reinvent the wheel, shape it
> like a square, weld two tons of steel to it, and argue that, "Hey, it works."

Yup.

> So with this method, do you have direct access via python to methods and
> functions?  That sure would be useful.  I think I'll need to figure this out
> for my soon-to-be-job anyway.

Yup.  Decent blender tutorial that'll give you the idea how it looks when done:

http://jmsoler.free.fr/didacticiel/blender/tutor/python_script00_en.htm
(Follow that to the next page for an actual Python example script.)

Mind, this is the sort of thing Tcl was built for. Indeed, Tcl was up to 
version 3 before you could run a program written entirely in Tcl. (I.e., 
version 3 was the first version of Tcl that came with main() :-) 
Unfortunately, Tcl never really got the reference-semantics thing going, so 
it's difficult to bolt useful OO constructs onto it. But it's pretty easy to 
build your own OO style constructs that Tcl can invoke.

Blender is also open source, so you can peek and see how they integrated the 
Python stuff.

>> Use one someone already built for you, with the intention that you use it as
>> your parser.
> 
> Point taken.  Thanks for straightening me out on the subject.

No problem. Just offering suggestions. Writing your own parser can be fun, 
too, but there's way too much reinvent-the-wheel in this world. Why make 
someone learn a new scripting language when you can say "use this, that you 
already know"? :-)  Indeed, the point of things like COM and .NET is "use 
whatever you already know to run this, including scripts like WSH and 
PowerShell."

There's also something called YAML (Yet Another Markup Language) which is 
semantically identical to JSON but it's readable. You might want to peek at 
that too, if JSON is sufficient.  (JSON is basically maps and arrays of 
strings and numbers, nested. I.e., data structures common to all the 
scripting languages, but surprisingly flexible for a lot of stuff.)

-- 
   Darren New, San Diego CA, USA (PST)
   "Ouch ouch ouch!"
   "What's wrong? Noodles too hot?"
   "No, I have Chopstick Tunnel Syndrome."


Post a reply to this message

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