Skip to content

Cleaning up geometry module: New Tipable module #1537

Open
@AntonBallmaier

Description

@AntonBallmaier

Enhancement proposal

New Module

The geometry module is extremely crowded (2558 lines, 39 classes).

Therefor I suggest moving the classes connected to arrows to a now module, which could be named tipable.py.
This should includes the following:

  • TipableVMobject
  • Arrow
  • Vector
  • DoubleArrow
  • CurvedArrow
  • CurvedDoubleArrow
  • ArrowTip
  • ArrowCircleFilledTip
  • ArrowCircleTip
  • ArrowSquareFilledTip
  • ArrowSquareTip
  • ArrowTriangleFilledTip
  • ArrowTriangleTip

Combining classes

The number of classes is quite a bit over the top in my opinion. I feel like adding an aditional parameter wold be a better choice in many cases:

  • Giving Arrow two parameters double and curved both defaulting to False would deprecate DoubleArrow, CurvedArrow and CurvedDoubleArrow (Imo whether CurvedArrow should be deprecated is debatable).
  • The ArrowTip should get a parameter filled defaulting to False. This would deprecate the three filled variant classes.

Class renamings:

The (remaining) arrow tip classes ought to be renamed:

  • ArrowCircleTip => CircleArrowTip
  • ArrowSquareTip => SquareArrowTip
  • ArrowTriangleTip => TriangleArrowTip, however it might also be a good idea to combine TriangleArrowTip and ArrowTip in ArrowTip.

Edit: Total Tippable breakdown

After having a chat with @XorUnison I might as well deprecate Tipable and the differnt ArrowTip subclasses all together - we'll see how that turns out :D

Additional comments

Please add a comment if you want to work on this issue, as it may well be I already started doing so :)

Metadata

Metadata

Labels

enhancementAdditions and improvements in generalmaintenancerefactoring, typos, removing clutter/dead code, and other code quality improvementspr:deprecationDeprecation, or removal of deprecated code

Type

No type

Projects

Status

🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions