There is no documentation on the VEC files found in PCLX files. PCLX is an internal format and is not meant to be used with anything else. You can look at the source code for writing these files here. The format is similar to SVG and if you are familiar with that format than you can probably guess how most of it works from looking at examples.
It’s been a while since I’ve seen you around. It’s great to find you well
As for the reference details for XML & VEC files, As Scribblemaniac mentioned we currently don’t have a comprehensive document other than the source code constructs
I was preparing my answer last night but Scibble beat me to it anyway, I believe the actual C++ files have enough information to create one, we’re simply lacking a bit of time I’m afraid
For example:
The following class method is the one that apparently writes the final XML file in execution order:
It will call other methods and objects including the Pencil2D “object” representation which (I believe, but could be mistaken) holds the data itself for all the the Pencil2D document data that will be written or read later (basically layers, frames, and configuration as far as I can tell).
The XML data is managed by calling specific layer types methods to append the data such as:
Camera Layer
Sound Layer
Bitmap Layer
Vector Layer
And related to Vectors, the VectorImageclass method below is the one that writes the VEC files in execution order (which Scribble also linked):
From that there are other internal files that are called by to comform the VEC file such as bezierarea.cpp & beziercurve.cpp which have the familairc createDomElement methods to write down the specific attributes for how the vector shapes are represented in Pencil2D and the VEC specification.
BezierArea
BezierCurve
Honestly answering this helped me understand better how this works, but I’m sure I’m still missing files, so If I find something else I’ll share the information here. Cheers!
The format of .VEC is a vector file format which is pre the definition of the SVG standard.
The only line type is a Cubic Bezier curve. There is no provision for even straight lines. You can however in practice get straight lines by defining an extra control point and then move this so that is at the same location as the corner point.
When drawing a square you add an extra point on the first 3 sides. You don’t need to do this on the forth side because the same effect can be acheived by placing the start and finish points on top of each other.
In rhe case of straight sided shapes, you need to fill them before adjusting the control points as outlined above.
Below are some example animations using Pencil2D Vector Graphics.