๐Ÿ“ฆ Bigfoot71 / GeoMan

Geometric library for Lua

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/Bigfoot71/GeoMan.git
HTTPS git clone https://github.com/Bigfoot71/GeoMan.git
SSH git clone git@github.com:Bigfoot71/GeoMan.git
CLI gh repo clone Bigfoot71/GeoMan
Le Juez Victor Le Juez Victor Update README.md 2d000e9 2 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ GeoMan
๐Ÿ“ love2d-exmple
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Project not maintained

This project will no longer be updated, if you need a Lua library for polygons you can use PolyMan which will be more suitable.

GeoMan

GeoMan is a geometry library written in Lua that allows you to generate shapes, do collision tests, cut concave shapes into convex shapes and get lots of other useful data.

Why did I do this ?

I started this project from that of AlexarJING and I gradually added features until giving this library.

Other mentions

I also included the library polypartition originally written by ivanfratric then rewritten by apicici in MoonScript for his program pathfun-editor.

There is also a Lua rewrite of the simplify-js module to simplify polygons. I published the Lua port alone here.

List of functions

ellipse (x,y,rx,ry,seg) circle (x,y,s,seg) hexagon (x,y,r) lozenge (x,y,w,h) random (count, size) keepMidPoints (points, keepOlds) getSegDist (x,y, x1,y1,x2,y2) simplifyPoly (points, tolerance, highestQuality) getPolyArea (verts) getPolyDimensions (verts) getPolyLength (verts, isLine) convexHull (verts) concaveHull (verts) translate (x,y, rot, size, verts) newTranslated (x,y, rot, size, verts) getMiddle (x1,y1, x2,y2) getDist (x1,y1, x2,y2) getAngle (x1,y1, x2,y2, toggle) setPolyPosition (points, x,y, isCenter) isPolySelfIntersect (verts) isPolysIntersect_AABB (verts1, verts2) isPolysIntersect (verts1, verts2) isPolyInPoly (verts1, verts2, entirely) isPointInPoly (x,y, verts) isCircleInPoly (x,y,r, verts, isOut) isCircleOutPoly (x,y,r, verts) isCircleInCircle (x1,y1,r1, x2,y2,r2, repos) isCircleOutCircle (x1,y1,r1, x2,y2,r2, repos) isTrisIntersect (tri1, tri2) isPointInTri (x,y, triangle) getPolysSharedEdges (verts1, verts2) isPolysAdjacents, (verts1, verts2, getAdj, round_v) getTriArea (triangle) getTriCenter (triangle) getAdjacentTris (index, triangles) isBetween (x,y, x1,y1,x2,y2) linesIntersect (x1,y1,x2,y2, x3,y3,x4,y4) isSegmentsOverlap (x1,y1,x2,y2,x3,y3,x4,y4) nearestPoint (x,y, points) lineCross (x1,y1,x2,y2, x3,y3,x4,y4) polybool (p1,p2, operator, getMostVerts) convexpart (verts)