Skip to content

Instantly share code, notes, and snippets.

View chuckis's full-sized avatar
🔍
In the beginning was the Word,

Ruslan chuckis

🔍
In the beginning was the Word,
  • 23:08 (UTC +03:00)
View GitHub Profile
@chuckis
chuckis / rombos.scad
Created June 1, 2016 15:30
part of inner pad
module one-romb() {
scale ([1, 0.7, 1]) rotate ([45, 0, 0]) cube([30, 1, 1], center=true);
}
//lad-rombs.scad
module lad-rombs() {
for(i= [1 : 30]){
union(){translate ([0, i - (i * 0.3), 0]) one-romb();}
}
}
//vneshnii kontur
CIRCLE_R =8.25;
SQUARE_H = 14;
SQUARE_W = 16.5;
l=8;
LENGTH = 21.5;
TRANSLATE_Y = LENGTH - CIRCLE_R - SQUARE_H * 0.5;
module vneshnii_pad(){
@chuckis
chuckis / diamond.scad
Created May 31, 2016 20:03
pattern of lad-pad.
module romb() {
scale ([1, 1, 1]) rotate ([20, 0, 0]) cube([5, 3, 1], center=true);
}
//diamond_rombs.scad
module diamond(){
rotate ([0, 0, -45]) {
for(i= [0 : 3]){
union(){ translate ([0, i - (i * 0.3), 0]) scale ([1, 1.2, 0.6]) romb();}
@chuckis
chuckis / upper-cube.scad
Created May 30, 2016 16:38
upper cube from lad-pad
//upper-cube.scad
INCL = 3.2; // inner cube length
INCW = 2; // inner cube width
INCH = 2; // inner cube height
THIKNESS = 0.9;
OCL = INCL + THIKNESS * 2 ; // outer cube length
@chuckis
chuckis / stavka.scad
Created May 29, 2016 18:06
part of lad-pad
//stavka.scad
module stavka() {
difference (){
translate ([0, 0, -10]) cube ([20, 20, 20], center=true);
union (){
for (rot = [[0, 90, 0], [90, 0, 0], [0, 0, 90]]){ rotate(rot) cylinder(r= 6.5, h=50, fa = 20, center = true);}
}
}
}
@chuckis
chuckis / fnkon.scm
Last active February 19, 2016 16:30
knight tour in Lispme's scheme
;fnkon'
(define (filter f l)
(if (null? l) '()
(let ((x (car l))
(r (filter f (cdr l))))
(if (f x) (cons x r) r))))
(define (map f l)
(letrec ((result (cons '() '()))
(helper (lambda (p l)
; http://www.algolist.com/Dijkstra's_algorithm
(defn dijkstra [g src]
(loop [dsts (assoc (zipmap (keys g) (repeat nil)) src 0)
curr src
unvi (apply hash-set (keys g))]
(if (empty? unvi)
dsts
(let [unvi (disj unvi curr)
nextn (first (sort-by #(% dsts) unvi))