new icn messageflickr-free-ic3d pan white

POV-Ray CSG Example in Structure Synth

After seeing one of Schmiegels images I've been playing around with support for CSG (Constructive Solid Geometry) in Structure Synth.

 

I'm not planning to integrate CSG in the OpenGL view in Structure Synth (this would be extremely difficult), but only to make it possible to use the basic set operations when using the POV-Ray template.

 

Initially I thought it would enough simply to add some generic template commands like 'template::intersection-begin' which could create the necessary sections in the POV-Ray output.

 

Actually it required some extensions to the Structure Synth engine: normally the rule tree is traversed 'breadth-first', which is probably the best way to deal with the infinite recursion often present in EisenScript systems.

 

But to create the bracket structure needed for the CSG POV-Ray output, the rule tree has to be traversed 'depth-first'. A new Structure Synth command 'set recursion depth' now makes this possible.

 

This image itself is not particular interesting, but only a demonstration of how CSG works.

 

The EisenScript:

set maxdepth 17

set recursion depth

 

template::intersection-begin

{ y 0.5 s 5 1 1 color white } box

template::union-begin

r1

template::union-end

template::intersection-end

 

rule r1 md 17 {

template::difference-begin

sphere

{ s 0.99 x -0.1 } sphere

template::difference-end

move

}

 

rule move {

1 * { s 0.95 x -0.1 ry 15 } 1 * { s 0.95 x -0.1 } r1

}

 

rule move {

1 * { s 0.95 x -0.1 ry -15 } 1 * { s 0.95 x -0.1 } r1

}

 

Still needs some polish, but I think some interesting structures could be made by intersecting and subtracting different generative forms.

19,628 views
6 faves
10 comments
Uploaded on June 20, 2009