3d/models/candle/candle.scad

155 lines
3.5 KiB
OpenSCAD
Raw Normal View History

2024-12-09 14:54:10 +03:00
include <../../lib/ub.scad>;
2024-12-07 04:41:19 +03:00
2024-12-09 14:54:10 +03:00
/*[Hidden]*/
designVersion="1.0";
designer="Andey Belvedersky";
2024-12-07 04:41:19 +03:00
2024-12-09 14:54:10 +03:00
useVersion=24.260;
assert(Version>=useVersion,str("lib version ",Version," detected, install ",useVersion," ub.scad library‼ ⇒http://v.gd/ubaer"));
2024-12-07 04:41:19 +03:00
2024-12-09 14:54:10 +03:00
license="CC0";
/*[Basics]*/
nozzle=.2;
bed=true;
pPos=[0,0];
info=true;
name=undef;
// Parameters for the snake-like candle
snake_length = 50; // Length of the candle
snake_radius = 20; // Base radius of the candle
twist_amount = 20; // Amount of twist in the snake shape
height_variation = 6; // Variation in height to create a snake-like effect
//
WaveEx(
grad=0,
h=snake_length,
r=snake_radius,
ry=twist_amount,
f=3,
fy=height_variation, // 😃
a=0,
ay=1.3, //
fv=1.4,
fvy=4,
tf=5,
trx=0,
try=0,
tfy=3.2,
tfv=6,
tfvy=10,
ta=1.5,
tay=1.7,
fn=150,
fn2=150,
rot=0,
scale=1,
scaley=1,
close=false,
p=4,
name=undef,
help=1
);
hull() {
hull() {
hull() {
sphere(d=20);
translate([0,0,50]){
minkowski() {
sphere(r = 20, d=20, $fn=5);
cylinder(r=2,h=1, center=true);
}
}
}
translate([10,10,25]){
rotate([10,80,40])
minkowski() {
sphere(d=20, $fn=5);
cylinder(r=2,h=1, center=true);
}
}
}
translate([-10,-10,25]){
rotate([10,30,40])
minkowski() {
OctaH(help=true, d=20);
cylinder(r=2,h=1, $fn=50);
}
}
}
// Spirale(help=1, grad=10, radius=0, exp=1, fn=2)Linse( messpunkt=false);
// Rundrum(fn=40, grad=40, r=3, twist=1, x=25, y=10, r=195)Linse(help=1, dia=12, r=6.5, messpunkt=false);
// Spirale(help=1, grad=200, radius=0, exp=1, fn=170);
// // Parameters for the snake scales
// scale_length = 10; // Base length of each scale
// scale_width = 6; // Base width of each scale
// scale_height = 2; // Base height of each scale
// scale_spacing = 0.2; // Base spacing between scales
// scale_rows = 3; // Number of rows of scales
// scale_columns = 6; // Number of columns of scales
// // Function to create a single scale with limited randomness
// module scale() {
// // Randomize scale dimensions and rotation with less variation
// l = scale_length + rands(-1, 1, 1)[0]; // Limited random length variation
// w = scale_width + rands(-0.5, 0.5, 1)[0]; // Limited random width variation
// h = scale_height + rands(-0.2, 0.2, 1)[0]; // Limited random height variation
// rot = rands(-10, 10, -10)[0]; // Limited random rotation
// color("darkgreen") {
// // Create a scale shape using a rounded rectangle
// linear_extrude(height=h) {
// rotate(rot) {
// Linse(help=1, dia=12, r=6.5, messpunkt=false);
// }
// }
// }
// }
// // Function to create a row of scales with limited randomness
// module scale_row(y_offset) {
// for (i = [0:scale_columns - 1]) {
// // Randomize the position of each scale with limited variation
// x_offset = i * (scale_length - scale_width + scale_spacing) + rands(-0.5, 0.5, 1)[0];
// translate([x_offset, y_offset, 0]) {
// scale();
// }
// }
// }
// // Function to create the snake scale pattern with limited randomness
// module snake_scale_pattern() {
// for (j = [0:scale_rows - 1]) {
// // Randomize the vertical position of each row with limited variation
// y_offset = j * (scale_width + scale_spacing);
// translate([0, y_offset, 0]) {
// scale_row(j * (scale_width + scale_spacing));
// }
// }
// }
// // Create the snake scale pattern
// snake_scale_pattern();
render();