21 .structure_type(StructureType::Field)
23 "The distance a point can be from the surface before the face is no longer "
51 evaluator.
add(threshold_);
56 [positions, faces, corner_verts, thresholds, face_normals](
const int i) ->
bool {
58 if (face.
size() <= 3) {
61 const float3 &reference_normal = face_normals[i];
66 for (
const int vert : corner_verts.
slice(face)) {
67 float dot =
math::dot(reference_normal, positions[vert]);
71 return max -
min < thresholds[i] / 2.0f;
74 return mesh.attributes().adapt_domain<
bool>(
85 static constexpr int8_t id = 0;
92 return AttrDomain::Face;
113 ntype.
ui_name =
"Is Face Planar";
115 "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 from_func(const int64_t size, GetFunc get_func)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
static Field from_input(Args &&...args)
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
StructureType structure_type
float dot(VecOp< float, D >, VecOp< float, D >) RET
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(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
UniqueHash ensure(const GFieldRef &field)