mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
smooth path
This commit is contained in:
@@ -3,8 +3,7 @@ include <arc_path.scad>;
|
|||||||
include <circle_path.scad>;
|
include <circle_path.scad>;
|
||||||
include <path_extrude.scad>;
|
include <path_extrude.scad>;
|
||||||
include <bezier_curve.scad>;
|
include <bezier_curve.scad>;
|
||||||
include <polyline2d.scad>;
|
include <hull_polyline2d.scad>;
|
||||||
include <line2d.scad>;
|
|
||||||
include <rotate_p.scad>;
|
include <rotate_p.scad>;
|
||||||
include <bspline_curve.scad>;
|
include <bspline_curve.scad>;
|
||||||
|
|
||||||
@@ -20,23 +19,22 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
|
|||||||
$fn = fn;
|
$fn = fn;
|
||||||
half_thickness = thickness / 2;
|
half_thickness = thickness / 2;
|
||||||
|
|
||||||
module bottom() {
|
module bottom() {
|
||||||
rotate(180)
|
rotate(180)
|
||||||
rotate_extrude() {
|
rotate_extrude() {
|
||||||
translate([radius1 + radius2, 0, 0])
|
ph1 = arc_path(radius = radius2, angle = [180, 360]);
|
||||||
polyline2d(
|
ph2 = bezier_curve(t_step, [
|
||||||
arc_path(radius = radius2, angle = [180, 360])
|
[radius1 + radius2 * 2, 0, 0],
|
||||||
,thickness
|
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
|
||||||
);
|
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
|
||||||
|
[radius1, bottom_height * 0.75, 0],
|
||||||
|
[radius1, bottom_height, 0]
|
||||||
|
]);
|
||||||
|
|
||||||
polyline2d(
|
path = concat([for(p = ph1) p + [radius1 + radius2, 0, 0]], ph2);
|
||||||
bezier_curve(t_step, [
|
|
||||||
[radius1 + radius2 * 2, 0, 0],
|
hull_polyline2d(
|
||||||
[radius1 + radius2 * 2, bottom_height * 0.25, 0],
|
path,
|
||||||
[radius1 + radius2 * 0.5, bottom_height * 0.5, 0],
|
|
||||||
[radius1, bottom_height * 0.75, 0],
|
|
||||||
[radius1, bottom_height, 0]
|
|
||||||
]),
|
|
||||||
thickness
|
thickness
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -80,13 +78,13 @@ module klein_bottle(radius1, radius2, bottom_height, thickness, t_step, fn) {
|
|||||||
union() {
|
union() {
|
||||||
bottom();
|
bottom();
|
||||||
|
|
||||||
path_extrude(
|
rotate(-90) path_extrude(
|
||||||
circle_path(radius1 + half_thickness),
|
circle_path(radius1 + half_thickness),
|
||||||
tube_path
|
tube_path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
path_extrude(
|
rotate(-90) path_extrude(
|
||||||
circle_path(radius1 - half_thickness),
|
circle_path(radius1 - half_thickness),
|
||||||
tube_path2
|
tube_path2
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user