feedback: VDE-115 -- missing wall_thickness and undercut_detection APIs; DFM+mold modules need these for manufacturability analysis
CI / Build & Test (push) Failing after 24s
CI / Release Build (push) Failing after 35s
Build & Test / build-and-test (push) Has been cancelled
Build & Test / python-bindings (push) Has been cancelled

This commit is contained in:
2026-07-31 08:19:56 +08:00
parent 4ad6937d12
commit ecf141fe52
+146
View File
@@ -0,0 +1,146 @@
# VDE-115: VDE lacks wall thickness and undercut detection APIs; DFM module forced to manual geometry analysis
**Date**: 2026-07-31
**Severity**: High (DFM/mold design cannot use VDE for critical geometric checks)
**Status**: Submitted
## Summary
The DFM checker module (`src/vd_mfg_dfm/dfm_checker.cpp`, 1129 lines) implements
manufacturability analysis but cannot use VDE for two critical geometric analyses:
| Capability | VDE Status | Impact |
|-----------|-----------|--------|
| Wall thickness analysis | **Missing** | 200+ lines manual code |
| Undercut detection | **Missing** | 50+ lines manual code |
Both are fundamental to DFM, mold design, and die casting analysis.
Every major CAD platform provides these — we must request VDE to add them.
## Wall Thickness Analysis
### Manual Implementation in dfm_checker.cpp
`checkWallThickness()` / `checkWallThicknessFromShape()` (lines 395-470, 851-923) perform:
- Measure minimum wall thickness across the model
- Compare against material-specific thresholds
- Detect thin walls that would cause mold fill / structural issues
- Sample points on surfaces and measure thickness along normals
### Proposed VDE API
```cpp
// vde/brep/wall_thickness.h
namespace vde::brep {
enum class WallThicknessMethod {
RayCasting, // Shoot rays from face into body → find opposite face
MedialAxis, // Medial axis transform → skeleton-based distances
ClosestPoint // KD-tree nearest point on opposite side
};
struct WallThicknessParams {
WallThicknessMethod method = WallThicknessMethod::RayCasting;
int sample_density = 50; // samples per face in each param direction
double min_thickness = 0.5; // alert threshold (mm)
double max_thickness = 50.0; // max wall alert (sink marks)
};
struct WallThicknessPoint {
Point3D position;
Point3D opposite_point; // point on opposite face
double thickness;
int face_index;
bool below_threshold; // thinner than min_thickness
};
struct WallThicknessResult {
std::vector<WallThicknessPoint> samples;
double min_thickness;
double max_thickness;
double avg_thickness;
double stddev_thickness;
int thin_region_count; // number of thin regions
int thick_region_count;
AABB3D bounding_box;
};
[[nodiscard]] WallThicknessResult analyze_wall_thickness(
const BrepModel& body, const WallThicknessParams& params = {});
// Quick check: is minimum wall thickness >= required value?
[[nodiscard]] bool check_min_wall_thickness(
const BrepModel& body, double min_required_mm);
} // namespace vde::brep
```
## Undercut Detection
### Manual Implementation in dfm_checker.cpp
`checkUndercut()` (lines 427-456) performs:
- Check the model for undercut features that prevent straight-pull mold ejection
- Sample faces not visible from pull direction
### Proposed VDE API
```cpp
// vde/brep/undercut_detection.h
namespace vde::brep {
struct PullDirection {
Vector3D direction; // mold opening direction (typically Z+)
double tolerance = 0.01; // angular tolerance (radians)
};
enum class UndercutType {
External, // visible from outside, needs side-core/slider
Internal, // enclosed pocket, needs lifter/collapsible core
Thread, // threaded feature needs unscrewing core
SideHole // hole perpendicular to pull direction
};
struct UndercutRegion {
std::vector<int> face_indices;
double area;
UndercutType type;
Point3D centroid;
bool requires_side_action; // needs slider/lifter/hydraulic core
};
struct UndercutResult {
std::vector<UndercutRegion> regions;
bool is_moldable; // true if no undercuts or all solvable
bool requires_split_line; // parting line not planar
double external_undercut_area; // total area requiring side cores
double internal_undercut_area; // total area requiring lifters
std::string recommended_solution; // e.g., "Add 2 side cores + 1 lifter"
};
[[nodiscard]] UndercutResult detect_undercuts(
const BrepModel& body, const PullDirection& pull = {{0, 0, 1}});
// For multi-direction mold analysis
[[nodiscard]] UndercutResult detect_undercuts_multi_axis(
const BrepModel& body,
const std::vector<PullDirection>& axes);
} // namespace vde::brep
```
## Impact on ViewDesign
| Module | VDE Gap | Manual Workaround |
|--------|---------|-------------------|
| `dfm_checker.cpp` | No wall_thickness.h | Manual ray-casting against mesh |
| `dfm_checker.cpp` | No undercut_detection.h | Face normal check against pull direction |
| `mold_manager.cpp` | No undercut detection | Simplifies mold design analysis |
| `additive_manager.cpp` | No wall thickness | Can't auto-detect printability issues |
## Related
- VDE-091: Mold design (parting line, core/cavity)
- VDE-097: DFM analysis (this is the geometry backend for DFM rules)
- VDE-111: vd_geom integration gaps