16 ijk((local_index + 2) % 3) = p;
18 else if (local_index >= 3 && local_index < 3 * p)
20 int a = (local_index - 3) / (p - 1);
21 int b = (local_index - 3) % (p - 1);
23 ijk((a + 2) % 3) = p - b - 1;
27 int t0 = local_index - 3 * p + 1;
37 ijk(2) = p - ijk(0) - ijk(1);
83 int size = ((p + 3) * (p + 2) * (p + 1)) / 6;
86 val.topRows(4) << 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1;
89 for (
int i = 1; i < p; i++)
91 double x = i / (double)p;
93 val.row(i + 3 + (p - 1) * 0) <<
x, 0, 0;
94 val.row(i + 3 + (p - 1) * 1) <<
y,
x, 0;
95 val.row(i + 3 + (p - 1) * 2) << 0,
y, 0;
96 val.row(i + 3 + (p - 1) * 3) << 0, 0,
x;
97 val.row(i + 3 + (p - 1) * 4) <<
y, 0,
x;
98 val.row(i + 3 + (p - 1) * 5) << 0,
y,
x;
103 int start_id = 4 + 6 * (p - 1);
104 int n_face_nodes = ((p - 1) * (p - 2)) / 2;
105 for (
int i = 1, idx = 0; i < p; i++)
106 for (
int j = 1; i + j < p; j++)
108 double x = i / (double)p,
y = j / (
double)p;
109 double z = 1 -
x -
y;
110 val.row(start_id + idx + n_face_nodes * 0) <<
x,
y, 0;
111 val.row(start_id + idx + n_face_nodes * 1) <<
x, 0,
y;
112 val.row(start_id + idx + n_face_nodes * 2) <<
z,
x,
y;
113 val.row(start_id + idx + n_face_nodes * 3) << 0,
z,
y;
119 int start_id = 4 + 6 * (p - 1) + 2 * (p - 1) * (p - 2);
120 for (
int i = 1, idx = 0; i < p; i++)
121 for (
int j = 1; i + j < p; j++)
122 for (
int k = 1; i + j + k < p; k++)
124 val.row(start_id + idx) << i / (double)p, j / (
double)p, k / (double)p;
132 int size = (p + 1) * (p + 2) / 2;
135 val.topRows(3) << 0, 0, 1, 0, 0, 1;
138 for (
int i = 0; i < p - 1; i++)
140 val.row(i + 3) << (i + 1) /
double(p), 0;
141 val.row(i + p + 2) << 1.0 - (i + 1) /
double(p), (i + 1) /
double(p);
142 val.row(i + p * 2 + 1) << 0, 1.0 - (i + 1) /
double(p);
147 int inner_node_id = 3 * p;
148 for (
int i = 0; i < p - 2; i++)
149 for (
int j = 0; j < p - i - 2; j++)
151 val.row(inner_node_id) << (i + 1) /
double(p), (j + 1) /
double(p);
178 auto x = uv.col(0).array();
179 auto y = uv.col(1).array();
180 auto z = uv.col(2).array();
181 auto w = 1 -
x -
y -
z;
183 int i = round(
val(local_index, 0) * p), j = round(
val(local_index, 1) * p), k = round(
val(local_index, 2) * p);
184 int l = p - i - j - k;
185 val.resize(uv.rows(), uv.cols());
186 auto value_x =
P(i, p,
x), value_y =
P(j, p,
y), value_z =
P(k, p,
z);
187 auto value_w =
P(l, p, w), derivative_w =
P_prime(l, p, w);
188 val.col(0) = value_y * value_z * (
P_prime(i, p,
x) * value_w - value_x * derivative_w);
189 val.col(1) = value_x * value_z * (
P_prime(j, p,
y) * value_w - value_y * derivative_w);
190 val.col(2) = value_x * value_y * (
P_prime(k, p,
z) * value_w - value_z * derivative_w);