Fichiers XML et VEC

Bonjour

Ou peut on trouver le détail des éléments que l’on trouve dans les fichiers XML et VEC contenus dans le conteneur PCLX ?

Bonne continuation et bon courage pour le développement de cet excellent programme. Merci


Where can we find the details of the elements found in the XML and VEC files contained in the PCLX container?

Good continuation and good luck for the development of this excellent program.

1 Like

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.

1 Like

Salut!

It’s been a while since I’ve seen you around. It’s great to find you well :smile:

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 :thinking:

I was preparing my answer last night but Scibble beat me to it :laughing: anyway, I believe the actual C++ files have enough information to create one, we’re simply lacking a bit of time I’m afraid :sweat_smile:

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.

Furry_Dice.pclx (169.6 KB)

2_Balls.pclx (8.9 KB)

Duck-2.pclx (37.9 KB)

If you have any questions about the .VEC format, you can ask me!

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.