Giter Club home page Giter Club logo

curvaturevisualizator's Introduction

Curvature Visualizator

curvature

I must give credit to the amazing Primer on Bézier curves and SpeedPunk, as they were instrumental in creating this repository. Although it may appear similar, the code is tailored specifically to its creator, making it more intuitive to use. Additionally, it only operates within the RoboFont environment, which simplifies the process. Thanks to this, incorporating support for quadratic curves was a straightforward task, unlike SpeedPunk, which currently lacks this feature.

How does it work?

Basically, it adds a checkbox button to the Display… menu of the Glyph Edit Window.

menu_item

All you need to do is activate it.

You can access more options by clicking on the options button located in the bottom-right corner of the Glyph Edit Window.

Visualization Size controls how big the curvature representation is going to be.

Visualization Type lets you decide which side of the outline will have its representation.

Zoom visualization is a cool feature which will scale the whole curvature representation together with the zoom factor of your Glyph Edit Window.

To access additional settings, navigate to the Settings menu button under Extensions > Curvature Visualizator.


Maybe it is pointless or unnescessary, but I would like to share my opinion on the tools like these:

  • Remember, this is no more and no less the tool.
  • You should always use your own judgement whenever you are creating. Making every curvature "smooth" without the slightest brainwork will probably reflect in boring or repetitive designs.
  • You should know your tool; you should understand what it does. And, I think, you should control it and not let it control you.
  • Have fun using it. :)

curvaturevisualizator's People

Contributors

rafalbuchner avatar ryanbugden avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ryanbugden

curvaturevisualizator's Issues

Traceback when changing Division Steps

!!!???self.bgBaseLayer <Base name=None at=4768224160>
!!!!!>>>>>>> self.pen <curvatureVisualizator.curvatureGlyph_merz.CurvaturePen object at 0x13846eb20>
!!!!!>>>>>>> self.showMe True
AAA
Observer '<curvatureVisualizator.curvatureVisualizatorSubscriber.CurvatureVisualizatorSubscriber object at 0x11c3898e0>' with 'extensionDefaultsChanged' failed: list index out of range
Traceback (most recent call last):
  File "lib/eventTools/eventManager.pyc", line 165, in callObserver_withMethod_forEvent_withInfo_
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 181, in extensionDefaultsChanged
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 65, in loadDefaults
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/displaySubscriber.py", line 49, in showMe
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 91, in toggleOn
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 237, in drawPath
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontParts/base/glyph.py", line 630, in draw
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontParts/base/contour.py", line 172, in draw
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontParts/base/contour.py", line 180, in _draw
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontParts/base/contour.py", line 188, in drawPoints
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontParts/base/contour.py", line 213, in _drawPoints
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontTools/pens/pointPen.py", line 172, in endPath
  File "/Applications/RoboFont-4_4p.app/Contents/Resources/lib/python3.9/fontTools/pens/pointPen.py", line 249, in _flushContour
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureGlyph_merz.py", line 313, in curveTo
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/deriverateLib.py", line 245, in drawCurvatureVisForCurve_merz
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/deriverateLib.py", line 251, in polygon
IndexError: list index out of range

Along with this, Division Steps doesn't look like it always affects what's showing in Glyph Editor.

`NotImplementedError` Traceback in Glyph with Components

I don't think this tool should support components, but it gets a "Not Implemented" error with the pen if there is a glyph with a component:

Traceback (most recent call last):
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/vanilla/vanillaBase.py", line 520, in action_
  File "/Users/colinmford/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/displaySubscriber.py", line 59, in _menuItemCallback
  File "/Users/colinmford/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 242, in menuButtonWasPressed
  File "/Users/colinmford/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/displaySubscriber.py", line 49, in showMe
  File "/Users/colinmford/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 91, in toggleOn
  File "/Users/colinmford/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 237, in drawPath
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontParts/base/glyph.py", line 633, in draw
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 251, in draw
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 259, in _draw
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 265, in drawPoints
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 276, in _drawPoints
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontTools/pens/pointPen.py", line 264, in addComponent
  File "/Applications/RoboFont.app/Contents/Resources/lib/python3.9/fontTools/pens/basePen.py", line 133, in addComponent
NotImplementedError

Settings menu item goes away

image

The extension doesn't show up in the Extensions menu after some use. Unknown cause but here's a traceback. Maybe having to do with being on a glyph with a component?

Observer '<curvatureVisualizator.curvatureVisualizatorSubscriber.CurvatureVisualizatorSubscriber object at 0x1151493a0>' with '_glyphEditorDidSetGlyphInternalCallback' failed: 
Traceback (most recent call last):
  File "lib/eventTools/eventManager.pyc", line 165, in callObserver_withMethod_forEvent_withInfo_
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/mojo/subscriber.py", line 1766, in _glyphEditorDidSetGlyphInternalCallback
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/mojo/subscriber.py", line 1676, in _roboFontCallback
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/mojo/subscriber.py", line 3371, in start
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/mojo/subscriber.py", line 3388, in fire
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/mojo/subscriber.py", line 1694, in _roboFontCoalescerCallback
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 200, in glyphEditorDidSetGlyph
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/CurvatureVisualizator.roboFontExt/lib/curvatureVisualizator/curvatureVisualizatorSubscriber.py", line 235, in drawPath
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontParts/base/glyph.py", line 633, in draw
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 251, in draw
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 259, in _draw
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 265, in drawPoints
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontParts/base/component.py", line 276, in _drawPoints
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontTools/pens/pointPen.py", line 264, in addComponent
  File "/Applications/RoboFont-4_5b2.app/Contents/Resources/lib/python3.9/fontTools/pens/basePen.py", line 133, in addComponent
NotImplementedError

Visualization Size slider in settings could be more continuous

Currently with the settings window open, the Visualization Size slider only updates in Glyph Editor on mouse-up.

The one in the GE curvature options button is more responsive, albeit a little slow because of the printouts in Output Window.

I get this printout too.

!!!???self.bgBaseLayer <Base name=None at=4768224160>
!!!!!>>>>>>> self.pen <curvatureVisualizator.curvatureGlyph_merz.CurvaturePen object at 0x112dbfb50>
!!!!!>>>>>>> self.showMe True
AAA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.