Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non convex polygons #31

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c2ec0fa
add tests
MilicaSelakovic Dec 11, 2016
298ec09
Made a triangulation function (that does nothing for now).
Ahhhhmed Dec 12, 2016
eac57b4
added triangulation
Ahhhhmed Dec 13, 2016
eb0b346
changed import in Point.hs and Vector.hs
Ahhhhmed Dec 13, 2016
c55a11f
removed DCEL
Ahhhhmed Dec 18, 2016
68dc0ff
implemented makeInitialVertexSet, insertVertices, getVertex
Ahhhhmed Dec 18, 2016
eda8566
implemented initalEventSet, event,
Ahhhhmed Dec 18, 2016
7bee0d7
implemented traverseVertices
Ahhhhmed Dec 18, 2016
2c236b1
change graph representation from set to map (dictionary)
Ahhhhmed Dec 21, 2016
b33733b
implemented accumulatorFunction
Ahhhhmed Dec 21, 2016
10ca1d8
fixed start end edge point in event
MilicaSelakovic Dec 22, 2016
6022fd9
added trace
MilicaSelakovic Dec 26, 2016
3efa41e
polygonGraph debuged.
Ahhhhmed Dec 27, 2016
cf6c0c0
pointsPositiveOrientation utility function added.
Ahhhhmed Dec 27, 2016
7fc73bd
implemented traversePolygonGraph function.
Ahhhhmed Dec 27, 2016
0325008
implemented makeXMonoton function.
Ahhhhmed Dec 29, 2016
32ec539
triangulate function started.
Ahhhhmed Dec 29, 2016
8153627
triangulate function started.
Ahhhhmed Dec 29, 2016
5b445af
finished implementing triangulate function.
Ahhhhmed Dec 29, 2016
4b90356
added false Point compare and fixed bug
MilicaSelakovic Jan 1, 2017
34972ec
Added comments to all the functions.
Ahhhhmed Jan 3, 2017
1f8d118
Changed test polygon.
Ahhhhmed Jan 3, 2017
b9f0ade
fixed bug
MilicaSelakovic Jan 3, 2017
1307a50
Renamed few functions and added comments to them.
Ahhhhmed Jan 9, 2017
7eece1a
Updated test example.
Ahhhhmed Jan 9, 2017
c30e26e
resolved merge conflict
MilicaSelakovic Jan 9, 2017
f303933
traversePolygonGraph reworked.
Ahhhhmed Jan 10, 2017
8aee65c
fixed bug with vertical edges
MilicaSelakovic Jan 10, 2017
5f3ef5b
mergde
MilicaSelakovic Jan 10, 2017
3acc2bc
Merge branch 'NonConvexPolygons' of https://github.com/MilicaSelakovi…
MilicaSelakovic Jan 10, 2017
2408340
fixed last commit adds
MilicaSelakovic Jan 10, 2017
dcd7376
removed dist foldrs
MilicaSelakovic Jan 11, 2017
77a357c
delete extra files.
Ahhhhmed Jan 14, 2017
a046bf3
rename prism to test.
Ahhhhmed Jan 14, 2017
d9dcc2d
Add module output functions.
Ahhhhmed Jan 14, 2017
56ec7df
Reverse space changes in Picture.hs file.
Ahhhhmed Jan 14, 2017
5f3f633
Remove "Utility function" from comments
Ahhhhmed Mar 5, 2017
12bc5d9
Added comments that describing the algorithm
Ahhhhmed Mar 5, 2017
a25562f
Added scaling of Polygon
Ahhhhmed Mar 5, 2017
35bd7d9
Fit code in 100 columns
Ahhhhmed Mar 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gloss/Graphics/Gloss/Data/Picture.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Graphics.Gloss.Data.Picture
where
import Graphics.Gloss.Rendering
import Graphics.Gloss.Geometry.Angle

import Graphics.Gloss.Geometry.Triangulation

-- Constructors ----------------------------------------------------------------
-- NOTE: The docs here should be identical to the ones on the constructors.
Expand All @@ -39,8 +39,9 @@ blank :: Picture
blank = Blank

-- | A convex polygon filled with a solid color.
-- Triangulate so non-convex polygons can be drawn properly.
polygon :: Path -> Picture
polygon = Polygon
polygon = pictures . triangulate

-- | A line along an arbitrary path.
line :: Path -> Picture
Expand Down
3 changes: 2 additions & 1 deletion gloss/Graphics/Gloss/Data/Point.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Graphics.Gloss.Data.Point
( Point, Path
, pointInBox)
where
import Graphics.Gloss.Data.Picture
--import Graphics.Gloss.Data.Picture
import Graphics.Gloss.Rendering


-- | Test whether a point lies within a rectangular box that is oriented
Expand Down
3 changes: 2 additions & 1 deletion gloss/Graphics/Gloss/Data/Vector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module Graphics.Gloss.Data.Vector
, normalizeV
, unitVectorAtAngle )
where
import Graphics.Gloss.Data.Picture
--import Graphics.Gloss.Data.Picture
import Graphics.Gloss.Rendering
import Graphics.Gloss.Geometry.Angle


Expand Down
5 changes: 3 additions & 2 deletions gloss/Graphics/Gloss/Geometry.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

module Graphics.Gloss.Geometry
( module Graphics.Gloss.Geometry.Angle
, module Graphics.Gloss.Geometry.Line )
, module Graphics.Gloss.Geometry.Line
, module Graphics.Gloss.Geometry.Triangulation )
where
import Graphics.Gloss.Geometry.Angle
import Graphics.Gloss.Geometry.Line
import Graphics.Gloss.Geometry.Triangulation
Loading