Commit Graph

307 Commits

Author SHA1 Message Date
b38194c4d9 test: add rib profile test JSONs for sandbox_1 (64 pockets) and sandbox_2 (9 pockets) 2026-02-17 01:54:48 +00:00
634bf611c9 fix: remove stale chord_tol_mm kwarg from main() 2026-02-17 01:49:24 +00:00
612a21f561 feat(adaptive-isogrid): preserve arcs as typed segments instead of polyline discretization
Schema v2.0: outer_boundary is now a list of typed segments:
  - {type: 'line', start: [x,y], end: [x,y]}
  - {type: 'arc', start: [x,y], end: [x,y], center: [x,y], radius: R, clockwise: bool}

Extract: detect arcs via UF Eval.IsArc/AskArc, output exact geometry.
Import: create NX sketch arcs (3-point) for arc segments, backward-compatible with v1.0 polylines.
2026-02-17 01:47:36 +00:00
abc7d5f013 fix(extract): increase chord tolerance to 1mm, cap at 500 pts/edge
0.1mm was generating thousands of unnecessary points on straight
edges. Now: 1mm default, 0.5mm minimum, 500 max per edge.
Curves still get proper sampling, straight edges stay lean.
2026-02-17 01:40:55 +00:00
c3125b458b Add taskboard CLI tool for kanban orchestration (Phase 1 of plan 13) 2026-02-17 01:39:33 +00:00
cd7f7e8aa9 fix(extract): use EvaluateUnitVectors for parametric edge sampling
Available NXOpen.UF.Eval methods discovered:
- EvaluateUnitVectors(evaluator, t) - parametric point+tangent
- AskArc(evaluator) - arc center/radius for circular edges
- Initialize2, AskLimits, Free - evaluator lifecycle

Also logs arc data attributes for debugging.
2026-02-17 01:36:25 +00:00
fbdafb9a37 fix(extract): discover UF curve eval methods dynamically
NXOpen Python wraps UF methods with version-specific names.
Now dumps available methods on UF.Modl, UF.Eval, UF.Curve
and tries them in order. Detailed logging shows which method
was found and used, plus raw result format on parse failures.
2026-02-17 01:33:39 +00:00
fc1c1dc142 fix(extract): use UF_MODL_ask_curve_props instead of UF_EVAL
UF_EVAL.Evaluate() doesn't exist in NXOpen Python.
UF_MODL.AskCurveProps(tag, param) uses normalized 0-1
parameter and returns (point, tangent, normal, binormal,
torsion, radius). Works on all edge types.
2026-02-17 01:31:29 +00:00
97fe055b8d Add plan 13: Taskboard/Kanban Dynamic Project Orchestration 2026-02-17 01:27:54 +00:00
89e0ffbbf2 Fix NX curved edge sampling with robust UF_EVAL parsing 2026-02-17 01:24:55 +00:00
20d035205a fix(extrude): start extend negative for symmetric extrude 2026-02-17 01:16:36 +00:00
e6f98ac921 feat(extrude): symmetric extrude using part expression
- Uses ISOGRID_RIB_sandbox_N_thk expression for thickness
- Creates expression if missing, uses existing if present
- Symmetric extrude: ±thk/2 from sketch plane
- Fallback to literal value if expression fails
2026-02-17 01:12:16 +00:00
9a5f086684 fix(extrude): robust section creation with multi-approach fallback
- Create section explicitly if builder.Section returns None
- Try 3 approaches for adding curves: CreateRuleCurveFeature,
  CreateRuleCurveDumb with options, CreateRuleCurveDumb without
- Detailed step-by-step logging for debugging
- Get help point from first sketch curve for section seeding
2026-02-17 00:59:37 +00:00
070a211c69 fix(nxopen): simplify sketch extrude and correct rule/builder APIs 2026-02-17 00:55:36 +00:00
4c3457c17c fix: add missing NXOpen.Features and NXOpen.GeometricUtilities imports
NXOpen submodules must be imported explicitly in NX's Python
environment - they're not accessible as attributes of the
parent module.
2026-02-17 00:46:50 +00:00
ecba40f189 feat(import_profile): auto-extrude after sketch creation
Full cycle now automated:
1. Delete old extrude (if exists)
2. Delete old sketch (try ReplaceFeatureBuilder first, fallback to delete)
3. Create new sketch with rib geometry
4. Extrude new sketch by rib thickness along face normal
5. Name both features for identification on next iteration

Rib thickness read from profile JSON (parameters_used.thickness)
with fallback to geometry JSON or default 10mm.

