Commit Graph

33 Commits

Author SHA1 Message Date
NiJingzhe dc143f3f9c fix(persistence): evaluate Var/Expr primitive geometry before serialization
Expression objects leaked into primitive geo metadata (make_cylinder/cone/
sphere) and were rejected by .scadpkg serialization. Write evaluated values
at the source (_operators_geometry) and project Var/Expr to float in
topology snapshots; add parametrized regression for var-driven primitive
positions.

Found during session 01a02469 (arc handle build) as two independent
serialization failures.
2026-08-22 16:57:20 +08:00
NiJingzhe f471216ec0 feat(example): model the four-bar links as forged bars with pivot bolts
Replace the plain box bars with realistic forged connecting rods: two
chamfered circular bearing eyes joined by an I-beam web (wide top and
bottom flanges over a thin mid web), a bearing bore through each eye,
and lightening holes in the coupler web. Add a hex-head pivot bolt
part (hex prism head, washer shoulder, plain shank pinning the bar
stack) instanced once per joint and fixed to one adjacent bar so it
shares that bar's rigid group without adding kinematic DOFs. Split
geometry into per-part modules per the SDK coding standard (link_bar,
pivot_bolt, assembly) and assign steel materials so MJCF export gets
densities without a fallback. Verified end to end: 8 components and 8
constraints solve with zero residuals, the MJCF keeps the loop closure
at 5e-16 over 500 MuJoCo steps with all eight geoms present, and the
STL/STEP outputs show eye-and-web link silhouettes instead of boxes.
2026-08-21 14:22:46 +08:00
NiJingzhe 00cef32b94 feat(mjcf): emit equality/connect constraints for loop-closing joints
A movable joint whose two groups are already connected through the
spanning tree (a kinematic loop such as a four-bar linkage) previously
landed in redundant_movable_joints and was silently dropped, exporting
an open-chain model whose末端 swung freely. Loop closure is a nonlinear
pose constraint that neither a tree hinge (MJCF bodies form a strict
hierarchy) nor the linear fixed-tendon equalities can express, but
MuJoCo solves it natively as an equality/connect.

Emit one closure site per endpoint group at the connector frame and one
equality/connect joining them; record closures in the mapping, add
closure_count to the report, and empty redundant_movable_joints (every
non-tree movable edge is now either a coupling equality or a closure).
Add example 21 (planar Grashof four-bar with a closed-form assembled
pose, all drives None so the authored closure is the solve reference)
with build/export scripts, update the shared-connector test to the new
closure contract, and lock the loop topology with a dedicated test.
MuJoCo verification: the exported model loads, holds the closure gap at
1e-16 over 500 steps, and behaves as a 1-DOF mechanism.
2026-08-21 13:57:06 +08:00
NiJingzhe 02b6f0601e feat(example): split BLDC exports into parallel scripts and fix FCStd multi-wire sweep
- capture() accepts include_scene=False; the BLDC build skips the
  tessellated Scene projection (STEP/MJCF/FCStd read meshes and feature
  graphs from the definition closure), shrinking the package from 230MB
  to 75MB and capture from ~460s to ~39s.
- main.py is now build + capture only with per-stage timing; the replay
  verification and preview compound stages are dropped.
- export_mjcf.py / export_step.py / export_fcstd.py each translate the
  captured .scadpkg independently; export_all.py runs them concurrently
  (MJCF 84s, STEP 51s, FCStd 569s wall on BLDC).
- FreeCAD twisted-sweep emulation rejected multi-loop profile faces
  ('requires a face with one outer wire'), so the new ring-gear sweep
  path failed FCStd export. Loft each wire of the face separately and
  cut the inner plugs from the outer loft, matching the kernel's
  sewn-shell semantics for annular and multi-hole profiles.
