Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

;-) #2

Open
MaurinElectroTextile opened this issue Jun 21, 2012 · 2 comments
Open

;-) #2

MaurinElectroTextile opened this issue Jun 21, 2012 · 2 comments

Comments

@MaurinElectroTextile
Copy link

/////// BLACKBOXE TYPO
/////// maurin.box@gmail.com

////////////////////////////////// variables
string = "BLACK BOXE"; // type a word
PIXEL_SISE = 8; // sise of letter
LETTER_SPACE = 1.1; // space between letters
PIXEL_SPACE = 1; // space between pixels
HEIGHT = 0.3;

////////////////////////////////// 3D text
word();

////////////////////////////////// module word
module word(){

for( i = [0:len(string)] ){
translate([0, i* (5*PIXEL_SISE) * LETTER_SPACE, 0])
alphabet(string[i]);
}
}

////////////////////////////////// module prismeDir
module prismeDir(dir, posX, posY){

if(dir == 0){
// color([1,0,0])
// translate([posX, posY, 0])
// prisme(PIXEL_SISE);
}
if(dir == 1){
color([1,0,1])
translate([posX, posY, 0])
mirror([1,0,0]){
prisme(PIXEL_SISE);
}
}
}

////////////////////////////////// Pixel shape
module prisme(size){

polyhedron(
points =
[[-size/2, -size/2, 0],
[-size/2, size/2, 0],
[size/2, size/2, 0],
[size/2, -size/2, 0],
[-size/2, -size/2, size_HEIGHT],
[-size/2, size/2, size_HEIGHT]],

triangles =
[[0,3,2],[0,2,1],[3,0,4],[1,2,5],[0,5,4],[0,1,5],[5,2,4],[4,2,3]]
);

}

////////////////////////////////// letters
module alphabet(char){
if (char == " "){
letter([
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
]);
}
if (char == "A"){
letter([
[0,1,1,0],
[1,0,0,1],
[1,1,1,1],
[1,0,0,1],
[1,0,0,1]
]);
}
else if (char == "B"){
letter([
[1,1,1,0],
[1,0,0,1],
[1,1,1,0],
[1,0,0,1],
[1,1,1,0]
]);
}
if (char == "C"){
letter([
[0,1,1,1],
[1,0,0,0],
[1,0,0,0],
[1,0,0,0],
[0,1,1,1]
]);
}
if (char == "D"){
letter([
[1,1,1,0],
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[1,1,1,0]
]);
}
if (char == "E"){
letter([
[1,1,1,1],
[1,0,0,0],
[1,1,1,0],
[1,0,0,0],
[1,1,1,1]
]);
}
if (char == "F"){
letter([
[1,1,1,1],
[1,0,0,0],
[1,1,1,0],
[1,0,0,0],
[1,0,0,0]
]);
}
if (char == "G"){
letter([
[0,1,1,1],
[1,0,0,0],
[1,0,1,1],
[1,0,0,1],
[0,1,1,0]
]);
}
if (char == "H"){
letter([
[1,0,0,1],
[1,0,0,1],
[1,1,1,1],
[1,0,0,1],
[1,0,0,1]
]);
}
if (char == "I"){
letter([
[1,1,1,0],
[0,1,0,0],
[0,1,0,0],
[0,1,0,0],
[1,1,1,0]
]);
}
if (char == "J"){
letter([
[1,1,1,1],
[0,0,1,0],
[0,0,1,0],
[1,0,1,0],
[0,1,0,0]
]);
}
if (char == "K"){
letter([
[1,0,0,1],
[1,0,1,0],
[1,1,0,0],
[1,0,1,0],
[1,0,0,1]
]);
}
if (char == "L"){
letter([
[1,0,0,0],
[1,0,0,0],
[1,0,0,0],
[1,0,0,0],
[1,1,1,1]
]);
}
if (char == "M"){
letter([
[1,0,0,1],
[1,1,1,1],
[1,0,0,1],
[1,0,0,1],
[1,0,0,1]
]);
}
if (char == "N"){
letter([
[1,0,0,1],
[1,1,0,1],
[1,0,1,1],
[1,0,0,1],
[1,0,0,1]
]);
}
if (char == "O"){
letter([
[0,1,1,0],
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[0,1,1,0]
]);
}
if (char == "P"){
letter([
[1,1,1,0],
[1,0,0,1],
[1,1,1,0],
[1,0,0,0],
[1,0,0,0]
]);
}
if (char == "Q"){
letter([
[0,1,1,0],
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[0,1,1,1]
]);
}
if (char == "R"){
letter([
[1,1,1,0],
[1,0,0,1],
[1,1,1,1],
[1,0,1,0],
[1,0,0,1]
]);
}
if (char == "S"){
letter([
[0,1,1,1],
[1,0,0,0],
[0,1,1,0],
[1,0,0,1],
[1,1,1,0]
]);
}
if (char == "T"){
letter([
[1,1,1,1],
[0,1,0,0],
[0,1,0,0],
[0,1,0,0],
[0,1,0,0]
]);
}
if (char == "U"){
letter([
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[0,1,1,0]
]);
}
if (char == "V"){
letter([
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[0,1,0,1],
[0,0,1,0]
]);
}
if (char == "W"){
letter([
[1,0,0,1],
[1,0,0,1],
[1,0,0,1],
[1,1,1,1],
[1,0,0,1]
]);
}
if (char == "X"){
letter([
[1,0,0,1],
[1,0,0,1],
[0,1,1,0],
[1,0,0,1],
[1,0,0,1]
]);
}
if (char == "Y"){
letter([
[1,0,0,1],
[1,0,0,1],
[0,1,1,0],
[0,1,0,0],
[1,0,0,0]
]);
}
if (char == "Z"){
letter([
[1,1,1,1],
[0,0,1,0],
[0,1,0,0],
[1,0,0,0],
[1,1,1,1]
]);
}
}

////////////////////////////////// module letter
module letter(array){

for( i = [0:4] ){ // rows
for(j = [0:3]){ // columns
prismeDir(array[i][j], i_PIXEL_SISE + i_PIXEL_SPACE, j_PIXEL_SISE + j_PIXEL_SPACE);
}
}
}

@tbuser
Copy link
Owner

tbuser commented Jun 21, 2012

What is this?

@MaurinElectroTextile
Copy link
Author

Sorry for that big text pasting. It is a similar code using string and len(string), good for you !?

Maurin

Le 21 juin 2012 à 23:40, Tony Buser a écrit :

What is this?


Reply to this email directly or view it on GitHub:
#2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants