30 .description(
"Number of vertices on the circle");
35 .description(
"Distance of the vertices from the origin");
52 node->storage = node_storage;
133 const float angle_delta = 2.0f * (
M_PI /
float(verts_num));
135 const float angle = i * angle_delta;
136 positions[i] =
float3(std::cos(
angle) * radius, std::sin(
angle) * radius, 0.0f);
144 int2 &edge = edges[i];
146 edge[1] = (i + 1) % verts_num;
152 int2 &edge = edges[verts_num + i];
160 face_offsets.
first() = 0;
161 face_offsets.
last() = corner_verts.
size();
166 mesh->tag_loose_edges_none();
170 face_offsets[i] = 3 * i;
173 corner_verts[3 * i] = i;
174 corner_edges[3 * i] = i;
176 corner_verts[3 * i + 1] = (i + 1) % verts_num;
177 corner_edges[3 * i + 1] = verts_num + ((i + 1) % verts_num);
179 corner_verts[3 * i + 2] = verts_num;
180 corner_edges[3 * i + 2] = verts_num + i;
184 mesh->tag_loose_verts_none();
185 mesh->tag_overlapping_none();
196 const float radius = params.
extract_input<
float>(
"Radius"_ustr);
197 const int verts_num = params.
extract_input<
int>(
"Vertices"_ustr);
General operations, lookup, etc. for materials.
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_MESH_PRIMITIVE_CIRCLE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
#define BLI_assert_unreachable()
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
constexpr IndexRange()=default
constexpr int64_t size() const
constexpr T & first() const
constexpr IndexRange index_range() const
constexpr T & last(const int64_t n=0) const
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
const bNode & node() const
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
#define storage(slot, qualifiers)
void fill_index_range(MutableSpan< T > span, const T start=0)
void node_register_type(bNodeType &ntype)
void mesh_smooth_set(Mesh &mesh, bool use_smooth, bool keep_sharp_edges=false)
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))
Bounds< float3 > calculate_bounds_radial_primitive(float radius_top, float radius_bottom, int segments, float height)
static void node_geo_exec(GeoNodeExecParams params)
static int circle_edge_total(const GeometryNodeMeshCircleFillType fill_type, const int verts_num)
static int circle_corner_total(const GeometryNodeMeshCircleFillType fill_type, const int verts_num)
static void node_rna(StructRNA *srna)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static int circle_vert_total(const GeometryNodeMeshCircleFillType fill_type, const int verts_num)
static void node_init(bNodeTree *, bNode *node)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static Mesh * create_circle_mesh(const float radius, const int verts_num, const GeometryNodeMeshCircleFillType fill_type)
static int circle_face_total(const GeometryNodeMeshCircleFillType fill_type, const int verts_num)
static Bounds< float3 > calculate_bounds_circle(const float radius, const int verts_num)
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< int32_t, 2 > int2
Mesh * BKE_mesh_new_nomain(int verts_num, int edges_num, int faces_num, int corners_num)
void BKE_id_material_eval_ensure_default_slot(ID *id)
const EnumPropertyItem rna_enum_node_geometry_mesh_circle_fill_type_items[]
GeometryNodeMeshCircleFillType
@ GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN
@ GEO_NODE_MESH_CIRCLE_FILL_NONE
@ GEO_NODE_MESH_CIRCLE_FILL_NGON
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
GeometryNodeMeshCircleFillType fill_type
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)