{"id":18599033,"url":"https://github.com/jauhl/mecedit","last_synced_at":"2025-04-10T18:31:13.541Z","repository":{"id":83310484,"uuid":"140959862","full_name":"jauhl/mecEdit","owner":"jauhl","description":"A lightweight editor for modeling and simulation of planar linkages","archived":false,"fork":false,"pushed_at":"2019-07-04T15:22:39.000Z","size":10684,"stargazers_count":15,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T02:01:37.497Z","etag":null,"topics":["2d","constraint","kinematics","linkage","mechanism","physics","progressive-web-app","pwa","robotics","simulation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jauhl.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-14T16:10:45.000Z","updated_at":"2025-01-17T16:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"10417eaa-96e5-4c52-9106-2cfbbc9b783d","html_url":"https://github.com/jauhl/mecEdit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jauhl%2FmecEdit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jauhl%2FmecEdit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jauhl%2FmecEdit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jauhl%2FmecEdit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jauhl","download_url":"https://codeload.github.com/jauhl/mecEdit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271610,"owners_count":21075800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","constraint","kinematics","linkage","mechanism","physics","progressive-web-app","pwa","robotics","simulation"],"created_at":"2024-11-07T01:37:30.551Z","updated_at":"2025-04-10T18:31:13.530Z","avatar_url":"https://github.com/jauhl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n---\n## [Try **_mecEdit_** out!](https://mecedit.com \"mecEdit\")\n---\n\n\n**_mecEdit_** is a progressive web app that helps you\n\nbuild\n\n![build](./img/build.gif)\n\nsimulate\n\n![simulate](./img/simulate.gif)\n\nand analyze\n\n![analyze](./img/analyze.gif)\n\nplanar linkages.\n\u003cbr\u003e\u003cbr\u003e\n**_mecEdit_** utilizes [mec2](https://github.com/goessner/mec2) as a physics engine and [g2](https://github.com/goessner/g2) for most graphical elements.\n\n---\n\u003cbr\u003e\u003cbr\u003e\n# User guide\n\n[Deutsch](./docs/userguide_de.md)\n\n[English](./docs/userguide_en.md)\n\n---\n\u003cbr\u003e\u003cbr\u003e\n\n# Changelog\n\n## v0.7.0\n\n### general:\n+ Node and constraint visibility is now reset for each new model.\n+ Fixed a bug where the drag\u0026drop overlay would persist.\n\n---\n\n## v0.6.9\n\n### general:\n+ UI updates \u0026 optimization.\n+ Added option to export the model as a standalone html file for viewing.\n+ Copy a JSON-String of your model to the clipboard by clicking the new copy button in the JSON editor.\n+ A snippet for chart-views is provided for you to copy to your clipboard and paste it in the JSON editor.\n+ Drag\u0026Drop your JSON models directly to the canvas.\n+ You can now reach mecEdit under [mecedit.com](https://mecedit.com)\n+ (internal change) you should now get \u0026 set `app.dragMode` only via `app.editing`.\n\n---\n\n## v0.6.8\n\n### general:\n+ `mec2` charts-views are now fully supported. Charts have to be added via the JSON-editor. They can either be rendered directly to the main canvas or to a separate canvas for each chart. To do so simply give the chart definition in your model a property `\"canvas\":\"canvasId\"` with an arbitrary id as a value. Everything else is handled by *mecEdit*.\n+ Added an option to scale the radius of each node by its mass. This can be toggled from the navigationbar under __View__ -\u003e __Nodescaling__.\n+ Some CSS fine-tuning.\n\n---\n\n## v0.6.6\n\n### general:\n+ Fixed some bugs.\n\n---\n\n## v0.6.5\n\n### general:\n+ Updated `mec2` to v0.8.5 which introduced major changes to references in constraints.\n+ Updated vendor dependency `bootstrap` to v4.1.3.\n+ The contextmenu of constraints now shows values for their current orientation and length.\n\n---\n\n## v0.6.1\n\n### general:\n+ The JSON-editor is now emptied before dragging \u0026 dropping files into it.\n+ Placing components can now be canceled by clicking on the navbar or sidebar in addition to pressing `[Esc]` so mobile users won't get stuck.\n+ Some other small changes.\n\n---\n\n## v0.6.0 - PWA \u0026 various improvements\n\n### general:\n+ _mecEdit_ is now a progressive web app! In Google Chrome set `chrome://flags/#enable-desktop-pwas` to `enabled` and install from menu.\n+ Drastically improved panning in MS Edge.\n+ Updated example 'slidercrank' to showcase drives and inputs.\n\n---\n\n## v0.5.3 - bugfixes\n\n### general:\n+ The range of inputs is now correctly updated when changing the adjustment range of a drive from the contextmenu.\n+ Various bugfixes.\n\n---\n\n## v0.5.2 - various changes\n\n### general:\n+ Moved modal- \u0026 editor-objects to namespace app.\n+ Improved performance.\n+ Changed version to 3 digits to comply with npm standards.\n\n---\n\n## v0.5.1.1 - bugfixes\n\n### general:\n+ Fixed a bug where deleting constraints would fail.\n+ Changing coordinates from node contextmenu changes now x0,y0 as well as x,y.\n\n---\n\n## v0.5.1.0 - improvements\n\n### general:\n+ Optimized handling of constraints when contextmenu was invoked.\n+ Fixed a bug where calling `model.reset()` would explode the model when constraints have `len.r0` set.\n+ Fixed a bug where changing node coordinates via contextmenu would throw an error.\n+ Fixed a bug where choosing info values was not possible when adding a view-component.\n+ Handled errors for users trying to pass invalid JSON code from the JSON-editor.\n\n---\n\n## v0.5.0.3 - bugfix\n\n### ctxm-templates.js:\n+ Fixed a bug where the value of the select menu in the viewcomponent-modal would not be the set value of the view.\n\n---\n\n## v0.5.0.2 - minor changes\n\n### general:\n+ Cleaned up the code and fixed some minor bugs.\n\n---\n\n## v0.5.0.0 - Length-Inputs\n\n### general:\n+ Enabled automatic (on initialization) and manual (via contextmenu) adding and removal of range-inputs for driven constraint dofs. This entails various internal changes in `app.js`, `appevents.js`, `ctxm-template.js` and `slider.js` (formerly `mec.slider.js`).\n\n---\n\n## v0.4.9.3 - Quality of life\n\n### general:\n+ Added some additional keyboard shortcuts and documented them under Navbar -\u003e Help -\u003e Keyboard Shortcuts.\n+ Generalized purging elements via Navbar -\u003e Edit -\u003e Purge Element by replacing `app.clearNode()` with `app.purgeElement()`.\n+ Replaced the 'Run' and 'Idle' buttons with a combined button that takes `app.state` into account.\n\n---\n\n## v0.4.9.2 - Inputs\n\n### general:\n+ [WIP] Inputs are back. Driven constraints allow now to toggle an input element via the contextmenu which gets added to or removed from the DOM. Constraints with `input: true` automatically get an input element on initialisation. Currently only `ori` inputs are supported!\n+ Holding the `[Shift]` key while clicking a button to add nodes or constraints from the sidebar keeps the respective build state after finishing. This allows for a chained adding of elements without having to click the button again. When you're done adding elements, simply press `[Esc]` as adviced by the GUI.\n\n### g2.editor.js:\n+ Disallowed views from being detected.\n\n### mec.slider.js:\n+ [WIP] Updated to utilize `inputCallbacks` and `tick`. While `func` works, `Dt` is disregarded at the moment so all forward/backward takes always 5 seconds.\n\n---\n\n## v0.4.9.0 - bugfixes \u0026 hiding graphics\n\n### general:\n+ Additionally to hiding labels, the linkage can now be hidden from the Navbar -\u003e View -\u003e Togggle Graphics.\n\n### appevents.js:\n+ Models from `examples.js` are now passed as copies.\n+ Added events for hiding model.\n\n### app.js:\n+ Dragging in ´dragEDIT´ mode now correctly restores `Dt`-value of drives.\n\n---\n\n## v0.4.8.9 - Examples\n\n### general:\n+ Added examples for models `examples.js` which can be found under File -\u003e Load Example.\n\n---\n\n## v0.4.8.8 - more components, drives \u0026 views\n\n### general:\n+ The `\u003cadd drive\u003e` button in the sidebar now adds drives to constraint's `ori` and `len` types `free`.\n+ Enabled `type` `drive` option in constraint contextmenus. This allows to set some limited optional properties. For additional properties refer to the built-in `JSON` model editor (Hotkey `[e]`).\n+ Added a 'Components' menu to the navbar that will offer more components than the sidebar which only is intended for quick access.\n+ Added `fix` and `flt` shapes to the navbar's 'Components' menu.\n+ Added an option to define views to the navbar's 'Components' menu. This opens a modal to build the view-object. (Hotkey `[v]`)\n\n---\n\n## v0.4.8.5 - loads \u0026 node-tracing\n\n### general:\n+ The sidebar has now buttons to add loads (forces and springs) to the model. Those loads additionally have their own contextmenu.\n+ The contextmenu of nodes now offers an option to trace this node. Clicking this toggle adds or removes an `view` `type:'trace'` to the model.\n+ Reworked the tooltip. It now shows node coordinates while dragging them in dragmode EDIT and views while hovering nodes with views in dragmode MOVE.\n\n### app.js, appevents.js:\n+ Modified `initCtxm` to work with the minimal `asJSON` string since `toJSON` did contain default properties.\n+ Added various functions and conditionals to handle load and view components.\n\n### g2.editor.js\n+ Elements that do not return a member `type {string}` (e.g. `shape.beam`) are now ignored.\n\n---\n\n## v0.4.8.4 - controlpanel \u0026 light-theme\n\n### general:\n+ Introduced app-states. The controlpanel in the navbar sets `app.state`, which is then utilized in `app.tick()`.\n+ Users can now switch between a light- and a dark-theme for the editor window via the Navbar -\u003e View -\u003e toggle darkmode. The app defaults to dark because I like my retinas unburnt.\n\n---\n\n## v0.4.8.2 - new model editor \u0026 mec2 release merge\n\n### general:\n+ merged changes from mec2 library (initial release)\n+ added a model-editor where the user can directly edit the code (in `JSON`) that defines the model. menu -\u003e edit -\u003e model editor (or Hotkey `[e]`)\n+ added dependency [CodeMirror](https://codemirror.net/) for syntax highlighting in the model-editor\n+ added entry 'New model' to the Navbarmenu. This discards the current model and initializes an empty one.\n\n### appenvents.js:\n+ values of nodes are now dynamically applied from the contextmenu without having the node replaced (`app.tempElm` stays `false`)\n\n### mixin.js:\n+ mousemove events now distinguish between pressed buttons.\n\n    + `left-mousebutton` for dragging nodes\n    + `middle-mousebutton` OR `[Ctrl]` + `left-mousebutton` for panning\n    + `right-mousebutton` is a pointer eventtype\n\n---\n\n## v0.4.8 - added forces/moments \u0026 optimizations\n\n### general:\n+ merged changes from @goessner (02.08.18) which mainly add forces and moments to the model\n+ some functionality might still be broken\n\n---\n\n## v0.4.7.7 - contextmenu streamlining\n\n### general:\n+ replaced dependency 'Ti-ta-toggle' with some lines of CSS in `app.css`\n+ all global event handlers are now found in `appevents.js` which has been split off  from `app.js`\n+ styled the contextmenu for nodes\n+ slightly changed the behavior when closing the contextmenu and the handling of its input-element-events\n\n---\n\n## v0.4.7.6 - simplified UI\n\n### general:\n+ got rid of all css media-breakpoints except for one custom breakpoint @400px viewport-width\n+ replaced the old vector button images with new svg-symbols\n\n---\n\n## v0.4.7.5 - bugfixes\n\n### general:\n+ various major \u0026 minor bugfixes\n\n---\n\n## v0.4.7.3 - modifying constraints \u0026 nodes\n\n### general:\n+ version numbers have now a leading 0 to better indicate the development status of the app\n\n### app.js\n+ implemented fully dynamic contextmenu (styling still unfinished) to modify selected nodes and constraints -\u003e all changes are applied when the contextmenu is closed\n+ updated the global changehandler of the contextmenu\n\n### ctxm-templates.js:\n+ added templates for referenced constraints\n+ added templates for all node properties\n+ various minor changes\n\n### mec2.js, mec.constraint.js \u0026 g2.editor.js\n+ various minor changes\n\n---\n\n## alpha v4.7.1 - modifying constraints\n\n### general:\n+ `main.js` is now called `app.js`\n\n### app.js:\n+ added new functions to handle the dynamic contextmenu\n\n### ctxm-templates.js:\n+ new library that contains functions which return html-templates to build a dynamic contextmenu\n\n### mec.constraint.js:\n+ partially implemented `constraint.prototype.toJSON()`, which re-enables the export function\n\n---\n\n## alpha v4.7.1 - actuators, streamlining \u0026 bugfixing\n\n### general:\n+ clicking the contraint-type 'ctrl' lets the user add an actuator to an existing constraint. for now this only works with constraints of type 'rot' and only for a single actuator\n+ streamlining \u0026 bugfixing\n+ reorganized the file structure of the app\n+ constraints are now shaded when hovering over them and are selectable\n+ selected elements in the editor are now shaded yellow to indicate which element is responsible for the EDIT flag\n+ added dependency [Draggabilly](https://github.com/desandro/draggabilly \"Draggabilly Github\") to make the contextmenu for element-modifications dragable and contained in the editor\n+ added dependency [Ti-ta-toggle](http://kleinejan.github.io/titatoggle/) for a fancy-looking toggle switch (checkbox)\n\n### main.js:\n+ a tooltip with coordinates is now shown when dragging nodes; on the downside this produces stuttering. bug: fps stay constant\n+ enabled a contextmenu which opens when a constraint is selected by left-clicking; in future versions the elements will be modifiable through this\n+ started to implement a function to modify existing constraints `modConstraint(elm)`\n+ started to implement a function to convert an existent non-actuated constraint to an actuated constraint `addActuator(elm)`\n\n### mixin.js:\n+ events now pass clientX \u0026 clientY to the editor namespace\n\n### mec2.js, mec.constraint.js \u0026 g2.editor.js:\n+ various changes\n\n\n---\n\n## alpha v4.7 - inverse kinematics mode \u0026 merged changes from @goessner libraries (20.07.18)\n\n### general:\n+ implemented mode-switching (for now via a checkbox) between inverse kinematics and constraint-editing when dragging a node\n\n### main.js:\n+ bug: actuator functionality is broken, mec-slider no longer working\n+ probably implemented a whole lotta other bugs in the process of merging versions...\n\n### mec2.js \u0026 mec.constraint.js:\n+ to update a constraint you can now simlpy call `constraint.prototype.init()` again and pass the model\n\n---\n\n## alpha v4.6 - nodes can now be deleted\n\n### g2.editor.js:\n+ hovered element now belongs to editor namespace -\u003e `editor.curElm`\n\n### mec2.js:\n+ actuators-controls now adopt to new angle when dragging node with actuated constraint\n\n### main.js:\n+ fully implemented `deleteNode()`\n+ changed graphics queue approach -\u003e adding \u0026 deleting elements from `app.model` now rebuilds the queue, thus maintaining the correct order/layer of graphic elements\n+ added global escape event -\u003e pressing `[Escape]` now leaves and resets `app.edit`-state at any time\n+ model properties for actuator angle representation (e.g. `app.model.phi`) are now added dynamically and thus can be omitted in JSON-files\n+ fixed bug: clicking in empty space when adding a constraint no longer freezes the app\n\n---\n\n## alpha v4.5.9 - node dragging is now permanent\n\n### g2.editor.js:\n+ updates adjacent constraints to new node coordinates when dragging ends\n\n### mec2.js:\n+ nodes now inherit the methods `adjConstraintIds()` \u0026 `updAdjConstraints()` which look for and update values of all adjacent constraints\n+ constraints now inherit the method `update()` which mirrors `init()` but works with initialized an model\n+ partially implemented `constraints.prototype.toJSON()`, which fixed a bug with the export function\n\n### main.js\n+ partially implemented `deleteNode()`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjauhl%2Fmecedit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjauhl%2Fmecedit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjauhl%2Fmecedit/lists"}