22 auto endable_points = [](
bNode &node) {
25 auto enable_radius = [](
bNode &node) {
33 .description(
"Number of points on the circle");
38 "One of the three points on the circle. The point order determines the "
40 .make_available(endable_points);
45 "One of the three points on the circle. The point order determines the "
47 .make_available(endable_points);
52 "One of the three points on the circle. The point order determines the "
54 .make_available(endable_points);
59 .description(
"Distance of the points from the origin")
60 .make_available(enable_radius);
64 const bNode *node =
b.node_or_null();
65 if (node !=
nullptr) {
96 return ELEM(a,
b,
b * -1.0f);
123 float plane_1[4], plane_2[4], plane_3[4];
142 const float theta_step = ((2 *
M_PI) /
float(resolution));
150 const float theta = theta_step *
i;
151 positions[
i] = center + r *
sin(theta) * v1 + r *
cos(theta) * v4;
166 const float theta_step = (2.0f *
M_PI) /
float(resolution);
168 const float theta = theta_step *
i;
169 const float x = radius *
cos(theta);
170 const float y = radius *
sin(theta);
189 std::max(
params.extract_input<
int>(
"Resolution"), 3),
191 params.set_output(
"Center", center_point);
195 params.extract_input<
float>(
"Radius"));
202 params.set_default_remaining_outputs();
213 "Define the radius and location with three points"},
218 "Define the radius with a float"},
219 {0,
nullptr, 0,
nullptr,
nullptr},
225 "Method used to determine radius and placement",
235 ntype.
ui_name =
"Curve Circle";
241 "NodeGeometryCurvePrimitiveCircle",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_PRIMITIVE_CIRCLE
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
bool isect_plane_plane_plane_v3(const float plane_a[4], const float plane_b[4], const float plane_c[4], float r_isect_co[3]) ATTR_WARN_UNUSED_RESULT
GeometryNodeCurvePrimitiveCircleMode
@ GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_RADIUS
@ GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_POINTS
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v2
constexpr T & first() const
MutableSpan< float3 > positions_for_write()
MutableSpan< bool > cyclic_for_write()
void make_available(bNode &node) const
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
T distance(const T &a, const T &b)
AxisSigned cross(const AxisSigned a, const AxisSigned b)
T interpolate(const T &a, const T &b, const FactorT &t)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
static void node_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
static Curves * create_radius_circle_curve(const int resolution, const float radius)
static void node_register()
static Curves * create_point_circle_curve(const float3 p1, const float3 p2, const float3 p3, const int resolution, float3 &r_center)
static void node_rna(StructRNA *srna)
static bool colinear_f3_f3_f3(const float3 p1, const float3 p2, const float3 p3)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)