POV-Ray : Newsgroups : povray.pov4.discussion.general : Curly braces replaced by indentations but only as an option ? : Re: Curly braces replaced by indentations but only as an option ? Server Time
1 Apr 2025 16:38:07 EDT (-0400)
  Re: Curly braces replaced by indentations but only as an option ?  
From: ingo
Date: 20 Mar 2025 10:40:00
Message: <web.67dc27eb7e3c5a9917bac71e8ffb8ce3@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "ingo" <nomail@nomail> wrote:
> > ...
> >   object:
> >     sphere:
> >       center<0, 0, 0>
> >       radius<1>
> >       material:
>
> JSON has been mentioned elsewhere as a replacement (?) or as a component of the
> "new SDL".  it would (I guess) make a real good storage format for objects (like
> above), or materials/textures libraries, etc.
>

object and material are just containers, lists/arrays..
there are a few specialised ordered lists with an operator attached, union,
intersect etc.

A povObject/shape is like a specific composed dictionary/struct/record as is
texture. One could define it all in SQLite:

CREATE TABLE IF NOT EXISTS sphere(
  //centre: ah, there is no vector type but we could crate a table for that
         id INTEGER PRIMARY KEY NOT NULL,
       name TEXT UNIQUE,
     centre INTEGER REFERENCES vector(id),
     radius REAL DEFAULT 1.0,
   material INTEGER REFERENCES material(id)
)STRICT;

CREATE TABLE IF NOT EXISTS vector(
    id INTEGER PRIMARY KEY NOT NULL, // or use a string formatted as '<x,y,z>'?
     x REAL NOT NULL,
     y REAL NOT NULL,
     z REAL NOT NULL
)STRICT;

etc. etc. who needs type-systems and OOP if you have a database ;)

ingo


Post a reply to this message

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