18 .description(
"Number of points in one rotation of the spiral");
22 .
description(
"Number of times the spiral makes a full rotation")
27 .description(
"Horizontal Distance from the Z axis at the start of the spiral");
31 .description(
"Horizontal Distance from the Z axis at the end of the spiral");
35 .description(
"The height perpendicular to the base of the spiral");
37 "Switch the direction from clockwise to counterclockwise");
43 const float start_radius,
44 const float end_radius,
48 const int totalpoints = std::max(
int(resolution * rotations), 1);
49 const float delta_radius = (end_radius - start_radius) /
float(totalpoints);
50 const float delta_height = height / float(totalpoints);
51 const float delta_theta = (
M_PI * 2 * rotations) /
float(totalpoints) *
52 (direction ? 1.0f : -1.0f);
60 const float theta =
i * delta_theta;
61 const float radius = start_radius +
i * delta_radius;
62 const float x = radius *
cos(theta);
63 const float y = radius *
sin(theta);
64 const float z = delta_height *
i;
66 positions[
i] = {
x,
y,
z};
74 const float rotations = std::max(params.
extract_input<
float>(
"Rotations"), 0.0f);
75 if (rotations == 0.0f) {
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_PRIMITIVE_SPIRAL
#define BLT_I18NCONTEXT_ID_NODETREE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
constexpr IndexRange()=default
MutableSpan< float3 > positions_for_write()
T extract_input(StringRef identifier)
void set_output(StringRef identifier, T &&value)
void set_default_remaining_outputs()
void node_register_type(bNodeType &ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
static Curves * create_spiral_curve(const float rotations, const int resolution, const float start_radius, const float end_radius, const float height, const bool direction)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)