35 .default_value({-1.0f, 0.0f, 0.0f})
38 "One of the three points on the circle. The point order determines the "
40 .make_available(endable_points);
42 .default_value({0.0f, 1.0f, 0.0f})
45 "One of the three points on the circle. The point order determines the "
47 .make_available(endable_points);
49 .default_value({1.0f, 0.0f, 0.0f})
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);
62 auto ¢er =
b.add_output<
decl::Vector>(
"Center").make_available(endable_points);
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];
136 curves.cyclic_for_write().first() =
true;
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;
162 curves.cyclic_for_write().first() =
true;
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);
171 positions[i] =
float3(x, y, 0.0f);
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",
238 "NodeGeometryCurvePrimitiveCircle",
Low-level operations for curves.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
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)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
local_group_size(16, 16) .push_constant(Type b
ccl_device_inline float3 cos(float3 v)
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
Curves * curves_new_nomain_single(int points_num, CurveType type)
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, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
static GeometrySet from_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare