fix: more /* */ inside doxygen blocks in octree/boolean_mesh
CI / Build & Test (push) Failing after 1m31s
CI / Release Build (push) Failing after 31s

This commit is contained in:
茂之钳
2026-07-24 11:17:46 +00:00
parent 980cb32468
commit 089442fb69
4 changed files with 39 additions and 53 deletions
+32 -48
View File
@@ -143,7 +143,7 @@ NurbsCurve extract_boundary_curve(const NurbsSurface& surf, int edge) {
}
// ---------------------------------------------------------------------------
// offset a curve by moving its control points along surface normals
// offset a boundary curve along the surface tangent ("inward") direction
// ---------------------------------------------------------------------------
static NurbsCurve offset_boundary_curve(const NurbsSurface& surf,
int edge, double dist) {
@@ -159,59 +159,49 @@ static NurbsCurve offset_boundary_curve(const NurbsSurface& surf,
auto gu = greville_abscissae(ku, du);
auto gv = greville_abscissae(kv, dv);
// Negative normal = inward offset
double sign = -1.0;
std::vector<Point3D> curve_cp;
std::vector<double> curve_w;
std::vector<double> curve_knots;
int curve_deg;
if (edge == 0) { // u=0
curve_cp = cp[0];
curve_w = w.empty() ? std::vector<double>(nv, 1.0) : w[0];
if (edge == 0 || edge == 1) {
// u-edge: curve runs along v, offset along ±u tangent
double u_val = (edge == 0) ? gu[0] : gu[nu - 1];
double inward = (edge == 0) ? 1.0 : -1.0; // +du for umin, -du for umax
int idx = (edge == 0) ? 0 : nu - 1;
curve_cp = cp[idx];
curve_w = w.empty() ? std::vector<double>(nv, 1.0) : w[idx];
curve_knots = kv;
curve_deg = dv;
for (int j = 0; j < nv; ++j) {
Vector3D n = surf.normal(gu[0], gv[j]);
curve_cp[j] = Point3D(curve_cp[j].x() + sign * dist * n.x(),
curve_cp[j].y() + sign * dist * n.y(),
curve_cp[j].z() + sign * dist * n.z());
Vector3D tan = surf.derivative_u(u_val, gv[j]);
double len = tan.norm();
if (len > 1e-12) tan = (inward * dist / len) * tan;
else tan = Vector3D::Zero();
curve_cp[j] = Point3D(curve_cp[j].x() + tan.x(),
curve_cp[j].y() + tan.y(),
curve_cp[j].z() + tan.z());
}
} else if (edge == 1) { // u=1
curve_cp = cp[nu - 1];
curve_w = w.empty() ? std::vector<double>(nv, 1.0) : w[nu - 1];
curve_knots = kv;
curve_deg = dv;
for (int j = 0; j < nv; ++j) {
Vector3D n = surf.normal(gu[nu - 1], gv[j]);
curve_cp[j] = Point3D(curve_cp[j].x() + sign * dist * n.x(),
curve_cp[j].y() + sign * dist * n.y(),
curve_cp[j].z() + sign * dist * n.z());
}
} else if (edge == 2) { // v=0
} else {
// v-edge: curve runs along u, offset along ±v tangent
double v_val = (edge == 2) ? gv[0] : gv[nv - 1];
double inward = (edge == 2) ? 1.0 : -1.0; // +dv for vmin, -dv for vmax
int idx = (edge == 2) ? 0 : nv - 1;
curve_cp.reserve(nu);
curve_w.reserve(nu);
for (int i = 0; i < nu; ++i) {
Vector3D n = surf.normal(gu[i], gv[0]);
Point3D pt = cp[i][0];
curve_cp.push_back(Point3D(pt.x() + sign * dist * n.x(),
pt.y() + sign * dist * n.y(),
pt.z() + sign * dist * n.z()));
curve_w.push_back(w.empty() ? 1.0 : w[i][0]);
}
curve_knots = ku;
curve_deg = du;
} else { // v=1 (edge == 3)
curve_cp.reserve(nu);
curve_w.reserve(nu);
for (int i = 0; i < nu; ++i) {
Vector3D n = surf.normal(gu[i], gv[nv - 1]);
Point3D pt = cp[i][nv - 1];
curve_cp.push_back(Point3D(pt.x() + sign * dist * n.x(),
pt.y() + sign * dist * n.y(),
pt.z() + sign * dist * n.z()));
curve_w.push_back(w.empty() ? 1.0 : w[i][nv - 1]);
Vector3D tan = surf.derivative_v(gu[i], v_val);
double len = tan.norm();
if (len > 1e-12) tan = (inward * dist / len) * tan;
else tan = Vector3D::Zero();
Point3D pt = cp[i][idx];
curve_cp.push_back(Point3D(pt.x() + tan.x(),
pt.y() + tan.y(),
pt.z() + tan.z()));
curve_w.push_back(w.empty() ? 1.0 : w[i][idx]);
}
curve_knots = ku;
curve_deg = du;
@@ -283,12 +273,6 @@ NurbsSurface coons_patch(const NurbsCurve& curve_u0,
std::vector<std::vector<Point3D>> grid(nu, std::vector<Point3D>(nv));
std::vector<std::vector<double>> w(nu, std::vector<double>(nv, 1.0));
// Corners
Point3D P00 = curve_u0.evaluate(gu[0]); // u=0, v=0
Point3D P10 = curve_u0.evaluate(gu[nu - 1]); // u=1, v=0
Point3D P01 = curve_u1.evaluate(gu[0]); // u=0, v=1
Point3D P11 = curve_u1.evaluate(gu[nu - 1]); // u=1, v=1
// Edge control points (from boundary curves)
// u=0 edge: v0 curve CPs
// u=1 edge: v1 curve CPs