29 lines
3.1 KiB
Python
29 lines
3.1 KiB
Python
"""Editable examples built exclusively from expressions, frames, sections and transforms."""
|
|
from .kernel import PROJECT_SCHEMA
|
|
|
|
def demo_project():
|
|
return {
|
|
'schema':PROJECT_SCHEMA,'id':'braided-atrium','name':'Braided atrium',
|
|
'parameters':{'radius':11,'lobe':3.2,'rise':4.8,'width':1.25,'thickness':.24,'twist':360,'samples':240,'levels':3},
|
|
'nodes':[
|
|
{'id':'braid-path','op':'curve','params':{'xyz':['(radius+lobe*cos(3*t))*cos(2*t)','(radius+lobe*cos(3*t))*sin(2*t)','rise*sin(3*t)'],'domain':[0,'tau'],'segments':'samples','closed':True},'visible':False,'role':'route'},
|
|
{'id':'braid-frames','op':'frames','inputs':{'path':'braid-path'},'params':{'twist_degrees':'twist'},'visible':False},
|
|
{'id':'braid-section','op':'sweep','inputs':{'frames':'braid-frames'},'params':{'profile':[['-width/2','-thickness/2'],['width/2','-thickness/2'],['width/2','thickness/2'],['-width/2','thickness/2']]},'visible':False},
|
|
{'id':'braided-galleries','name':'Braided galleries','op':'repeat','inputs':{'source':'braid-section'},'params':{'count':'levels','translate':[0,0,6.5],'rotate':[0,0,37],'scale':.87},'color':[.37,.56,.68],'role':'gallery'},
|
|
{'id':'ring-path','op':'curve','params':{'xyz':['(radius+lobe+2.6)*cos(t)','(radius+lobe+2.6)*sin(t)','-6+0.65*sin(4*t)'],'segments':144,'closed':True},'visible':False},
|
|
{'id':'ring-frames','op':'frames','inputs':{'path':'ring-path'},'visible':False},
|
|
{'id':'ring-section','op':'sweep','inputs':{'frames':'ring-frames'},'params':{'profile':[[-.13,-.11],[.13,-.11],[.13,.11],[-.13,.11]]},'visible':False},
|
|
{'id':'outer-rings','name':'Contour rings','op':'repeat','inputs':{'source':'ring-section'},'params':{'count':9,'translate':[0,0,2.8],'rotate':[0,0,11]},'color':[.63,.68,.73],'role':'structure'},
|
|
{'id':'spine-path','op':'curve','params':{'xyz':['(radius+lobe+2.6)*cos(t)','(radius+lobe+2.6)*sin(t)','-6+18*t/pi'],'domain':[0,'1.35*pi'],'segments':112},'visible':False},
|
|
{'id':'spine-frames','op':'frames','inputs':{'path':'spine-path'},'visible':False},
|
|
{'id':'spine-section','op':'sweep','inputs':{'frames':'spine-frames'},'params':{'profile':[[-.18,-.18],[.18,-.18],[.18,.18],[-.18,.18]]},'visible':False},
|
|
{'id':'spiral-spines','name':'Spiral spines','op':'repeat','inputs':{'source':'spine-section'},'params':{'count':4,'rotate':[0,0,90]},'color':[.69,.47,.29],'role':'structure'},
|
|
{'id':'saddle-shell','name':'Lower saddle','op':'surface','params':{'xyz':['u','v','0.025*(u*u-v*v)-9'],'u_domain':[-7,7],'v_domain':[-7,7],'u_segments':28,'v_segments':28,'thickness':.22},'color':[.57,.66,.58],'role':'shell'}
|
|
]}
|
|
|
|
def small_project():
|
|
return {'schema':PROJECT_SCHEMA,'id':'first-study','name':'First study','parameters':{'height':4},'nodes':[
|
|
{'id':'path','op':'curve','params':{'xyz':['8*cos(t)','8*sin(t)','height*t/tau'],'domain':[0,'tau'],'segments':96},'visible':False},
|
|
{'id':'local-frames','op':'frames','inputs':{'path':'path'},'visible':False},
|
|
{'id':'gallery','op':'sweep','inputs':{'frames':'local-frames'},'params':{'profile':[[-1,-.15],[1,-.15],[1,.15],[-1,.15]]},'role':'gallery'}]}
|