OpenSCAD príklady: Rozdiel medzi revíziami
Zo stránky SensorWiki
Riadok 66: | Riadok 66: | ||
| | | | ||
| <source lang="C++"> | | <source lang="C++"> | ||
font = "Impact"; | |||
letter_size = 22; | |||
letter_height = 1; | |||
union() | |||
{ | |||
difference() { // This builds the coin with recesses on each side. | |||
cylinder(h=6, d=36); | |||
translate ([0,0,-5.5]) { // making bottom brim | |||
color("red") cylinder(h=6, d=31); // bottom of coin | |||
} | |||
translate ([0,0,5.5]) { | |||
color("blue") cylinder(h=6, d=31); // top of coin | |||
} | |||
} | |||
rotate([0,0,-90]) | |||
{ | |||
union() { // This union creates and positions the K symbol on the bottom of the coin. | |||
color("cyan") | |||
linear_extrude(height = letter_height) { | |||
rotate([0,0,90]) translate ([0,0,5]) text("K", font=font, valign="center", halign="center", size =letter_size); | |||
} | |||
} // Union - kama bottom | |||
} | |||
rotate([0,0,90]) { | |||
translate([0,0,5]) { | |||
mirror([0,90,0]) { | |||
union() { // This union creates and positions the K symbol on the top of the coin. | |||
color("green") | |||
linear_extrude(height = letter_height) { | |||
rotate([0,0,90]) translate ([0,0,5]) text("K", font=font, valign="center", halign="center", size =letter_size); | |||
} | |||
} // Union - kama top | |||
} | |||
} | |||
} | |||
} | |||
</source> | </source> | ||
| [[Súbor:OpenSCAD-Example3.png|thumb|Minca do vozíka.]] | | [[Súbor:OpenSCAD-Example3.png|thumb|Minca do vozíka.]] |
Aktuálna revízia z 23:58, 11. marec 2019
Dištančné stĺpiky
translate([0,0,0])
stlpik(10);
translate([10,0,0])
stlpik(20);
translate([20,0,0])
stlpik(30);
module stlpik(length=10)
{
$fn=64;
difference()
{
cylinder(d=6, h=length);
translate([0,0,-1])
cylinder(d=3.2,h=length+2);
}
}
|
Držiak LED
$fn=48;
difference()
{
cylinder(r=3,h=20);
{
translate([2.54/2,0,0])
cylinder(r=0.2,h=21);
translate([-2.54/2,0,0])
cylinder(r=0.2,h=21);
translate([0,0,18])
cylinder(r=2.5,h=3);
}
}
|
Minca do vozíka
font = "Impact";
letter_size = 22;
letter_height = 1;
union()
{
difference() { // This builds the coin with recesses on each side.
cylinder(h=6, d=36);
translate ([0,0,-5.5]) { // making bottom brim
color("red") cylinder(h=6, d=31); // bottom of coin
}
translate ([0,0,5.5]) {
color("blue") cylinder(h=6, d=31); // top of coin
}
}
rotate([0,0,-90])
{
union() { // This union creates and positions the K symbol on the bottom of the coin.
color("cyan")
linear_extrude(height = letter_height) {
rotate([0,0,90]) translate ([0,0,5]) text("K", font=font, valign="center", halign="center", size =letter_size);
}
} // Union - kama bottom
}
rotate([0,0,90]) {
translate([0,0,5]) {
mirror([0,90,0]) {
union() { // This union creates and positions the K symbol on the top of the coin.
color("green")
linear_extrude(height = letter_height) {
rotate([0,0,90]) translate ([0,0,5]) text("K", font=font, valign="center", halign="center", size =letter_size);
}
} // Union - kama top
}
}
}
}
|