No more manual extrude step needed between iterations.
2026-02-17 00:40:00 +00:00
515eef145f feat(import_profile): use ReplaceFeatureBuilder for sketch replacement
Replaces naive ReplaceEntity approach with NX's proper
ReplaceFeatureBuilder API. This mirrors the interactive
right-click → Replace Feature workflow:

- SelectFeature: old sketch to replace
- ReplacementFeature: new sketch taking over
- DoAutomaticGeomMatch: auto-maps curves
- DeleteOriginalFeature: removes old after remap
- Fallback: manual delete if builder fails

All downstream features (extrude, trim) automatically
re-reference the new sketch.
2026-02-16 23:36:14 +00:00
c4d98ee97c Importer: rename sketch feature + replace/delete old sketch on update 2026-02-16 22:00:18 +00:00
1bfc747cf9 Fix importer: always create new sketch + generate sandbox 2 rib profile (11 pockets) 2026-02-16 21:49:07 +00:00
c5226084fe Generate sandbox 2 rib profile (11 pockets, validated) 2026-02-16 21:33:58 +00:00
98e4b2be02 Add sandbox 2 rib profile geometry 2026-02-16 21:27:27 +00:00
379801c8aa demo: cantilever scenario ready for NX test (52 pockets, 343 entities)
rib_profile_sandbox_1.json now contains the cantilever demo profile.
Also includes 4 demo scenarios with density heatmaps + profiles.
2026-02-16 21:15:09 +00:00
1021f57abc fix(pockets): skip pocketing in high-density zones (eta > eta_solid)
High density (η > 0.7) means high stress → leave solid, no pocket.
Only low-density regions get lightweighted.

Scenario comparison with s_min=30, s_max=70:
- Baseline uniform (w=0.5): 78 pockets, 2886g
- Bottom-right heavy: 41 pockets, 3516g (bottom stays solid)
- Left-side mount: 27 pockets, 3799g (left stays solid)
- Center pressure: 15 pockets, 4295g (center stays solid)
2026-02-16 21:05:56 +00:00
4f051aa7e1 refactor(triangulation): hex grid isogrid layout replaces constrained Delaunay
Complete rewrite of triangulation engine:
- Regular hexagonal-packed vertex grid (equilateral triangles)
- Density-adaptive refinement: denser near holes, coarser in open areas
- Boundary-conforming vertices along frame edge and hole keepouts
- Delaunay on point set + clip to valid region (inside frame, outside keepouts)
- Result: proper isogrid layout, 87 pockets from 234 triangles
- 553 NX entities, min fillet 4.89mm, mass 2770g
- No more dependency on Shewchuk Triangle library (scipy.spatial.Delaunay)
2026-02-16 20:58:05 +00:00
239e2f01a9 tune(brain): uniform triangulation + bigger spacing for r_f=6mm fillets
- Switched to uniform triangulation (no density-adaptive refinement for
  initial pass — saves that for stress-informed iterations)
- s_min=45mm, s_max=55mm (was 12/35) — larger triangles fit 6mm fillets
- Boss keepout circles: 12 segments (was 32) — less boundary clutter
- Fillet must be >= 80% of r_f at every corner or pocket is skipped
- Result: 75 pockets, 481 NX entities, min fillet 4.85mm, mass 4066g
- adaptive_density=True param enables density refinement for future stress iterations
2026-02-16 20:51:20 +00:00
30981fa066 fix(brain): enforce r_f=6mm minimum, reject pockets that can't fit fillets
- Default r_f raised from 1.5mm to 6mm (machining constraint)
- Default min_pocket_radius raised to 6mm
- Pockets that can't fit r_f at any corner (within 80% tolerance) are
  skipped entirely — left solid for more stiffness in tight areas
- Result: 26 pockets (was 432), 187 NX entities (was 13,061)
- Min fillet radius: 4.88mm, all >= 4.8mm (80% of 6mm)
- Mass: 4,601g (was 3,480g — more solid = heavier but manufacturable)
2026-02-16 20:42:46 +00:00
da9b579bcf refactor(brain): structured pocket output — 3 lines + 3 arcs per pocket
Replaced Shapely buffer-based fillet (59-pt polylines) with exact geometric
fillet computation. Each pocket now outputs:
- 3 straight edges (line start/end pairs)
- 3 fillet arcs (center, radius, tangent points, angles)

NX import updated to use SketchLineBuilder + SketchArcBuilder (3-point).
Total NX entities: ~2,600 (was ~13,000). Includes arc fallback to 2-line
segments if SketchArcBuilder fails.

Also outputs circular hole definitions for future NX circle creation.
2026-02-16 20:17:49 +00:00
fdcafe96a9 fix(import): use SketchLineBuilder instead of model curves + AddGeometry
Model curves (part.Curves.CreateLine) are SmartObjects that can't be added
to a sketch via AddGeometry. Switch to SketchLineBuilder which creates
native sketch geometry directly (SetStartPoint/SetEndPoint/Commit).
2026-02-16 20:02:11 +00:00
fbdbf6b362 fix(import): use Sketch.InferConstraintsOption enum (nested under NXOpen.Sketch, not NXOpen) 2026-02-16 19:56:31 +00:00
4e0c9cd24d fix: correct enum names from MCP - InferNoConstraints, TreatAsEllipse, UpdateLevel.Model runtime resolve 2026-02-16 19:50:24 +00:00
c93239c9c6 fix: strip closing duplicate points in triangulation (segfault fix), batch line creation for NX speed, 6mm endmill params 2026-02-16 19:29:41 +00:00
61dcefb5ea fix: resolve ViewReorient/UpdateLevel enum at runtime with multiple fallback paths 2026-02-16 19:15:57 +00:00
8143da96e9 fix: correct enum names - ViewReorient.FalseValue, UpdateLevel.Model (verified from MCP) 2026-02-16 19:14:22 +00:00
9534ba9ed9 fix: Builder.Commit() not CommitFeature(), correct AddGeometry signature, verbose commit logging 2026-02-16 19:11:28 +00:00
4fc129e35b fix: try setattr/SetX/method patterns for SketchInPlaceBuilder properties (NXOpen Python getter/setter naming collision) 2026-02-16 19:08:06 +00:00
bf1f461e2b fix: use Plane (SmartObject) not DatumPlane, method calls not property setters (verified from MCP stubs) 2026-02-16 19:05:12 +00:00
7a2c002672 fix: use Matrix3x3 for datum plane, property assignment for SketchInPlaceBuilder2 2026-02-16 18:57:31 +00:00
bf4e84d45a fix: use Planes.CreatePlane + Points.CreatePoint + Directions.CreateDirection for sketch creation 2026-02-16 18:54:21 +00:00
ef8801a5cd test: add sandbox1 rib profile output for import testing 2026-02-16 18:49:21 +00:00
f4cfc9b1b7 feat(adaptive-isogrid): import_profile.py - push rib profile as NX sketch, sandbox1 brain input test file 2026-02-16 18:45:24 +00:00
23b6fe855b fix: handle closed circular edges (holes) - UF.Eval + GetLength circle fallback + debug logging 2026-02-16 17:57:06 +00:00
98d510154d fix: rewrite edge sampling + loop building using verified NXOpen API (GetVertices, GetEdges, GetLength, UF.Eval) 2026-02-16 17:46:52 +00:00
851a8d3df0 fix: replace face.GetLoops() with compatible API (GetEdgeLoops / UF layer / GetEdges fallback) 2026-02-16 17:42:08 +00:00
1166741ffd fix: add try/except + debug logging around sandbox extraction 2026-02-16 17:31:33 +00:00
afaa925da8 fix: search features + feature names for ISOGRID_SANDBOX attribute (Promote Body stores attrs on feature, not body) 2026-02-16 17:26:31 +00:00
6251787ca5 merge: take remote extract_sandbox.py v2 2026-02-16 12:22:56 -05:00
40213578ad merge: recover Gitea state - HQ docs, cluster setup, isogrid work
Merge recovery/gitea-before-force-push to restore:
- hq/ directory (cluster setup, docker-compose, configs)
- docs/hq/ (12+ HQ planning docs)
- docs/guides/ (documentation boundaries, PKM standard)
- docs/plans/ (model introspection master plan)
- Isogrid extraction work
- Hydrotech-beam: keep local DOE results, remove Syncthing conflicts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:22:33 -05:00
26100a9624 feat(adaptive-isogrid): extract_sandbox.py v2 - NX journal compatible, no argparse, sim→idealized navigation, listing window output 2026-02-16 17:20:28 +00:00
ed6874092f chore: clean hydrotech-beam syncthing conflicts and add new docs
- Remove all .sync-conflict-* files
- Remove temp _temp_part_properties.json files
- Add USER_GUIDE.md
- Add dashboard docs (Executive, Technical, Operations, Master Plan)
- Add playbooks (DOE, NX_REAL_RUN, SYNCTHING_RECOVERY)
- Update iteration results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 12:11:16 -05:00
bb83bb9cab feat(adaptive-isogrid): rewrite extract_sandbox.py - start from .sim, navigate to idealized part, find sandbox solid bodies by ISOGRID_SANDBOX attribute, inner loops as boundary constraints 2026-02-16 17:07:26 +00:00