Photo 51 – Structure Synth DNA

20180220 - Photo 51

For my 51st ‘pic of the day’ for 2018, I was inspired by the famous Photo 51 to have a go at creating a strand of DNA in Structure Synth.

structuresynth_DNA

Here’s the Eisenscript. With a single r1 rule, the result is a straight helix. Additional rule definitions create the waviness.  Changing the weights and rotations of the alternate definitions creates some interesting shapes.

set background #fff
set maxdepth 100

r1

rule r1 w 10 {
   obj1
   {rx 10 x 0.5} r1
}

// ------ Remove additiona lr1 rules for straight DNA
rule r1 w 15 {
   obj1
   {rx 10 rz 10 x 0.5} r1
}

rule r1 w 3 {
   obj1
   {rx 10 ry 18 x 0.5} r1
}

rule r1 w 10 {
   obj1
   {rx 10 ry -10 x 0.5} r1
}
// ------ End of additional r1 Rules

rule obj1 {
   obj2
   {s 0.1 0.1 3} box
   {x 0.5 rx 8} obj2
   {x 1 rx 16} obj2
}

rule obj2 {
   {z -1.5 s 0.5 1 0.2} box
   {z 1.5 s 0.5 1 0.2} box
}

 

Porting to the GA node of Sverchok, I changed the primitive name of the obj2 rule (‘endbox’) to facilitate using a different Blender object.

<!-- Original Eisenscript script: DNA -->
<rules max_depth="100">
 <rule name="entry">
    <call rule="r1" transforms=""/>
 </rule>
 <rule name="r1" weight="10">
    <call rule="obj1" transforms=""/>
    <call rule="r1" transforms="rx 10 tx 0.5"/>
 </rule>
 <rule name="r1" weight="15">
    <call rule="obj1" transforms=""/>
    <call rule="r1" transforms="rx 10 rz 10 tx 0.5"/>
 </rule>
 <rule name="r1" weight="3">
    <call rule="obj1" transforms=""/>
    <call rule="r1" transforms="rx 10 ry 18 tx 0.5"/>
 </rule>
 <rule name="r1" weight="10">
    <call rule="obj1" transforms=""/>
    <call rule="r1" transforms="rx 10 ry -10 tx 0.5"/>
 </rule>
 <rule name="r1" weight="5">
    <call rule="obj1" transforms=""/>
    <call rule="r1" transforms="rx 10 ry -18 tx 0.5"/>
 </rule>


<!-- Create Shape Elements --> 
 <rule name="obj1">
    <instance shape="box" transforms="s 0.1 0.1 3"/>
    <call rule="obj2" transforms=""/>
    <call rule="obj2" transforms="tx 0.5 rx 8"/>
    <call rule="obj2" transforms="tx 1 rx 16"/>
 </rule>
 <rule name="obj2">
    <instance shape="endbox" transforms="tz -1.5 sa 0.5 "/>
    <instance shape="endbox" transforms="tz 1.5 sa 0.5 "/>
 </rule>
</rules>

sv_nodes_dna

Sverchok Generative Art Node Tree

As I wanted to use a particle system on the resultant mesh, I used the Division fields on the Box node to create additional geometry on the central bar, and used an icosphere for the helix supports. The Matrix Apply node creates one mesh each for the bar and supports. I created several different strands by changing the GA node seed value and  assigned them all the same particle system. It sort-of worked. 😉

 

Comments are closed.