2026-08-21 13:05:24 +08:00
NiJingzhe d946403479 refactor(example): build BLDC actuator bearings from stdlib durable builder
Replace the hand-rolled _build_bearing_definition wrapper (extract ring
parts, re-declare ground/revolute/public connectors) with
scad.std.bearing.build_ball_bearing for all five bearing sizes. The
actuator now consumes the standard bearing sub-assembly directly as a
definition while keeping the reducer-level dual fixed topology
(outer-to-seat, inner-to-carrier-pin, 22 bearing interfaces).
2026-08-21 10:28:35 +08:00
NiJingzhe bc0a967c85 feat: propagate public connectors to exporters 2026-08-20 14:52:47 +08:00
NiJingzhe e6896d7baf fix: preserve nested assembly state 2026-08-19 14:02:58 +08:00
NiJingzhe ba1e06a489 feat: expand product exporters and FEM workflow 2026-08-18 01:36:44 +08:00
NiJingzhe 9d6703a786 feat: enforce canonical product capture workflow 2026-08-15 16:17:11 +08:00
NiJingzhe fee5039cc6 feat: add canonical product package export 2026-08-11 23:16:20 +08:00
NiJingzhe 89564ee1f5 Add durable part and assembly caching 2026-08-11 17:06:00 +08:00
NiJingzhe 675afb9b85 feat: consolidate BREP inspection workflow 2026-08-04 23:45:23 +08:00
NiJingzhe a413b0fe48 Use fused standard bearings in BLDC example 2026-08-02 04:07:04 +08:00
NiJingzhe 5c451d9406 Ignore generated example artifacts 2026-07-23 03:19:22 +08:00
NiJingzhe bde6c50f16 Migrate examples to the model workflow 2026-07-23 03:17:35 +08:00
NiJingzhe f4472a4917 Remove superseded example applications 2026-07-23 03:17:12 +08:00
NiJingzhe af660294b1 Merge feat/dimension-chain into dev 2026-07-16 01:05:21 +08:00
NiJingzhe 88983fe70f Add physical units and tolerance chains 2026-07-15 21:48:06 +08:00
NiJingzhe 0369769684 Add semantic CAD workflows and advanced examples 2026-07-15 19:58:30 +08:00
NiJingzhe a6ce3d7ab5 Fix articulated actuator assembly exports 2026-07-10 23:00:57 +08:00
NiJingzhe dab03777ec Add mesh extraction and collision verification 2026-07-10 10:09:17 +08:00
NiJingzhe c2e0a37128 Add compact two-stage reducer example 2026-07-06 17:46:59 +08:00
NiJingzhe d54a1e25e4 Refactor FreeCAD translator namespace 2026-07-06 01:55:01 +08:00
NiJingzhe 7196a75a57 Add standard gear library and release 2.0.1 2026-06-29 14:32:56 +08:00
NiJingzhe 5cf3516407 Update hydraulic rod example with QL face connectors and prismatic limit
Replace pure-frame connector placement with QL-selected end faces,
auto-detect normal alignment for the flip parameter, ground the outer
sleeve, and add a prismatic constraint with drive_distance=0 and a
ScalarLimit of (0, 100) so the solver clamps the slide range.
2026-06-26 17:38:59 +08:00
NiJingzhe 61a15fa9dc Document product assembly workflows 2026-06-26 05:02:30 +08:00
NiJingzhe b79f5605c1 Add constrained sketch and NACA blade examples 2026-06-20 22:13:20 +08:00
NiJingzhe 4e046152ca Add constrained sketch API 2026-06-13 03:13:26 +08:00
fanfengxiao c12e918713 fix: rename solid boolean APIs to rsolid 2026-06-08 15:11:34 +08:00
NiJingzhe f185406516 Support indexed geo select nodes 2026-06-02 23:29:27 +08:00
NiJingzhe 7425f71d79 Refactor SDK contract and QL selection replay 2026-06-01 01:14:19 +08:00
NiJingzhe 3a53d7ee63 Add serialization operation tree docs and example 2026-05-11 19:56:27 +08:00
NiJingzhe 65beee4c81 Prepare 2.0.0b1 beta release 2026-05-09 23:17:08 +08:00