21 "The distance a point can be from the surface before the face is no longer "
34 :
bke::MeshFieldInput(
CPPType::get<bool>(),
"Planar"), threshold_(threshold)
45 const Span<int> corner_verts = mesh.corner_verts();
50 evaluator.
add(threshold_);
55 [positions,
faces, corner_verts, thresholds, face_normals](
const int i) ->
bool {
57 if (face.
size() <= 3) {
60 const float3 &reference_normal = face_normals[i];
65 for (
const int vert : corner_verts.
slice(face)) {
66 float dot =
math::dot(reference_normal, positions[vert]);
74 return max -
min < thresholds[i] / 2.0f;
77 return mesh.attributes().adapt_domain<
bool>(
83 threshold_.node().for_each_field_input_recursive(
fn);
99 return AttrDomain::Face;
106 Field<bool> planar_field{std::make_shared<PlanarFieldInput>(threshold)};
107 params.set_output(
"Planar", std::move(planar_field));
#define GEO_NODE_INPUT_MESH_FACE_IS_PLANAR
#define BLT_I18NCONTEXT_ID_NODETREE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr int64_t size() const
constexpr Span slice(int64_t start, int64_t size) const
static VArray ForFunc(const int64_t size, GetFunc get_func)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
unsigned __int64 uint64_t
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare