18 .description(
"Number of points on each of the circles");
23 .description(
"Radius of the inner circle; can be larger than outer radius");
28 .description(
"Radius of the outer circle; can be smaller than inner radius");
31 .
description(
"The counterclockwise rotation of the inner set of points");
35 .
description(
"An attribute field with a selection of the outer points");
39 const float outer_radius,
45 curves.cyclic_for_write().first() =
true;
49 const float theta_step = (2.0f *
M_PI) /
float(points);
51 const float x = outer_radius *
cos(theta_step * i);
52 const float y = outer_radius * sin(theta_step * i);
53 positions[i * 2] = {
x,
y, 0.0f};
55 const float inner_x = inner_radius *
cos(theta_step * i + theta_step * 0.5f + twist);
56 const float inner_y = inner_radius * sin(theta_step * i + theta_step * 0.5f + twist);
57 positions[i * 2 + 1] = {inner_x, inner_y, 0.0f};
68 for (
int i : selection.span.index_range()) {
69 selection.span[i] = i % 2 == 0;
77 std::max(
params.extract_input<
float>(
"Outer Radius"), 0.0f),
78 params.extract_input<
float>(
"Twist"),
79 std::max(
params.extract_input<
int>(
"Points"), 3));
82 if (std::optional<std::string> outer_points_id =
83 params.get_output_anonymous_attribute_id_if_needed(
"Outer Points"))
87 params.set_output(
"Curve", std::move(output));
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
std::optional< MutableAttributeAccessor > attributes_for_write() final
local_group_size(16, 16) .push_constant(Type b
ccl_device_inline float3 cos(float3 v)
void node_register_type(bNodeType *ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
static void node_geo_exec(GeoNodeExecParams params)
static void create_selection_output(CurveComponent &component, const StringRef &r_attribute)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static Curves * create_star_curve(const float inner_radius, const float outer_radius, const float twist, const int points)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare