SGV and FE funding of widgets

Mark Waddingham mark at livecode.com
Fri Oct 30 12:22:16 EDT 2015


On 2015-10-30 14:26, Matt Maier wrote:
> If it turns out that you can return a "normalized" SVG path does that 
> mean
> we might be able to do some vector operations in script. Like
> separating/joining two different shapes/paths, or adjusting the control
> points of a shape?

I meant to actually put a footnote into that post to explain what 
normalized meant in this context...

SVG paths have various commands which are not part of the 'standard' 2d 
vector path model - in particular arcs and relative commands. The code 
we have parses them all, but they get 'normalized' to 
moveto/lineto/quadcurveto/cubiccurveto/closepath thus setting an svgpath 
and getting it again will not necessarily roundtrip.

Anyway, in terms of your actual question - you will be able to 
manipulate the svg paths as strings - so you'll be able to build paths 
up out of subpaths, and modify elements of them (by modifying the 
string) certainly.

In terms of 'vector operations' - if you mean things like union / 
intersection / difference of paths then that is a lot harder. That being 
said, I do think Skia has added some 'PathOps' abilities for such things 
which we can look into leveraging. It would be nice to be able to do 
things like:

   union svg path tFoo with svg path tBar
   intersect svg path tFoo with svg path tBar

At some point.

In regards to editing the control points of a shape - then you can do 
that with polygonal points of graphics now (right click menu on a 
graphic IIRC, or you can set the 'editMode' of the graphic). We'd 
certainly look at extending the editTool so curves can also be edited in 
this way.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list