Workflow for Using Bezier Curves with Core Animation

I recently worked on a project that made extensive use of Core Animation. The results were pretty good. Ideally, I would use bezier layers and curves for movement.

Does anyone have a good workflow for creating data points that are then used to create a curve? I got a little lost from control points. Conceptually, I understand what is happening.

Is there any third-party software that will allow you to visually create a Bezier curve and then export it to a text file for inclusion in the source code?

+4
source share
2 answers

This is probably not as easy as you are looking for, but OmniGraffle exports its scenes to XML, assuming you are not compressing them. If you know Python or some other xml-enabled scripting language, just parse the XML to get the bezier values โ€‹โ€‹in it. I use this approach to create Bezier CoreAnimation toolpaths and it works well.

So, roughly what I am doing:

  • Create a link rectangle in OmniGraffle with the same pixel size as your display

  • Draw some Bezier curves.

  • Save the file as XML (make sure compression is disabled - in the palette somewhere)

  • Using python / XML parses curve data from a saved scene file
  • Save a more convenient xml resource file for your application to read.
  • Enter the code in the application to download XML and create CoreAnimation curves using bezier values โ€‹โ€‹from the file
+1
source

Freely http://inkscape.org/ supports XML editing capabilities compatible with the SVG format http://www.w3.org/Graphics/SVG/

It allows you to draw bezier and export their parameters.

+1
source

All Articles