Skip to content

Commit

Permalink
Make a folder for shape detection functions
Browse files Browse the repository at this point in the history
  • Loading branch information
David Minnerly committed Apr 30, 2021
1 parent 122de2c commit b2d97ca
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/detectOrientation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
(N, E, S, W).
]]

local isLine = require(script.Parent.isLine)
local isChevron = require(script.Parent.isChevron)
local isLine = require(script.Parent.shapes.isLine)
local isChevron = require(script.Parent.shapes.isChevron)
local Orientation = require(script.Parent.Orientation)

type Array<T> = { [number]: T }
Expand Down
12 changes: 6 additions & 6 deletions src/detectShape.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
local sortCounterClockwise = require(script.Parent.sortCounterClockwise)
local getConvexHull = require(script.Parent.getConvexHull)
local getPolygonArea = require(script.Parent.getPolygonArea)
local isLine = require(script.Parent.isLine)
local isChevron = require(script.Parent.isChevron)
local isCircle = require(script.Parent.isCircle)
local isRectangle = require(script.Parent.isRectangle)
local isSquare = require(script.Parent.isSquare)
local isTriangle = require(script.Parent.isTriangle)
local isLine = require(script.Parent.shapes.isLine)
local isChevron = require(script.Parent.shapes.isChevron)
local isCircle = require(script.Parent.shapes.isCircle)
local isRectangle = require(script.Parent.shapes.isRectangle)
local isSquare = require(script.Parent.shapes.isSquare)
local isTriangle = require(script.Parent.shapes.isTriangle)
local Shape = require(script.Parent.Shape)

local function detectShape(points: {[number]: Vector2})
Expand Down
4 changes: 2 additions & 2 deletions src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ return {
getPolygonArea = require(script.getPolygonArea),
getSideLengths = require(script.getSideLengths),
getTriangleArea = require(script.getTriangleArea),
isLine = require(script.isLine),
isChevron = require(script.isChevron),
isLine = require(script.shapes.isLine),
isChevron = require(script.shapes.isChevron),
sortCounterClockwise = require(script.sortCounterClockwise),
}
2 changes: 1 addition & 1 deletion src/isChevron.lua → src/shapes/isChevron.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local getCornerIndices = require(script.Parent.getCornerIndices)
local getCornerIndices = require(script.Parent.Parent.getCornerIndices)

type Array<T> = { [number]: T }

Expand Down
2 changes: 1 addition & 1 deletion src/isCircle.lua → src/shapes/isCircle.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local getPerimeter = require(script.Parent.getPerimeter)
local getPerimeter = require(script.Parent.Parent.getPerimeter)

local function fuzzyeq(a, b, epsilon)
return math.abs(a - b) <= epsilon
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/isRectangle.lua → src/shapes/isRectangle.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local getBoundingBox = require(script.Parent.getBoundingBox)
local getSideLengths = require(script.Parent.getSideLengths)
local getBoundingBox = require(script.Parent.Parent.getBoundingBox)
local getSideLengths = require(script.Parent.Parent.getSideLengths)

local RECTANGLE_PERCENT = 0.75

Expand Down
4 changes: 2 additions & 2 deletions src/isSquare.lua → src/shapes/isSquare.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local getBoundingBox = require(script.Parent.getBoundingBox)
local getSideLengths = require(script.Parent.getSideLengths)
local getBoundingBox = require(script.Parent.Parent.getBoundingBox)
local getSideLengths = require(script.Parent.Parent.getSideLengths)

local SQUARE_PERCENT = 0.60

Expand Down
4 changes: 2 additions & 2 deletions src/isTriangle.lua → src/shapes/isTriangle.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local getLargestTriangle = require(script.Parent.getLargestTriangle)
local getTriangleArea = require(script.Parent.getTriangleArea)
local getLargestTriangle = require(script.Parent.Parent.getLargestTriangle)
local getTriangleArea = require(script.Parent.Parent.getTriangleArea)

local TRIANGLE_PERCENT = 0.75

Expand Down

0 comments on commit b2d97ca

Please sign in to comment.