Un pavage hexagonal - Jean-Baptiste Etienne

Based on [url=https://www.geogebra.org/u/jotab][b]Jean-Baptiste Etienne's[/b][/url] : [b][url=https://www.geogebra.org/m/v9jxpzbv]Un pavage hexagonal (Alhambra)[br][/url][/b]News Feed of [url=https://www.geogebra.org/p/wRneUszSfk][b]this design[/b][/url].
[b]Remark regarding the use of buttons (and memory usage).[br][/b][br]You can't use the Delete and Setup buttons repeatedly.[br]It seems to me that GeoGebra crashes because the garbage collector[br]isn't working optimally. The memory usage increases after one delete[br]and re-create from 234 to 367 MB. The sheer amount of memory[br]required surprises me. To prevent Geogebra from crashing[br]I only allow you to delete and recreate once.[br][br][size=150][b]GGB scripting[/b][/size][br][code][br]#===================================================================================[br]# Button Setup : butSetup [br]#===================================================================================[br][br]RunClickScript( butDelete )[br]SetConditionToShowObject( butSetup, false )[br][br]s = sqrt(3)[br]U = ( 10s; 0° )[br]V = ( 10s; 120° )[br][br]LP = Flatten( Zip( Zip(m*U + n*V, m,-3..3), n,-3..3) )[br]LT = RemoveUndefined( zip( if( abs(P)<60, P), P,LP) )[br][br]L1 = { ( s,1),(2s,0),(3s,1),(2s,2),(2s,12),(s,11) }[br]L2 = { (2s,2),(3s,1),(6s,4),(5s,5),(3s,3),(3s,13),(2s,14),(-s,11),(0,10),(2s,12) }[br]LS = Flatten( Zip( Rotate( {(2s,0),(s,1)}, k* 60°), k,0..5) )[br][br]r1 = Flatten( Zip( Translate( Zip( Rotate( Polygon(L1), k* 60°), k,0..5), T), T,LT) )[br]r2 = Flatten( Zip( Translate( Zip( Rotate( Polygon(L2), k*120°), k,0..2), T), T,LT) )[br]rS = Flatten( Zip( Translate( Zip( Rotate( Polygon(LS), k*120°), k,0..2), T), T,LT) )[br]rL = Flatten( {r1,r2} )[br][br]#--- Object properties ---#[br][br]SetColor( r1, "#FFCC66" )[br]SetColor( r2, "#CC0000" )[br]SetColor( rS, Black )[br]SetColor( rL, Black )[br][br]Lobj = { "r1", "r2", "rS", "rL" }[br]Execute( Zip( "SetFilling("+obj+", 1)", obj, Lobj) )[br]Execute( Zip( "SetLineThickness("+obj+", 1)", obj, Lobj) )[br][br]SetFilling( rL, 0 )[br]SetLineThickness( rL, 3 )[br][br]Lobj = { "U", "V", "LP", "LT", "L1", "L2", "LS" }[br]Execute( Zip( "SetConditionToShowObject("+obj+", false)", obj, Lobj) )[br]Delete( Lobj )[br][br]SetCoords( butDelete, 10, 10 )[br]SetCoords( butSetup , 10, 10 )[br]SetCoords( butSettings,10, 50 )[br][br]RunClickScript( butSettings )[br][br]#===================================================================================[br]# Button Settings : butSettings[br]#===================================================================================[br][br]SetActiveView( 1 )[br]CenterView( (-1, 1.5) )[br]ZoomIn( y( Corner(3) - Corner(1) ) / 125 ) [br]ShowAxes( false )[br]ShowGrid( false )[br][br]SetActiveView( -1 )[br]CenterView( (0, 0,-10) )[br]ZoomIn( y( Corner(-1,3) - Corner(-1,1) ) /60 )[br]ShowAxes( false )[br]ShowGrid( false )[br][br]SetViewDirection( Vector( (0,-1.2,-1) ) ) [br]SetSpinSpeed( 1 )[br][br]#===================================================================================[br]# Button Delete : butDelete [br]#===================================================================================[br][br]Lobj = { "rL", "rS", "r2", "r1", "LS", "L2", "L1", "LT" ,"LP" ,"V" ,"U" ,"s" }[br]Execute( Zip( "Delete("+obj+")", obj, Lobj ) )[br]Delete( Lobj )[br][br]SetConditionToShowObject( butDelete, false )[br]SetConditionToShowObject( butSetup , true )[br][br]#===================================================================================[br]# Extra's (Can't be done in Setup script)[br]#===================================================================================[br][br]1) Global JavaScript to start spinning and set button visibility.[br][br] function ggbOnInit() {[br] ggbApplet.evalCommand("SetSpinSpeed(1)");[br] ggbApplet.evalCommand("SetConditionToShowObject(butSetup ,false)");[br] ggbApplet.evalCommand("SetConditionToShowObject(butDelete,true )");[br] }[br][br]2) Preferences - 3D Graphics[br] [br] Miscellaneous - Use Lighting : off[br] Basic - Clipping box size : Large[br] Projection - Perspective Distance : 1200[br] [br]3) Object properties[br] [br] r1 : Advanced - Selection Allowed : off[br] r2 : Advanced - Selection Allowed : off[br] rS : Advanced - Selection Allowed : off[br] rL : Advanced - Selection Allowed : off[br][br][br][br][/code][br][br][br][br][br][br][br][br][br][br][br][br][br][br]

Information: Un pavage hexagonal - Jean-Baptiste Etienne