Repository navigation
Parametric: kinematic mates, motion studies and static stress analysis - #257
Merged
Merged
Conversation
…o, yield and tensile strength)
… solver and assembly files Distance and angle mates can be kept between limits; hinge, gear, rack and pinion, screw, width and slot mates. Coupling mates measure motion from where each solve starts, so turns add up past a full turn. Motion studies step the solver frame by frame with rotary, linear and mate-driving motors, stop at limits or lock-ups, and give paths, turns and mate values with derivatives.
…studies The Mate panel limits distance and angle mates and makes hinge, gear, rack and pinion, screw, width and slot mates, each with its own selection boxes and values. Motion studies have rotary, linear and mate-driving motors, are calculated in slices with progress and cancel, play back with loop and scrub, and plot a component's or mate's motion with velocity and acceleration, with CSV download. Studies are listed in the design tree and saved with the assembly; editing the assembly puts their results out of date.
Checks up to 40 frames spread over the motion with the worker's interference detection, lists the times where components overlap (a click goes to that frame), and puts the shown scene back afterwards.
…ibility checks of the new panels
…maries in the document's units
… edge recovery, quadratic nodes)
…nditioned conjugate gradients)
…run in a worker, result plots with legend, probe and report
… are solved with weak springs, others reported as unstable
…t and the Analysis tab in the browser
… hinges and sliders Slider: one straight edge or axis, or two planar faces, on each component; one move along it, no turn, optional travel limits from where it was added. Cam: a follower (vertex, roller or flat face) touching the convex outline of the cam's profile faces (an exact circle for an eccentric, exact arcs and corners otherwise); a profile with a hollow is refused with its depth. Universal joint: the cross piece holds the two yokes square, so the output turns by atan(tan phi / cos beta), with an optional joint point. Rotary motors can go on a hinge and linear motors on a slider.
…est of a lobed cam's arcs and flanks
…frames over half a turn are solved in smaller steps)
… the first and last frames
…ing components per frame (300 components, 20000 frames: 335 MB to 16 MB, 2.7 s to 0.9 s)
…rn instead of holding nothing
…used (the follower rode across the gap as if the cam were flat there)
…s a nearly incompressible material When the multigrid solve ran out of iterations the solver went on with up to 20,000 block Jacobi iterations (about 30 s on a 45k-unknown beam, many minutes on a fine mesh) before giving the same error; block Jacobi now only takes over when the multigrid breaks down. A Poisson's ratio above 0.49 is named as the cause, and the progress no longer goes below zero while the residual rises.
…esh error, not results on a third of it A 100 x 100 x 0.5 plate meshed at the finest setting (0.65 mm elements) kept a third of its volume, in ragged pieces, and was solved as if it were the part. The mesher now refuses a mesh that misses (or adds) more than a tenth of the part's volume and says that walls are thinner than the elements.
…opied again The Analysis workspace already hands the client a copy of the surface for the worker, but the client posted it without a transfer list, so it was copied a second time. Tests cover the worker and client: progress, moved arrays both ways, messages for the user and internal failures, Cancel, and a worker that dies.
… body force, pressure in a hole) and mesh determinism
… edges normal to each face The normals of all the fixture's faces were averaged at each node, so a node on the edge between two of its faces (the bottom and back of a block, say) was held only along the diagonal and slid across both faces: a block pressed on rollers picked together on three faces showed 0.70 to 1.22 MPa instead of a uniform 1 MPa. Normals are now kept per face and merged only where faces meet nearly tangent.
…ure along the directions it holds Each node's whole reaction went to the first fixture on it, so a roller under a bar fixed at its end reported a sideways reaction (1.8 N of a 100 N pull) that a frictionless roller cannot carry. The reaction is now split along the node's constraint directions, each to the fixture that holds it.
The mesher finds the boundary of the tetrahedra four times, each time with a string key and a sort per face; faces are now keyed by their two lowest corners. The fine bracket meshes in about 0.4 s instead of 1.1 s, with the same mesh (checked node for node on the examples).
…so a free sliding part is caught Beside a sharp edge the mesher can leave a boundary triangle across two faces. A roller took its normal from those triangles, so on a 37 degree wedge on rollers under it and behind it the stray triangle held it along X: pushed along X it was solved with no warning instead of being reported as free to slide. A face whose triangles (all but a few) are coplanar is now held along its own normal at every node.
…aft can slide and turn A roller took its directions from the facets' normals, which lean along and around a cylinder's axis: a 20 mm shaft on a roller around its side, pushed 100 N along its axis, was solved with a 100 N axial reaction (a frictionless roller cannot carry it) instead of being reported as free to slide. A face whose facets all face away from one axis, with its nodes at one distance from it, is now held along the radius at each node; other curved faces are held as before.
… six unrolled) About 0.6 s less setup on the fine bracket (Galerkin products 2.0 + 1.3 s down to 1.7 + 0.95 s), with the same displacements.
…elps, instead of making slivers On coarse meshes the later edge recovery passes refused most moves and split edges, making more crossings each pass (25, 29, 36, 66, 96 on the coarse bracket) and squashing elements: worst quality 0.008, 356 elements below 0.1. It now stops when a pass finds no fewer crossings than the last one. Coarse bracket: worst quality 0.053 (3 below 0.1), von Mises at its surface nodes against a mesh 3 times finer 9.8% rms (was 16.9%), volume 1.9% short (was 1.4%); quarter fineness 0.073 -> 0.178; the flange's default mesh 0.048 -> 0.119; finer meshes of the examples are unchanged.
…ld not start, not that the part is too large The worker now says when its code has loaded; an error from a worker that never did (offline, or the app updated under the page) asks to check the connection and reload, instead of suggesting a coarser mesh.
… of the first taking it all Three fixed fixtures on one face reported 300 N, 0 N and 0 N for a 300 N load. Along each direction held at a node, the reaction is now shared equally by the fixtures that hold that direction (each fixture's own directions there), so each reports 100 N; a roller still gets only its normal share, and the total is unchanged.
… angle past 0° or 180° stops the study there with a message (the bar went through the plate)
…t in every frame and lists the same frames after cancelled checks
…ad of one string (the same bytes; a long study no longer holds hundreds of megabytes twice)
…from where it started), not only of limited ones
…onent, not from where it was before (it was over defined when other mates turned it)
…lt size, and no mesh offered is too large to solve The default element size kept meshes near 150k unknowns from the part's volume alone, which on a 200 x 100 x 1.5 plate was 2.35 mm: no setting could mesh it. Where the walls (2V/A) are thinner than that, the default is now the wall thickness, up to a budget of 1,000,000 unknowns; compact parts keep their sizes. The plate solves at the default in about 19 s (842k unknowns), its tip deflection 0.96 of beam theory; a 1.5 mm sheet metal L bracket in about 5 s (229k), 0.95 of two-cantilever theory. - Where some walls are still thinner (a thin plate with a thick boss), the worker meshes finer in steps, down to the smallest size offered, and says so through the mesh's size; at that size it says the walls need more than a browser can solve. - The finest size offered stops at the same budget (measured in Chromium: 961k unknowns peak at 2.4 GB in the page's process, 21 s; 2.1M at 4.3 GB). - The unknowns estimate counts the cut elements at the surface (within 3% of a cube, the bracket and the plate; the volume-only one was 26% low on the plate and 25% high on the cube).
…lve, estimates unknowns with the surface, and says when walls needed a finer mesh - The Fine end stops at about a million unknowns, and the panel says "(the finest mesh solvable here)" there. - The unknowns shown count the elements cut at the surface (a 1.5 mm plate showed about a third too few). - A mesh made finer than set, because some walls are thinner, says so in the status (elements of 1.2 mm: the part's walls are thinner than the size set). An end-to-end test meshes and solves a 100 x 50 x 1.5 plate at the default and checks its deflection against beam theory.
…n's progress and Cancel
… spheres, cylinders, cones and other surfaces of revolution The part's surface for analysis now carries each face's surface: a plane's normal, a sphere's centre, or the axis of a surface of revolution (read from a circular edge of the face, as this OpenCascade build cannot give a cone's or a torus's axis). Given these, a roller holds a plane along its normal, a sphere and a cylinder along the radius, and a cone or torus along the facets' normals with no part around the axis. A frustum on a roller on its cone was held against turning by the facets (no free motion found); it is now free to turn about its axis, and solved with that motion held by weak springs.
…ces (a cone's, a sphere's) The workspace passes each roller face's surface, as the part gives it, to the solver. The flange on a roller on its chamfer, pressed on its top, is reported free to turn about its axis (the facets held it before).
…uld not be computed (it called them clear), as the Interference Detection panel does
…where the point puts the shafts (adding it turned the input shaft, its yoke 64° out of the shafts' plane)
…or mates, read from a circular edge (this OpenCascade build cannot give a cone's axis, so they had none)
… reading the file back (the sample's title matched before it was saved)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds kinematics to assemblies and linear static stress analysis to parts.
Assemblies: limit and mechanical mates, motion studies
Limit mates
Mechanical mates
Gear, rack and screw turns add up past ±180°. Dragging one gear turns the other, and dragging a rack turns its pinion.
Every new mate has its own Mate panel, appears in the Mates folder (edit, suppress, delete, flip) and is undoable. Each counts correctly in the degree-of-freedom and conflict reporting, and is strictly validated in the file.
Motion studies (Motion Study on the Assembly tab)
Parts: static stress analysis (new Analysis tab)
Accuracy (unit tests)
Reactions balance the applied loads to under 1e-5, and a gravity load equals mass × g. A fine mesh of the bracket example (332k unknowns) solves in about 8 s.
Limitations
Testing
npm run buildpasses on Node 22.TZ=UTC.assembly-kinematics.spec.tsandanalysis.spec.ts.Review fixes (94 commits, one per fix, each with a regression test)
Mates and motion
Stress analysis