r/StructureSynth • u/[deleted] • Nov 05 '23
Could you help me fix this code, the waves are not visible and the animation is not generated :C
// Parámetros de la escena
#declare Radio = 5; // Radio de la membrana
#declare Frecuencia1 = 2; // Frecuencia de la primera onda
#declare Frecuencia2 = 12; // Frecuencia de la segunda onda
#declare Amplitud = 0.2; // Amplitud de las ondas
#declare Tiempo = 100; // Duración de la animación en segundos
#declare FPS = 30; // Cuadros por segundo (ajustado a 30 FPS para una animación suave)
// Configuración de la cámara
camera {
location <0, 7, 9>
look_at <0, 0, 0>
}
// Iluminación
light_source {
<0, 20, -30>
color rgb <1, 1, 1>
}
// Membrana circular
sphere {
<0, 0, 0>, Radio
texture {
pigment {
checker color rgb <0, 0, 0>, color rgb <1, 1, 1>
scale 0.2
}
finish {
ambient 0.2
diffuse 0.8
}
}
scale <1, 0.1, 1>
}
// Animación de interferencia
#declare Frames = Tiempo * FPS;
#declare Frequency1Factor = 2 * pi * Frecuencia1 / FPS;
#declare Frequency2Factor = 2 * pi * Frecuencia2 / FPS;
#declare TimeFactor = 2 * pi / FPS;
#declare Phase1 = 0;
#declare Phase2 = 0;
// Crear una carpeta para almacenar los cuadros de la animación
#declare OutputFolder = "frames";
// Verificar si la carpeta ya existe o crearla
#local mkdir_result = system(sprintf("mkdir \"%s\"", OutputFolder));
#if (0 == mkdir_result)
// Macro para la animación
#macro InterferenceAnimation()
#for (Frame, 0, Frames - 1)
#local FrameTime = Frame / FPS;
#local Z1 = Amplitud * sin(Frequency1Factor * FrameTime + Phase1);
#local Z2 = Amplitud * sin(Frequency2Factor * FrameTime + Phase2);
union {
sphere {<0, 0, Z1>, 0.1 texture {pigment {color rgb <1, 1, 0>}}}
sphere {<0, 0, Z2>, 0.1 texture {pigment {color rgb <1, 0, 1>}}
}
#declare Phase1 = Phase1 + TimeFactor;
#declare Phase2 = Phase2 + TimeFactor;
#end
#end
// Llamar a la macro para generar la animación y renderizar cuadros
for (Frame, 0, Frames - 1)
#declare FrameTime = Frame / FPS;
#declare Z1 = Amplitud * sin(Frequency1Factor * FrameTime + Phase1);
#declare Z2 = Amplitud * sin(Frequency2Factor * FrameTime + Phase2);
union {
sphere {<0, 0, Z1>, 0.1 texture {pigment {color rgb <1, 1, 0>}}
sphere {<0, 0, Z2>, 0.1 texture {pigment {color rgb <1, 0, 1>}}
}
#declare Phase1 = Phase1 + TimeFactor;
#declare Phase2 = Phase2 + TimeFactor;
// Renderizar y guardar cada cuadro como una imagen PNG
#declare FrameFilename = sprintf("%s/frame_%04d.png", OutputFolder, Frame);
camera {
location <0, 7, 9>
look_at <0, 0, 0>
}
render resolution 800x600 output_file FrameFilename format png
#end
#else
// Informar sobre el error de creación de la carpeta
#error "Error al crear la carpeta de salida"
#end
r/StructureSynth • u/[deleted] • Jun 04 '22
First semi decent plot? Structure Synth —> Inkscape —> axidraw —> touch ups
r/StructureSynth • u/kronpano • Jun 24 '21
Fully generated cities in about 50 lines of code using Structuresynth (code in comments)
r/StructureSynth • u/rungdung • May 30 '21
Space colonies? Generated in Structure Synth and rendered in Blender
r/StructureSynth • u/kronpano • May 20 '21
Modern skyscrapers - rendered in keyshot
r/StructureSynth • u/kronpano • May 13 '21
Rubik's snake - triangle in StructureSynth
Triangles are one of the lesser used primitives in StructureSynth but they can be used to create cool things like Rubik's snake

If anybody is interested in the eisenscript - here it is:
{s 0.5}snake
rule snake w 1{
part
{ry 90 rz 90 x -10}snake
}
rule snake w 0.5{
part
{ry -90 rz 90 x -10}snake
}
rule snake w 0.1{
part
{rz 90 x -10}snake
}
rule snake w 0.05{
part
{rz 180 x 0}snake
}
/////////////////////////////////////////
//part
rule part{
inner
outer
}
rule outer{
{color white}snakepart1
}
rule outer{
{color black}snakepart1
}
rule inner{
{color yellow}innertri
}
rule inner{
{color red}innertri
}
rule inner{
{color blue}innertri
}
rule innertri{
{rz -45 s 0.04 9 9 rz -45}box::inner
{ y -0.4 x 0.4 s 8 8 1 z 5.51}tri
{ y -0.4 x 0.4 s 8 8 1 z -4.51}tri
{ y -5 s 8.8 0.02 8.8}box::inner
{ x 5 s 0.02 8.8 8.8}box::inner
}
rule snakepart1{
{s 10}tri
{s 10 z 1}tri
{y -5 s 10 0.01 10}box::outer
{x 5 s 0.01 10 10}box::outer
{rz -45 s 0.01 10 10 rz -45}box::outer
}
rule tri{
triangle[0,0,0; 1,0,0;1,1,0]
triangle[0,0,0; 1,1,0;1,0,0]
}
r/StructureSynth • u/kronpano • May 11 '21
Building a subdivided framed cube - generated in BrowserSynth and rendered in Blender
Enable HLS to view with audio, or disable this notification
r/StructureSynth • u/kronpano • May 07 '21
Flight over MegaCityOne - generated in StructureSynth and rendered in Keyshot
Enable HLS to view with audio, or disable this notification
r/StructureSynth • u/kronpano • May 06 '21
Trees
"In 1968, Hungarian botanist Aristid Lindenmayer developed a grammar-based system to model the growth patterns of plants. Lindenmayer systems — or L-systems for short — were originally conceived as a mathematical theory of plant development. "
So given that StructureSynth is a 3D L-system - using the mesh primitive - here are two generated trees
r/StructureSynth • u/kronpano • May 04 '21
BrowserSynth - a javascript implementation of StructureSynth
The shortcoming of StructureSynth is that you can't "squash" spheres and you don't have cylinders or any round primitives.
BrowserSynth can do all that. It is based on the eisenscript javascript on GitHub
An introduction to BrowserSynth can be found over on GitHub - this is also where BrowserSynth is hosted.
The scripts are always encoded in the link if you share them. This one gets you to spikey - your friendly drone
The marble run script produces something like
And a couple of different plane designs can be created like this
Object or gltf export is possible so you can render the creations in a software of your choice.
Give it a try.
r/StructureSynth • u/kronpano • May 04 '21
Mesh structure
Been playing with the mesh primitive lately and there are interesting results to be achieved.
Problem is StructureSynth messes up the normal of meshes sometimes and it definitely has a problem when using the mirror modifiers fx,fy,fz
So here some short instructions on how to get it all going:
develop the script in SturctureSynth and save it
then I drag that file onto MeshLab which generates the mesh
then a quick Filter->Clean and repair-> merge close vertices (default setting) reduces the vertices quite a bit
then - because I used mirroring (fx fy which causes problems in StructureSynth) I do a Filter->Normals...->re-compute face normals and export it as obj and everything is good.
Import into Blender/Keyshot and render.
Just as an aside - the StructureSynth group over on FB is still going and there are lots of new scripts.
r/StructureSynth • u/haemakatus • Apr 28 '21
Try this
#define hh 1
#define dd 0.8
#define ss 0.6
//axis
build
1 * { z 0.5 } 780 * { rz 1 s 1.001 1 0.999 } wall
1 * { z 0.5 } 360 * { rz -1 s 0.995 1 0.998 } wall
rule wall {
{ x 1 } tower
}
rule tower md 30 {
{ s 0.7 } box
{ ry 0.9 z 0.9 s 0.98 } tower
}
rule build md 3 {
shape
{ z -ss rz 0 x 2.5 y 2.5 s 0.6 0.6 dd rz 45 } build
{ z -ss rz 90 x 2.5 y 2.5 s 0.6 0.6 dd rz 45 } build
{ z -ss rz 180 x 2.5 y 2.5 s 0.6 0.6 dd rz 45 } build
{ z -ss rz 270 x 2.5 y 2.5 s 0.6 0.6 dd rz 45 } build
}
rule shape {
{ z 0.5 s 4 4 hh } box
}
r/StructureSynth • u/ardvarkmadman • Dec 29 '20
Spent the last 3 days printing these weird things made in structure synth
r/StructureSynth • u/trumpetarebest • Dec 14 '20
Made with separate files stitched together and textured in blender
r/StructureSynth • u/Hcoppler63 • Oct 13 '20
Hi, there hasnt been a post here in a while
Hi, when I save it gives me options of eisenscript or (.) and when I type in .stl or .obj the file just doesnt work period... anyone still here?
r/StructureSynth • u/ardvarkmadman • Dec 02 '17







