35 const int edges_num = verts_num == 2 ? 1 : verts_num < 2 ? 0 : loops_num / 2;
41 mesh, verts_num, edges_num, 0, loops_num, faces_num);
49 for (
const int i : IndexRange(verts_num)) {
54 if (original_index >= 0 && original_index < coords.
size()) {
57 if (
mesh && original_index < mesh->totvert) {
74 Array<MLoop> mloop_src(loops_num);
76 for (
const int i : IndexRange(loops_num)) {
81 mloop_src[i].v = (
uint)v_from;
91 mloop_src[i].e = edge_index;
92 mloop_src[reverse_index].e = edge_index;
110 for (
const int i : IndexRange(faces_num)) {
116 loops.reinitialize(
len);
122 for (
const int k : IndexRange(
len)) {
123 MLoop &src_loop = mloop_src[loops[k]];
124 loop->
v = src_loop.
v;
125 loop->
e = src_loop.
e;
141 Span<float3> positions_span;
149 positions_span =
positions.get_internal_span();
162 positions_span =
positions.get_internal_span();
172 positions_span =
curves.evaluated_positions();
173 total_num += positions_span.size();
182 if (span_count == 1 &&
count == 1) {
183 return hull_from_bullet(
nullptr, positions_span);
190 if (
const VArray<float3> varray =
component->attributes()->lookup<
float3>(
"position",
192 varray.materialize(
positions.as_mutable_span().slice(
offset, varray.size()));
199 if (
const VArray<float3> varray =
component->attributes()->lookup<
float3>(
"position",
201 varray.materialize(
positions.as_mutable_span().slice(
offset, varray.size()));
225 Mesh *
mesh = compute_hull(geometry_set);
230 params.set_output(
"Convex Hull", std::move(geometry_set));
232 params.error_message_add(NodeWarningType::Error,
233 TIP_(
"Disabled, Blender was compiled without Bullet"));
234 params.set_default_remaining_outputs();
Low-level operations for curves.
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
@ GEO_COMPONENT_TYPE_MESH
General operations, lookup, etc. for materials.
void BKE_id_material_eval_ensure_default_slot(struct ID *id)
struct Mesh * BKE_mesh_new_nomain_from_template(const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
#define GEO_NODE_CONVEX_HULL
#define BLI_assert_msg(a, msg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
static uint8 component(Color32 c, uint i)
struct CurvesGeometry CurvesGeometry
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
constexpr const T * data() const
constexpr int64_t size() const
static CurvesGeometry & wrap(::CurvesGeometry &dna_struct)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_convex_hull()
MutableSpan< float3 > positions
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
int plConvexHullGetFaceSize(plConvexHull hull, int n)
int plConvexHullNumLoops(plConvexHull hull)
void plConvexHullGetVertex(plConvexHull hull, int n, float coords[3], int *original_index)
void plConvexHullGetLoop(plConvexHull hull, int n, int *v_from, int *v_to)
int plConvexHullNumVertices(plConvexHull hull)
int plConvexHullGetReversedLoopIndex(plConvexHull hull, int n)
plConvexHull plConvexHullCompute(float(*coords)[3], int count)
void plConvexHullDelete(plConvexHull hull)
void plConvexHullGetFaceLoops(plConvexHull hull, int n, int *loops)
int plConvexHullNumFaces(plConvexHull hull)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only_during_modify(const blender::Span< GeometryComponentType > component_types)
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
const Mesh * get_mesh_for_read() const
const Curves * get_curves_for_read() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare