Skip to content

Instantly share code, notes, and snippets.

View nortikin's full-sized avatar
🌍
making 🙈 🙉 🙊

nikitron nortikin

🌍
making 🙈 🙉 🙊
View GitHub Profile
@nortikin
nortikin / node_Script.py
Last active August 29, 2015 14:00
update
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nortikin
nortikin / prog2.py
Last active September 30, 2016 14:36
changed type to 'v' sverchok SN1
def sv_main(num_verts=20, radius=5, limit=32):
# in boilerplate, could be less verbose
in_sockets = [
['s', 'num_verts', num_verts],
['s', 'radius', radius],
['s', 'limit', limit],
]
# arbitrary user code
@nortikin
nortikin / gist:11176778
Last active September 30, 2016 14:36
Separate_vert_hor_edges sverchok SN1
def sv_main(v=[],e=[],tres=1):
# in boilerplate - make your own sockets
in_sockets = [
['v', 'Vertices', v],
['s', 'edges', e],
['s', 'Threshold', tres],
]
# import libreryes - your defined
@nortikin
nortikin / выпадание.py
Created May 5, 2014 20:34
Как часто выпадает несколько дней в месяц - пять воскресений в месяце, например
def выпадание(днидляпросчёта, годконца):
# месяца - стандартные значения
янв = мар = май = июл = авг = окт = дек = [i for i in range(1,32)]
апр = июн = сен = ноя = [i for i in range(1,31)]
# первый год не менять или найти год начинающийся с воскресенья
год = 2012
неделя=['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота']
днисквозные = 0
while год<годконца:
if not год%4:
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nortikin
nortikin / line.py
Last active August 29, 2015 14:02
line.py
import bpy
from node_s import *
from util import *
class LineNode(Node, SverchCustomTreeNode):
''' Line '''
bl_idname = 'LineNode'
bl_label = 'Line'
bl_icon = 'OUTLINER_OB_EMPTY'
@nortikin
nortikin / _.md
Created December 5, 2014 13:32
sverchok site design4

[ Launch: sverchok site design4 ] 39544a7c4102227c4bb1 by nortikin[ Launch: sverchok site design3 ] b174ec8ccdceaaf91810 by zeffii[ Launch: sverchok site design2 ] 57c755695d758d910252 by zeffii[ Launch: sverchok site design ] cbc2d2feba7d65d8c256 by zeffii[ Launch: zeffii's geom dailies grid html BW ] 8cc363a1bc13f6b85419 by zeffii[ Launch: zeffii's geom dailies grid html ] 5818369 by zeffii[ Launch: zeffii's geom dailies grid ] 5756514 by zeffii[ Launch: zeffii's geom dailies ] 5280281 by zeffii[

@nortikin
nortikin / _.md
Created December 5, 2014 22:26
sverchok site design5

[ Launch: sverchok site design5 ] a3a346f93d9e14873afb by nortikin[ Launch: sverchok site design4 ] 8f9748503e271a0393fa by zeffii[ Launch: sverchok site design3 ] b174ec8ccdceaaf91810 by zeffii[ Launch: sverchok site design2 ] 57c755695d758d910252 by zeffii[ Launch: sverchok site design ] cbc2d2feba7d65d8c256 by zeffii[ Launch: zeffii's geom dailies grid html BW ] 8cc363a1bc13f6b85419 by zeffii[ Launch: zeffii's geom dailies grid html ] 5818369 by zeffii[ Launch: zeffii's geom dailies grid ] 5756514 by zeffii[

@nortikin
nortikin / _.md
Created December 5, 2014 22:26
anim test
@nortikin
nortikin / COP
Created December 23, 2014 15:28
matrix rotation code
for mid, cen, med, nor in zip(midledge, centrs, medians, normals):
MatrixLoc = Matrix.Translation(cen)
MatrixRot_z = cen.rotation_difference(nor).to_matrix().to_4x4()
x,y,z = nor[:]
quota = sqrt( x**2 + y**2 )
if quota > 1e-12:
Nx = Vector(( -y/quota, x/quota, 0 ))
Ny = Vector(( -x*z/quota,-y*z/quota,quota ))