Vector Editor Sources to look at various features lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2023-07-05 05:50 I came across some nice vector editor programs with sources on Github for people into graphics programming that would like to learn about vector graphics. I am hoping that people like myself will look at the codes and see how things work and perhaps add extra features and extra shapes (Like right angle and isosceles triangles, rhombi, kites, etc). Also resize but keep proportions. Would anyone have some sources that show how to rotate a shape by dragging it's bounding corner (similar to lazPaint? or Wick Editor = animator) Vector editor (school project) This has rotation about the centroid. Rotation point can be changed to another position Change thickness of lines and colours Can move and resize shapes. Change ZOrder of graphics. Peter Koscelanský Slovakia https://github.com/koscelansky/veditor If you know of any other Vector Editor source please add them to this thread. ---------------------------------------------------------------------- Boleeman · 2023-07-05 05:57 VecDraw This seems like it is a new version of the Dynnu Vector Editor. The Dynnu Vector Editor draws a bit inconsistently, whereas this vector graphics program draws much more smoothly. Vector graphics editor written using only standard libs Nice polygon draw with rotate as you draw (after draw can select with marquee tool and change the no. of sides) Fill shapes Different draw line styles No rotation of rectangle shape ZOrder Select multiple shapes and set the same colour fill, line thickness Save to BMP (it saves to the bounds of the shapes so if 2 shapes it would save to the bounds of the 2 shapes) Move (1st select with marquee tool and then select Arrow tool and click and drag from within shape) Resize (1st select with marquee tool and then select Arrow tool and click the bounding points) Yury Kurlykov https://github.com/t1meshift ---------------------------------------------------------------------- Boleeman · 2023-07-05 06:04 Papergrapher Not Lazarus but Javascript with some nice features. Would be nice to use the javascript api to add similar color features to bgraBmp. Also would be nice to see the Clouds feature and the parallel lines feature implemented in Lazarus. I did a parallel lines program in VB6 using just straight line segments. https://github.com/paulgb/papergrapher Vector Editor based on Paper.js A working version can be found at https://w00dn.github.io/papergrapher/ This has color blending Can adjust the opacity/transparency Parallel line draw Cloud draw ---------------------------------------------------------------------- Boleeman · 2023-07-05 06:09 Dynnu Vector Editor (old style?) https://github.com/boriswinner/Dynnu Vector Editor for regular Polygons, straight lines and ellipses. This has features like: Selecting the bounds of a regular polygon when the shape is clicked after selecting the move tool (the pentagon in the screen shot illustrates what I mean). Rotating a regular polygon while drawing it. Moving a polygon (translating it) and rotating it manually. Drawing a FreeHand polygon line Border thickness and color section Various fill options for the shapes. Drawing Regular Polygons, rectangles, straight lines, ellipses. The workspace is a bit small. ---------------------------------------------------------------------- Boleeman · 2023-07-05 09:42 Adding line types in a combo was done in a thread on this forum, so I thought I would add it here as well. ---------------------------------------------------------------------- zamtmn · 2023-07-05 11:32 https://github.com/zamtmn/zcad although it is called СAD, but in fact it is also a vector graphics editor ---------------------------------------------------------------------- lainz · 2023-07-05 13:20 LazPaint is a vector graphics as well. ---------------------------------------------------------------------- Boleeman · 2023-07-05 14:17 Thanks for the extra additions. Found another one. A pascal script that rounds the corners (used to make round corners for pcb circuits) Round Polygon Corners Iterates through each polygon and make it corners round. It is in Pascal https://github.com/zharovdv/RoundPolygonCorners Was interested in making Round Regular Polygons but this is a JavaScript solution https://github.com/weareoutman/rounded-polygon https://github.com/iTURTL3/rounded-polygons star like in js https://github.com/absently/rounded-polygon in css js (Cool) https://github.com/Afif13/CSS-rounding-shapes and in cpp https://github.com/szakosevi/polygonRoundness and in csharp https://github.com/cppfever/RoundPolygon ---------------------------------------------------------------------- Boleeman · 2023-07-05 22:35 Hopefully the above listed programs might help out others. Years ago I created a number VB6 programs that draw line segments, rectangles, circles, regular polygons, but could never get to the stage of making them vector (moveable). I really love the Lazarus examples that I have found, but realized I need to go back a few steps like working out how to store point locations, store shape properties, select parts of them (select endpoint, bounding point, line, region inside) and lastly how to modify the points with translations and rotations. I know then basics of creating shape primitives is to create some arrays to store the point locations in a certain shape pattern. The next part is where I need to get a better understanding of storing the points and changing locations and properties. Work in progress. I tend to look at different parts and modify things slightly to see what happens. LazPaint is really good, but too complex (has too many parts to it) so I was looking for a barebones example. I thought of looking at the beta versions of the programs that I found as a starting point. Would anyone from the BgraBmp team be able to make a sample barebones vector program? That uses a BGRABmp and: Creates line segments Creates rectangles Modify position and size of these Changes properties of these (colour , thickness, style) I understand that it probably is a bit of work, so if it can't be done that's OK. I just thought it might help out some beginners like me trying to get to the next stage of understanding of creating and storing points of vector polygons. ---------------------------------------------------------------------- lainz · 2023-07-06 00:11 Ask @circular the author of bgrabitmap. If I remember correctly there was a separate project of vector editor that then was incorporated into lazpaint. ---------------------------------------------------------------------- Boleeman · 2023-07-06 00:35 Thanx Lainz. Feel a bit awkward asking circular as I don't know him too well. I have been looking at the very first version source of VecDraw at https://github.com/t1meshift/VecDraw/releases?page=34 There are a staggering 34 GitHub Pages of releases of VecDraw! ---------------------------------------------------------------------- circular · 2023-07-06 12:41 Hi there. You're welcome to ask me about things.  The vector project is here: https://github.com/bgrabitmap/lazpaint/tree/master/vectoredit ---------------------------------------------------------------------- Boleeman · 2023-07-07 00:45 Many Thanks Circular (and Lainz). I appreciate the files, as I have always wanted to learn more about vector editors and how they store and modify properties and points. I downloaded the source files and installed the lazpaintcontrols and came up with an error in vectoredit.lpr at the line containing {$I vectorimages.lrs} and in particular $I I commented that out and got the basic Vector edit version to run (with heap errors at termination). I realize as this is an early version that there would be some problems (I downloaded the lazpaint-master.zip file from https://github.com/bgrabitmap/lazpaint/tree/master so as it was the latest probably there may be some backward compatibility problems). Quote  You're welcome to ask me about things. Thank you for helping me out. Just realised in the lazpaint "Clouds : add clouds of the current pen color" Not like in papergrapher https://github.com/paulgb/papergrapher A working version can be found at https://w00dn.github.io/papergrapher/ )but will have to play around with it. ---------------------------------------------------------------------- circular · 2023-07-07 08:02 You're welcome. The resource file is in another folder of lazpaint repository: https://github.com/bgrabitmap/lazpaint/tree/master/resources Note : to rotate shapes in VectorEdit, do as in LazPaint, right click on the corner of a shape. Papergraph has an interesting cloud tools indeed. ---------------------------------------------------------------------- Boleeman · 2023-07-25 07:51 Found a nice move and resize line segments code. Originally in Delphi and now converted to Lazarus. Set the number of lines and the line selection tolerance. Kinda cool  and wanted to share. I wonder:  .....  How could multi-select and move be implemented? ---------------------------------------------------------------------- zamtmn · 2023-07-25 08:30 There are many examples of simple vector programs on the web. And often they let newcomers go the wrong way because of their simplicity. Any vector graphics should start with matrices mathematics and tree- like graphics entities data organization. ---------------------------------------------------------------------- Boleeman · 2023-07-26 07:06 Wanted to build on a basic example of moving and resizing line segments and work up to matrices and tree like structures.Got to start somewhere. ---------------------------------------------------------------------- Boleeman · 2023-08-21 12:31 Another Vector Paint Editor recently found (in Russian). https://github.com/bravesoftdz/VectorPaint Select Code, Download zip Enjoy.