@@ -66,6 +66,29 @@ struct Manifold::Impl {
66
66
const std::vector<float >& propertyTolerance = {},
67
67
bool hasFaceIDs = false );
68
68
69
+ inline void ForVert (int halfedge, std::function<void (int halfedge)> func) {
70
+ int current = halfedge;
71
+ do {
72
+ func (current);
73
+ current = NextHalfedge (halfedge_[current].pairedHalfedge );
74
+ } while (current != halfedge);
75
+ }
76
+
77
+ template <typename T>
78
+ void ForVert (int halfedge, std::function<T(int halfedge)> transform,
79
+ std::function<void(int halfedge, const T& here, const T& next)>
80
+ binaryOp) {
81
+ T here = transform (halfedge);
82
+ int current = halfedge;
83
+ do {
84
+ const int nextHalfedge = NextHalfedge (halfedge_[current].pairedHalfedge );
85
+ const T next = transform (nextHalfedge);
86
+ binaryOp (current, here, next);
87
+ here = next;
88
+ current = nextHalfedge;
89
+ } while (current != halfedge);
90
+ }
91
+
69
92
void CreateFaces (const std::vector<float >& propertyTolerance = {});
70
93
void RemoveUnreferencedVerts (Vec<glm::ivec3>& triVerts);
71
94
void InitializeOriginal ();
@@ -137,13 +160,15 @@ struct Manifold::Impl {
137
160
void SplitPinchedVerts ();
138
161
139
162
// smoothing.cu
163
+ glm::vec3 GetNormal (int halfedge, int normalIdx) const ;
140
164
std::vector<Smoothness> UpdateSharpenedEdges (
141
165
const std::vector<Smoothness>&) const ;
142
166
Vec<bool > FlatFaces () const ;
143
167
Vec<int > VertFlatFace (const Vec<bool >&) const ;
144
168
std::vector<Smoothness> SharpenEdges (float minSharpAngle,
145
169
float minSmoothness) const ;
146
170
void SetNormals (int normalIdx, float minSharpAngle);
171
+ void CreateTangents (int normalIdx);
147
172
void CreateTangents (std::vector<Smoothness>);
148
173
Vec<Barycentric> Subdivide (std::function<int (glm::vec3)>);
149
174
void Refine (std::function<int (glm::vec3)>);
0 commit comments