Skip to content

Instantly share code, notes, and snippets.

import abc
import random
import logging
import pyglet
from pglib import utils
from pglib.region import Region
from pglib.samplers.range import Range
from pglib.geometry.point import Point2d
@Derfies
Derfies / nodeBoxApplication.py
Last active January 25, 2019 23:11
Boilerplate code to get a simple nodebox app running.
from functools import partial
import nodebox.graphics as nbg
import nodebox.graphics.context as nbc
def grid( width, height, spacing, stroke ):
for x in range( 0, width, spacing ):
nbg.line( x, 0, x, height, stroke=stroke )
for y in range( 0, height, spacing ):
import os
import sys
import random
import nodebox.graphics as nbg
thisDirPath = os.path.dirname( os.path.abspath( __file__ ) )
uberPath = os.path.join( thisDirPath, '..' )
if uberPath not in sys.path:
sys.path.append( uberPath )
import os
import sys
import nodebox.graphics as nbg
thisDirPath = os.path.dirname( os.path.abspath( __file__ ) )
uberPath = os.path.join( thisDirPath, '..' )
if uberPath not in sys.path:
sys.path.append( uberPath )
from uberNode import UberNode
# Cantor set done with nodebox-opengl.
# https://github.com/nodebox/nodebox-opengl/tree/master/nodebox/graphics
import random
import nodebox.graphics as nbg
STEP_HEIGHT = 20
BUF_HEIGHT = 5
MAX_DEPTH = 8