logarithmic spiral

This commit is contained in:
0SlowPoke0
2025-06-30 17:27:25 +05:30
parent 2b819c11b9
commit b8edd8aa4b
2 changed files with 79 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ fn arc(
}
#[node_macro::node(category("Vector: Shape"))]
fn spiral(
fn archimedean_spiral(
_: impl Ctx,
_primary: (),
#[default(1.)] inner_radius: f64,
@@ -88,6 +88,26 @@ fn spiral(
)))
}
#[node_macro::node(category("Vector: Shape"))]
fn logarithmic_spiral(
_: impl Ctx,
_primary: (),
#[range((0.1, 1.))]
#[default(0.5)]
start_radius: f64,
#[range((0.1, 1.))]
#[default(0.2)]
growth: f64,
#[default(3)]
#[hard_min(0.5)]
turns: f64,
#[default(45.)]
#[range((1., 180.))]
angle_offset: f64,
) -> VectorDataTable {
VectorDataTable::new(VectorData::from_subpath(Subpath::generate_logarithmic_spiral(start_radius, growth, turns, angle_offset.to_radians())))
}
#[node_macro::node(category("Vector: Shape"))]
fn ellipse(_: impl Ctx, _primary: (), #[default(50)] radius_x: f64, #[default(25)] radius_y: f64) -> VectorDataTable {
let radius = DVec2::new(radius_x, radius_y);