Static Force Analysis service and its UI #309
Merged
ekim39 merged 39 commits intoApr 18, 2026
Merged
Conversation
This version: + Analyze the reaction forces at each joint in a sub-mechanism. + Show direction of Torque at Input Joint + API for front-end allows user to choose Reaction Force direction and Torque direction.
+ Add gravitational convention for mass + Apply matrix to get all unknown reaction forces and torque
This fix allows us to set a mass for the link now
…ting moments + The user can choose the pivot for calculating the moment. If the user doesn't choose any, it will be set to "Center of Mass" by default.
Fixed the dual side-by-side form and link-edit-panel to allow user to edit the mass and center-of-mass
Make the Link object save new center of mass coordinates when user edit it.
The starting points for the forces now remain fixed during the animation. The issue was caused by the previous version of the code using "storedAngle" instead of "finalAngle", which represents the updated angle during the linkage animation.
If we custom center of mass (COM) after we create a force for a link, the force position will be sliding back and ford. The reason is the custom COM is not defined when Force class and Link class was built in the past. In this fix: + Added logic to find COM in different frame of animation using circle technique. + Made Force objects in the Link update every time we have custome COM
Adding an error tolerance when using the circle intersection technique to calculate the next positions of mechanisms.
…on Frames Even though this version is finished, it's still a draft and has not been tested yet. I push it to Github just to save my work. In general, this version will export data for static analysis of all Reaction Forces and Torque at all animation frames (all positions of the mechanism when it moves on a 2D planar)
+ Deleted some functions that are not used anymore. + Added some more header comments for better explanation.
- analyzeIfNeeded(...): call this once every time when the component created. It will automatically check if we need to recalculate again. - getAnalysisResultAtFrame(...): Use this from the front-end to retrieve data.
…solver)' into Static-Force-Analysis-UI-and-Service-Integration-Branch
…vice-Integration-Branch' into Static-Force-Analysis-UI-and-Service-Integration-Branch
+ When the user hit the drop-down panel "Data Summary", it will trigger re-calculate static force analysis if needed. + save torque data from the static-analysis service in a variable in this front-end component to minimize the call to the service.
+ Use debounceTime() to prevent continuously re-calculation if the user move a joint/link non-stop. It will just start calculating when the user releases the mouse for around 300ms
+ Use debounceTime(300) to prevent re-calculation immediately when the user is moving/changing the mechanism. It starts calculating when the user releases their mouse for 300ms.
…pon creation addForce() in link.ts calls newForce.updateAfterMovement() immediately after adding. This is unnecessary at t=0 (the force is already positioned correctly from the constructor) and causes the start setter's boundToLink() to potentially snap the position. So we should remove "newForce.updateAfterMovement();" in addForce()
calculatePositionInLink() stores the absolute angle but updateAfterMovement() adds parentAngle one more time, causing double-counting the initial orientation.
+ The current COM in analysis-solver.service is not correct, a new solution added using Circles Intersection Technique for finding/ tracking COM of each link in a sub-mechanism.
…ction forces from back-end for front-end usage
…solver)' into Static-Force-Analysis-UI-and-Service-Integration-Branch
✅ Deploy Preview for steady-macaron-f82663 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for pmks failed.
|
…etween joints in Static Force Analysis tab
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.
In this pull request, we merged the Static Force Analysis logic (from branch
static-equilibrium-position-analysis-(static-kinematic-solver)) and its UI design (from branchForces-Analysis-Panel).