• Foo AKA Fooo (unregistered)

    Sveenth!

  • (nodebb)

    Snippet does not indicate is there could be documentation references elsewhere... Need to see the ENTIRE ALM environment. Perhaps the Git commit where theis was written is tied to a work item/ticket which contains a link.....

  • Smithers (unregistered)

    Who wants to bet that self.points[-1] would've been just fine for both cases with far less justifying arithmetic and far more compatibility with a future boss whose lucky number is 8?

  • Tim Ward (unregistered)

    They know what the shape is. They know the tip is the seventh point.

  • (nodebb)

    Here it is: https://github.com/ManimCommunity/manim/blob/main/manim/mobject/svg/brace.py

  • NoLand (unregistered)

    I think, the problem is really that it's self.points, instead of self.path, which introduces this ambiguity, and not so much the comment.

    Regarding, "why represents the 7th point in this array the tip?", this should become obvious, once you have seen the shape. (Maybe the shape of a pen tip?) Should the comment discuss the shape of that element?

  • (nodebb)

    If they keep going over multiples of 7 they'll find the meaning of life the universe and everything ... eventually ;)

  • Duston (unregistered)

    The seventh point of the seventh point ...

  • (nodebb)

    You wanna hot tip?

  • Yikes (unregistered)

    Well, I guess that means more Iron Maiden in my playlist for the day.

    Looking at the link Ross posted, it certainly seems like a bit of a mess. Using this site: https://yqnn.github.io/svg-path-editor/ you can paste in this template path that's in the code to see what they're drawing.

    m0.01216 0c-0.01152 0-0.01216 6.103e-4 -0.01216 0.01311v0.007762c0.06776 0.122 0.1799 0.1455 0.2307 0.1455h0.5c0.03046 3.899e-4 0.07964 0.00449 0.1246 0.02636 0.0537 0.02695 0.07418 0.05816 0.08648 0.07769 0.001562 0.002538 0.004539 0.002563 0.01098 0.002563 0.006444-2e-8 0.009421-2.47e-5 0.01098-0.002563 0.0123-0.01953 0.03278-0.05074 0.08648-0.07769 0.04491-0.02187 0.09409-0.02597 0.1246-0.02636h0.5c0.05077 0 0.1629-0.02346 0.2307-0.1455v-0.007762c-1.78e-6 -0.0125-6.365e-4 -0.01311-0.01216-0.01311-0.006444-3.919e-8 -0.009348 2.448e-5 -0.01091 0.002563-0.0123 0.01953-0.03278 0.05074-0.08648 0.07769-0.04491 0.02187-0.09416 0.02597-0.1246 0.02636h-0.5c-0.04786 0-0.1502 0.02094-0.2185 0.1256-0.06833-0.1046-0.1706-0.1256-0.2185-0.1256h-0.5c-0.03046-3.899e-4 -0.07972-0.004491-0.1246-0.02636-0.0537-0.02695-0.07418-0.05816-0.08648-0.07769-0.001562-0.002538-0.004467-0.002563-0.01091-0.002563z

    It should look like a giant curly brace. I'm not sure how things get stored, or what the consider the "tip" to be, but it sure looks like the first point being drawn is more "tippy" than the last point drawn. Then again, maybe by the time it gets drawn it's a closed path, so the first point is the last point...

  • (nodebb)

    The number seven has magical properties in many ancient cultures. Were the comments in Assyrian or Aramaic?

  • (nodebb) in reply to Ross_Presser

    Thanks... See that gives additional context, such as how "center point" was calculated (until it was deprecated and then later removed)

  • akozakie (unregistered)

    Indeed, "neither 34 nor 28 are seven". That's terrible. In my code I always make sure that both 34 and 28 are seven.

  • I'm not a robot (unregistered) in reply to akozakie
    In my code I always make sure that both 34 and 28 are seven.
    You do all arithmetic in Z/3Z ?
  • Kleyguerth (github) in reply to TheCPUWizard

    And it clearly shows it was yet another case of "update the code, but not the comment"...

  • Hawk777 (unregistered)

    It looks like a flattened 2D array to me (in the C sense of a 2D array, all elements sequential, not the array-of-pointers sense). So, in non-OpenGL mode, element 28 IS part of the seventh point, it’s just that each point has four coordinates stashed side by side in the array—so maybe the seventh point stores its X coordinate at 28, Y at 29, Z at 30, and W at 31, or something like that. It’s still the seventh point. That part doesn’t seem like a WTF to me.

    Could it have been done better, using something like a struct, well, maybe, but maybe there isn’t an option to do that with this particular graphics API in Python.

  • Craig (unregistered) in reply to akozakie

    You must be using an old version of Fortran (would have been possible to do this as recently as DVF 5 as I ran into a case where we accidentally redefined 0).

    I think this would do the trick (will hard crash with an access violation in newer compilers that put the constants in read-only memory).

    SUBROUTINE SetToSeven(arg) IMPLICIT NONE

    INTEGER, INTENT(INOUT):: arg

    arg = 7

    END SUBROUTINE

    Then, SetToSeven(34) SetToSeven(28)

Leave a comment on “A Tip”

Log In or post as a guest

Replying to comment #571368:

« Return to Article