mecEdit is a progressive web app that helps you
build
simulate
and analyze
planar linkages.
mecEdit utilizes mec2 as a physics engine and g2 for most graphical elements.
- Node and constraint visibility is now reset for each new model.
- Fixed a bug where the drag&drop overlay would persist.
- UI updates & optimization.
- Added option to export the model as a standalone html file for viewing.
- Copy a JSON-String of your model to the clipboard by clicking the new copy button in the JSON editor.
- A snippet for chart-views is provided for you to copy to your clipboard and paste it in the JSON editor.
- Drag&Drop your JSON models directly to the canvas.
- You can now reach mecEdit under mecedit.com
- (internal change) you should now get & set
app.dragMode
only viaapp.editing
.
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.- Added an option to scale the radius of each node by its mass. This can be toggled from the navigationbar under View -> Nodescaling.
- Some CSS fine-tuning.
- Fixed some bugs.
- Updated
mec2
to v0.8.5 which introduced major changes to references in constraints. - Updated vendor dependency
bootstrap
to v4.1.3. - The contextmenu of constraints now shows values for their current orientation and length.
- The JSON-editor is now emptied before dragging & dropping files into it.
- 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. - Some other small changes.
- mecEdit is now a progressive web app! In Google Chrome set
chrome://flags/#enable-desktop-pwas
toenabled
and install from menu. - Drastically improved panning in MS Edge.
- Updated example 'slidercrank' to showcase drives and inputs.
- The range of inputs is now correctly updated when changing the adjustment range of a drive from the contextmenu.
- Various bugfixes.
- Moved modal- & editor-objects to namespace app.
- Improved performance.
- Changed version to 3 digits to comply with npm standards.
- Fixed a bug where deleting constraints would fail.
- Changing coordinates from node contextmenu changes now x0,y0 as well as x,y.
- Optimized handling of constraints when contextmenu was invoked.
- Fixed a bug where calling
model.reset()
would explode the model when constraints havelen.r0
set. - Fixed a bug where changing node coordinates via contextmenu would throw an error.
- Fixed a bug where choosing info values was not possible when adding a view-component.
- Handled errors for users trying to pass invalid JSON code from the JSON-editor.
- Fixed a bug where the value of the select menu in the viewcomponent-modal would not be the set value of the view.
- Cleaned up the code and fixed some minor bugs.
- 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
andslider.js
(formerlymec.slider.js
).
- Added some additional keyboard shortcuts and documented them under Navbar -> Help -> Keyboard Shortcuts.
- Generalized purging elements via Navbar -> Edit -> Purge Element by replacing
app.clearNode()
withapp.purgeElement()
. - Replaced the 'Run' and 'Idle' buttons with a combined button that takes
app.state
into account.
- [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 onlyori
inputs are supported! - 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.
- Disallowed views from being detected.
- [WIP] Updated to utilize
inputCallbacks
andtick
. Whilefunc
works,Dt
is disregarded at the moment so all forward/backward takes always 5 seconds.
- Additionally to hiding labels, the linkage can now be hidden from the Navbar -> View -> Togggle Graphics.
- Models from
examples.js
are now passed as copies. - Added events for hiding model.
- Dragging in ´dragEDIT´ mode now correctly restores
Dt
-value of drives.
- Added examples for models
examples.js
which can be found under File -> Load Example.
- The
<add drive>
button in the sidebar now adds drives to constraint'sori
andlen
typesfree
. - Enabled
type
drive
option in constraint contextmenus. This allows to set some limited optional properties. For additional properties refer to the built-inJSON
model editor (Hotkey[e]
). - Added a 'Components' menu to the navbar that will offer more components than the sidebar which only is intended for quick access.
- Added
fix
andflt
shapes to the navbar's 'Components' menu. - Added an option to define views to the navbar's 'Components' menu. This opens a modal to build the view-object. (Hotkey
[v]
)
- The sidebar has now buttons to add loads (forces and springs) to the model. Those loads additionally have their own contextmenu.
- 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. - Reworked the tooltip. It now shows node coordinates while dragging them in dragmode EDIT and views while hovering nodes with views in dragmode MOVE.
- Modified
initCtxm
to work with the minimalasJSON
string sincetoJSON
did contain default properties. - Added various functions and conditionals to handle load and view components.
- Elements that do not return a member
type {string}
(e.g.shape.beam
) are now ignored.
- Introduced app-states. The controlpanel in the navbar sets
app.state
, which is then utilized inapp.tick()
. - Users can now switch between a light- and a dark-theme for the editor window via the Navbar -> View -> toggle darkmode. The app defaults to dark because I like my retinas unburnt.
- merged changes from mec2 library (initial release)
- added a model-editor where the user can directly edit the code (in
JSON
) that defines the model. menu -> edit -> model editor (or Hotkey[e]
) - added dependency CodeMirror for syntax highlighting in the model-editor
- added entry 'New model' to the Navbarmenu. This discards the current model and initializes an empty one.
- values of nodes are now dynamically applied from the contextmenu without having the node replaced (
app.tempElm
staysfalse
)
-
mousemove events now distinguish between pressed buttons.
left-mousebutton
for dragging nodesmiddle-mousebutton
OR[Ctrl]
+left-mousebutton
for panningright-mousebutton
is a pointer eventtype
- merged changes from @goessner (02.08.18) which mainly add forces and moments to the model
- some functionality might still be broken
- replaced dependency 'Ti-ta-toggle' with some lines of CSS in
app.css
- all global event handlers are now found in
appevents.js
which has been split off fromapp.js
- styled the contextmenu for nodes
- slightly changed the behavior when closing the contextmenu and the handling of its input-element-events
- got rid of all css media-breakpoints except for one custom breakpoint @400px viewport-width
- replaced the old vector button images with new svg-symbols
- various major & minor bugfixes
- version numbers have now a leading 0 to better indicate the development status of the app
- implemented fully dynamic contextmenu (styling still unfinished) to modify selected nodes and constraints -> all changes are applied when the contextmenu is closed
- updated the global changehandler of the contextmenu
- added templates for referenced constraints
- added templates for all node properties
- various minor changes
- various minor changes
main.js
is now calledapp.js
- added new functions to handle the dynamic contextmenu
- new library that contains functions which return html-templates to build a dynamic contextmenu
- partially implemented
constraint.prototype.toJSON()
, which re-enables the export function
- 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
- streamlining & bugfixing
- reorganized the file structure of the app
- constraints are now shaded when hovering over them and are selectable
- selected elements in the editor are now shaded yellow to indicate which element is responsible for the EDIT flag
- added dependency Draggabilly to make the contextmenu for element-modifications dragable and contained in the editor
- added dependency Ti-ta-toggle for a fancy-looking toggle switch (checkbox)
- a tooltip with coordinates is now shown when dragging nodes; on the downside this produces stuttering. bug: fps stay constant
- enabled a contextmenu which opens when a constraint is selected by left-clicking; in future versions the elements will be modifiable through this
- started to implement a function to modify existing constraints
modConstraint(elm)
- started to implement a function to convert an existent non-actuated constraint to an actuated constraint
addActuator(elm)
- events now pass clientX & clientY to the editor namespace
- various changes
- implemented mode-switching (for now via a checkbox) between inverse kinematics and constraint-editing when dragging a node
- bug: actuator functionality is broken, mec-slider no longer working
- probably implemented a whole lotta other bugs in the process of merging versions...
- to update a constraint you can now simlpy call
constraint.prototype.init()
again and pass the model
- hovered element now belongs to editor namespace ->
editor.curElm
- actuators-controls now adopt to new angle when dragging node with actuated constraint
- fully implemented
deleteNode()
- changed graphics queue approach -> adding & deleting elements from
app.model
now rebuilds the queue, thus maintaining the correct order/layer of graphic elements - added global escape event -> pressing
[Escape]
now leaves and resetsapp.edit
-state at any time - model properties for actuator angle representation (e.g.
app.model.phi
) are now added dynamically and thus can be omitted in JSON-files - fixed bug: clicking in empty space when adding a constraint no longer freezes the app
- updates adjacent constraints to new node coordinates when dragging ends
- nodes now inherit the methods
adjConstraintIds()
&updAdjConstraints()
which look for and update values of all adjacent constraints - constraints now inherit the method
update()
which mirrorsinit()
but works with initialized an model - partially implemented
constraints.prototype.toJSON()
, which fixed a bug with the export function
- partially implemented
deleteNode()