23 "The distance a point can be from the surface before the face is no longer "
36 : bke::MeshFieldInput(
CPPType::get<bool>(),
"Planar"), threshold_(threshold)
42 const AttrDomain domain,
52 evaluator.add(threshold_);
54 const VArray<float> thresholds = evaluator.get_evaluated<
float>(0);
57 [positions,
faces, corner_verts, thresholds, face_normals](
const int i) ->
bool {
59 if (face.
size() <= 3) {
62 const float3 &reference_normal = face_normals[i];
67 for (
const int vert : corner_verts.
slice(face)) {
68 float dot =
math::dot(reference_normal, positions[vert]);
72 return max -
min < thresholds[i] / 2.0f;
97 return AttrDomain::Face;
104 Field<bool> planar_field{std::make_shared<PlanarFieldInput>(threshold)};
105 params.set_output(
"Planar", std::move(planar_field));
114 ntype.
ui_name =
"Is Face Planar";
116 "Retrieve whether all triangles in a face are on the same plane, i.e. whether they have the "
#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)
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() const
dot(value.rgb, luminance_coefficients)") DEFINE_VALUE("REDUCE(lhs
void node_register_type(bNodeType &ntype)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
unsigned __int64 uint64_t
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare