Ipelets for IPE in lua
It draws a single arrow to create a step arrow diagram using two points and some UI entries.
To-dos for StepArrowDiagram
- Replace the diagonal line through a rectangular boundary box
- Restructure the geometry generation and dialogue code
- Add checkbox to switch pathmode between filled and stokedfilled
- Add functionality to create more than one arrow at once
- Read attributes from the stylesheet
- Create default colour themes
- Add different step arrow diagram styles
It draws circular arrows to create a step arrow diagram using two points and some UI entries.
To-dos for StepArrowDiagram
- Create the Ipelet
A simple code showed how to create a fully functional custom tool for IPE. It makes a rectangle using two points. A line shows the diagonal of the future rectangle during drawing.
- To install the Ipelets, copy the lua file into the
~/.ipe/ipelets
folder. If you have installed the flatpak version of Ipe, copy the lua files into~/.var/app/org.otfried.Ipe/.ipe/ipelets
. - To enable the quick reload tool create a
prefs.lua
file inside theipelets
folder. Then add the lineprefs.developer = true
to the file. It will appear in the ```Help/Developer ``menu. - To fix the text editor default size of Ipe add
prefs.editor_size = { 1000, 600 }
toprefs.lua
. self.finish()`` needs to be called before
self.model:creation```- All methods are necessary except the
self:compute()
- Be careful when using global variables! Some important already used global variable names are:
name
,path
,dllname
,_G
,ipe
,ipeui
,math
,string
,table
,assert
,shortcuts
,prefs
,config
,mouse
,ipairs
,pairs
,print
,tonumber
,tostring
! self.model:creation()
takes a string and aipe.Object
as parameters. Anipe.object
, for example, is anipe.Path
or aipe.Groupe
.ipe.Objects
need shapes. Shapes are just lua lists and must be created manually because there is noipe.Class
. Also, ```ipe. Segments `` do not work to create a shape!
local shape = { type="curve", closed=true;
{ type="segment"; V(self.p1.x, self.p1.y), V(self.p1.x, self.p2.y) },
{ type="segment"; V(self.p1.x, self.p2.y), V(self.p2.x, self.p2.y) },
{ type="segment"; V(self.p2.x, self.p2.y), V(self.p2.x, self.p1.y) },
{ type="segment"; V(self.p2.x, self.p1.y), V(self.p1.x, self.p1.y) } }