POV-Ray : Newsgroups : povray.beta-test : Dictionary 'reassign' : Re: Dictionary 'reassign' Server Time
6 Nov 2024 00:46:04 EST (-0500)
  Re: Dictionary 'reassign'  
From: ingo
Date: 4 Dec 2018 15:16:01
Message: <XnsA9AED85707CE3seed7@news.povray.org>
in news:web.5c06d2c1a98f76e2e43b71790@news.povray.org jr wrote:

> I don't suppose "the other way round" is any good to you?  eg:
> 
> #declare T = dictionary {
>   .base0 : 0,
>   .base1 : 1,
>   .base2 : 2,
>   .vecs : array {<1,2,3>,<0,1,2>,<4,5,6>}
> };

I'll have to reorient my brain for that, but I'll have a try. It may 
work for a few things but probably not for the the more complex 
structures I have.

#declare Fabrik = dictionary{
    // Processing order
    ["Proc"]  : array[4]{"Left", "Right", "LRB" ,"Base"},
    //Chain named 'Base'
    ["Base"]  : dictionary{
        ["Type"]      : "BaseSubbase",
        ["Joint"]     : array[4]{<0,0,0>, < 0,1,0>, < 0,2,0>, < 0,3,0>},
        ["Constraint"]: array[4]{false, object{}, false, false},
        ["Centroid"]  : array[1]{"LRB"}
    },
    ["Left"]  : dictionary{
        ["Type"]      : "SubbaseEnd"
        ["Joint"]     : array[4]{<0,3,0>, <-1,4,0>, <-2,5,0>, <-3,6,0>},
        ["Centroid"]  : array[1]{"LRB"}
    },
    ["Right"] : dictionary{
        ["Type"]      : "SubbaseEnd"
        ["Joint"]     : array[4]{<0,3,0>, < 1,4,0>, < 2,5,0>, < 3,6,0>},
        ["Constraint"]: array[4]{false, object{}, false, false},
        ["Centroid"]  : array[1]{"LRB"}
    },
    ["LRB"]   : dictionary{
        ["Type"]      : "Centroid"
        ["Index"]     : array[3]{"Left", "Right", "Base"},
        ["Centroid"]  : dictionary{
            ["Left"]      : 0, 
            ["Right"]     : 0, 
            ["Base"]      : 3
        }
    }
};

Thanks,

ingo


Post a reply to this message

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