Repository navigation
Morpho 0.10.0
·
167 commits
to master
since this release
Changes
- Modifiers will no longer be called for invisible (
visible=False) figures. Actor.segment()has been reworked.edgeInterpargument was replaced withseamless, and bothseamlessandrezerohave been turned into keyword-only arguments.
- Actor key slicing is now done in a Pythonic way.
myactor.key[start:stop]now excludes thestopindex (like how Python slices normally work).
- Removed toplevel
alphaattribute from Paragraph classes.- Overall
alphais now set/computed the same way as for other MultiFigures likeMultiImageandMultiText.
- Overall
New Features
- Implemented new
wiggle()actor action to virtually all figures that support arotationattribute. - Implemented
move()actor action for all Figure types.- Only works on positionable figures, i.e. ones that have a
posororiginattribute. It will fail for figures that lack these (e.g. Skits).
- Only works on positionable figures, i.e. ones that have a
- 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 tomorpho.textwhich 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
alignkeyword of theMultiSpline.replaceTex()can now optionally be set to a specialmorpho.GAUGEvalue to align the replacing MultiSpline such that the specifiedgaugeglyph 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\piglyph will remain unmoved.
- Example:
- Many alignable figures now support a new
placeOrigin()method which updates theorigin/posattribute to a new value while leaving the original figure visually unchanged. - Added
overdrawattribute to theAnimationclass which when set toTruedisables per-frame screen refreshes. - Added
convertWidthFrom()andconvertHeightFrom()methods to theCameraclass.- These do the same thing as
convertWidth()andconvertHeight()but reverses the roles ofselfandother.
- These do the same thing as
- Added numerical derivative function
derivative()tomorpho.calculus. - Added
boxFromDiagonal()function tomorpho.tools.basicsthat 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 tomorpho.tools.basicsthat 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 tomorpho.tools.basics. - Added
rotationNd()function tomorpho.matrixthat 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 tofigureGrid(). - The
gaugeinput forreplaceTex()can now optionally be a Spline/MultiSpline figure. - The
staggerorsubstaggerkeywords 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 byfadeIn()would cause the final keyfigure to still be invisible sincefadeOut()sets subfigure visibilities to False.
- This resolves an undesired behavior where using
- Added
applyModifier(),actualize(), andactualized()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 themodifierattribute.actualize()doesapplyModifier()and then resets themodifierattribute toNone.actualized()appliesactualize()to a copy of the keyfigure and returns it, leaving the original keyfigure unchanged.
- Added
timeOffsetoptional keyword toActor.insert()method. - The
domaininput forcolorPattern()can now optionally be a figure/actor, whereby its bounding box (if it exists) will be used as the domain box. - Slightly reworked
EllipticalArcandPietoPath()andtoPolygon()methods to make all angular steps the same size, though they may not exactly equal the specifieddThetavalue anymore. Frame.partition()method can now acceptsliceobjects.- Added
tancolornontweenable attribute toSplineclass which can be used to change the color of tangents shown whenshowTangentsis set toTrue. - 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 aMultiPath3Dfigure instead of a 2DMultiPathfigure.- Fixed a bug with the
now()method in which the cache would not invalidate based on a mismatcheduseModifiervalue. rezero()now works even for Actors with empty timelines.- Paths with outlined arrows drawn in the classic style now render correctly when non-trivial
transformvalues are set. Path.s_inv()will no longer throw a ZeroDivision error when a value of0is passed in.EllipticalArcrendering 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-integertimeOffset, the delay could be ignored in animation playback.