Skip to content

Morpho 0.10.0

Choose a tag to compare

@morpho-matters morpho-matters released this 11 May 18:39
· 167 commits to master since this release

Changes

  • Modifiers will no longer be called for invisible (visible=False) figures.
  • Actor.segment() has been reworked.
    • edgeInterp argument was replaced with seamless, and both seamless and rezero have been turned into keyword-only arguments.
  • Actor key slicing is now done in a Pythonic way.
    • myactor.key[start:stop] now excludes the stop index (like how Python slices normally work).
  • Removed toplevel alpha attribute from Paragraph classes.
    • Overall alpha is now set/computed the same way as for other MultiFigures like MultiImage and MultiText.

New Features

  • Implemented new wiggle() actor action to virtually all figures that support a rotation attribute.
  • Implemented move() actor action for all Figure types.
    • Only works on positionable figures, i.e. ones that have a pos or origin attribute. It will fail for figures that lack these (e.g. Skits).
  • Path and MultiPaths now support a toSpline() method to convert them (mostly) into equivalent Spline/MultiSpline figures.
    • Certain properties won't transfer, though, such as arrow tips since Splines do not support them.
  • Implemented nodes() method for Splines that returns a list of all the nodes in the Spline.
  • 2D Paragraph figures now support the alignOrigin() method.
  • Added fixedLengthDecimal() function to morpho.text which converts a floating point number to a string with the specified number of decimal digits, appending zeros as necessary to keep a fixed number of decimal digits in the returned string.
  • The align keyword of the MultiSpline.replaceTex() can now optionally be set to a special morpho.GAUGE value to align the replacing MultiSpline such that the specified gauge glyph remains in the same position after replacement.
    • Example: mytex.replaceTex(newtex, gauge=r"\pi", align=morpho.GAUGE)
      will align the newly created LaTeX such that the first match to the \pi glyph will remain unmoved.
  • Many alignable figures now support a new placeOrigin() method which updates the origin/pos attribute to a new value while leaving the original figure visually unchanged.
  • Added overdraw attribute to the Animation class which when set to True disables per-frame screen refreshes.
  • Added convertWidthFrom() and convertHeightFrom() methods to the Camera class.
    • These do the same thing as convertWidth() and convertHeight() but reverses the roles of self and other.
  • Added numerical derivative function derivative() to morpho.calculus.
  • Added boxFromDiagonal() function to morpho.tools.basics that returns the standard 4-item list [xmin, xmax, ymin, ymax] for a box given only the positions (as complex numbers) of two of its opposite corners.
  • Added concat() function to morpho.tools.basics that returns a list concatenating all of the elements in a collection of sequences. Helpful when trying to concatenate sequences of differing types (e.g. concatenating a list with a tuple).
  • Added aslist() function to morpho.tools.basics.
  • Added rotationNd() function to morpho.matrix that computes an N-dimensional rotation matrix given two vectors and an angle.

Improvements

  • Added toType() method to Frame class and subclasses that can be used to help convert one Frame type into another.
  • The filler feature of figureGrid() can now be used even if a name dict is passed in to figureGrid().
  • The gauge input for replaceTex() can now optionally be a Spline/MultiSpline figure.
  • The stagger or substagger keywords as part of multi-action calls now accept sequences of numbers instead of just single numbers.
  • The morphFrom() actor action can now be used more widely on most MultiFigure actors.
  • fadeIn() actor action for Frames now ensures visibility of selected subfigures.
    • This resolves an undesired behavior where using fadeOut() followed by fadeIn() would cause the final keyfigure to still be invisible since fadeOut() sets subfigure visibilities to False.
  • Added applyModifier(), actualize(), and actualized() methods to all Figures which enable figures that are set as keyfigures of an actor to have their modifiers applied before draw time.
    • applyModifier() simply applies the current modifier to the keyfigure IN PLACE but does not reset the modifier attribute.
    • actualize() does applyModifier() and then resets the modifier attribute to None.
    • actualized() applies actualize() to a copy of the keyfigure and returns it, leaving the original keyfigure unchanged.
  • Added timeOffset optional keyword to Actor.insert() method.
  • The domain input for colorPattern() can now optionally be a figure/actor, whereby its bounding box (if it exists) will be used as the domain box.
  • Slightly reworked EllipticalArc and Pie toPath() and toPolygon() methods to make all angular steps the same size, though they may not exactly equal the specified dTheta value anymore.
  • Frame.partition() method can now accept slice objects.
  • Added tancolor nontweenable attribute to Spline class which can be used to change the color of tangents shown when showTangents is set to True.
  • The endpoints given to windingAngle() can now be reversed.

Bug Fixes

  • Fixed a bug where an error would be thrown when attempting to draw an empty FancyFrame with a background box.
  • Fixed a bug with Frame Actor splitting that would cause features like subactions to misbehave sometimes.
  • Fixed a bug with changing the alignment of a Paragraph figure after construction.
  • MultiSpline3D.toPath() now correctly outputs a MultiPath3D figure instead of a 2D MultiPath figure.
  • Fixed a bug with the now() method in which the cache would not invalidate based on a mismatched useModifier value.
  • rezero() now works even for Actors with empty timelines.
  • Paths with outlined arrows drawn in the classic style now render correctly when non-trivial transform values are set.
  • Path.s_inv() will no longer throw a ZeroDivision error when a value of 0 is passed in.
  • EllipticalArc rendering is now done in a more orientation-consistent way, in which clockwise-oriented arcs will be actually be drawn clockwise. This could be an issue when drawing a clockwise arc with a dash pattern.
  • Modifiers that modify a visible figure into an invisible one will now no longer be drawn.
  • Fixed a bug with wait() where given a non-integer timeOffset, the delay could be ignored in animation playback.