Voxel Regular Expression

Is there a way to freely describe an object (for example, by matching finite state machines, for example) in a 3d voxel grid, can we also freely describe patterns in a one-dimensional line with a regular expression?

Say I want to describe a cuboid of voxels of type “A” with a lower face consisting of voxels of type “B” or “C” with a height of 3 and a width of 5, and compare this description with the voxel field to find examples of the template. I can execute search for exact models (sort of like Boy-Moore-in-3D), but I need to specify variable sizes for some objects (for example, a variable length for the above cuboid).

+5
source share
2 answers

Regular expressions are a compact way to express the syntax of a limited (and still infinite) set of languages. With regular expressions, you don’t need to specify where to look for the next character, since it is known that you are working on a string and repeating its characters, taking them as language characters ... but in 3D you will need to tell where to go.

, , "", , . "", , , . , , . , , . . [ , 3D).

, , . , ( ), , ( ):

There is a voxel type A and then moving (x1, y1, z1) from that there is a voxel of type B or C and then moving (x2, y2, z3) from that there is a voxel type D

, , , , .

, . . A, B, C D , , , . . , .

, - , , A X A Z , , .

, , ( , ...), , , : "2d5l1u". 3D . , , . , , ( EBNF ):

A X:

(A1X){3}

"A" "1X", "(" ")" "{" "}" . :

A1XA1XA1X

"1X" , :

A1XA1XA

: voxel A, 1 X voxel A, 1 X voxel A.

A X Z:

(A1X){3}|(A1Z){3}

:

(A1[X|Z]){3}

"[" "]", "", , :

[(A1X)|(A1Z)]{3}

A, , X, Z .

3x3 a X, Y:

(((A1X){3})1Y){3}

X 1 Y, . , "([(A1X)] {16})" , "1Y". , :

(A1XA1XA1X)1Y(A1XA1XA1X)1Y(A1XA1XA1X)1Y

, . , , , , , , .

A, ( ):

A1(X|Y|Z).1(X|Y|Z)A1(X|Y|Z)

"." .

, , , , 1 . , "+", "*" "?" , . "{" "}" , , .

, , , :

(A1[X|Y|Z|W]){3}

"." :

(A1.){3}

, , , , . , "(A1B1) {3}" "(A1.B1.) {3}", "B", , , , , .

, X, Y, A:

(A1[X|Y]){4}

, , :

(A.){4}

. , , .

, .

EDIT:

, angular "<" " > ", , , :

(<0088FF>.){4}
+4

3D , , .

:

, , :

<object>
    <cube>
        <faces>
            <face orientation="up" color="blue">
                <border neighborOrient="west">
                <border neighborOrient="south">
            <face orientation="west" color="red">
            <face orientation="south" color="green">
            ...
        </faces>
    </cube>
</object>

, . Regexes , , "" .

+2

All Articles