-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.pug
110 lines (104 loc) · 3.75 KB
/
index.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
extends layout.pug
mixin feature(args)
h2= args.title
div
+interactive(args.gist)
div
p
= '\\(' + args.bigo + '\\)'
if args.wiki
|
| |
|
a(href=args.wiki) wiki
if args.gist
|
| |
|
a(href='playground.html?gist='+args.gist) play
if args.api
|
| |
|
a(href='https://docs.rs/rgeometry/latest/rgeometry/' + args.api) api
if args.paper
|
| |
|
a(href=args.paper) paper
div
block
mixin interactive(gist)
iframe(src='https://web.rgeometry.org/wasm/gist/' + gist)
block content
article
p
b RGeometry
|
| is a collection of data types such as points, polygons, lines, and segments, and a variety
| of algorithms for manipulating them. This crate will be of use to you if you've ever wondered
| if a point is inside a polygon or if a bank is adequately covered by surveillance cameras.
p
b FAQ:
dl
dt Does RGeometry support 3D objects?
dd Yes, but most of the algorithms are 2D only.
dt Can I compile RGeometry to JavaScript?
dd Yes, that is how the playground and all the interactive examples work.
dt Any relation to <a href="https://hgeometry.org">HGeometry?</a>
dd Yes, there is overlap in both developers and key concepts.
p
| Geometry is inherently visual and the quickest way to intuitively understand this
| library is to see it in action. Below are interactive examples of most of the algorithms.
article#triangulate.feature
+feature(
{title: "Triangulation"
,bigo: "O(n \\log n)"
,wiki: "https://en.wikipedia.org/wiki/Polygon_triangulation"
,gist: "24c470c1f33ec67af9ff3fe6dba6ccdf"
,api: "algorithms/triangulation/earclip/index.html" })
p
| Earclipping with geometric hashing is expected to run in near-linear time and
| in practice performs better than more advanced algorithms with lower worse-case
| complexity bounds.
article#convex-hull.feature
+feature(
{title: "Convex Hull"
,bigo: "O(n \\log n)"
,wiki: "https://en.wikipedia.org/wiki/Graham_scan"
,gist: "eac484cd855d001815d23a053919b5ca"
,api: "algorithms/fn.convex_hull.html" })
p
| Graham's scan implementation for finding the convex hull of a set of points.
article#two-opt.feature
+feature(
{title: "Random Polygons"
,bigo: "O(n^4)"
,wiki: "https://en.wikipedia.org/wiki/2-opt"
,gist: "298f1415a05cba9f7a0ad6832b7b4c9d"
,api: "algorithms/polygonization/fn.two_opt_moves.html" })
p
| No matter how you move the points around, the polygon is always be valid and have
| no self-intersections.
article#random-monotone.feature
+feature(
{title: "Random Monotone Polygons"
,bigo: "O(n \\log n)"
,wiki: "https://en.wikipedia.org/wiki/Monotone_polygon"
,gist: "c038ccb90a21f8ebe14f17167b85d2ce"
,api: "algorithms/monotone_polygon/fn.new_monotone_polygon.html" })
p
| Monotone polygons has at most two intersections when sliced at a given
| angle. They are used for their properties in many algorithms, and random
| generation is vital for automated testing.
article#random-convex.feature
+feature(
{title: "Random Convex Polygons"
,bigo: "O(n \\log n)"
,wiki: "https://en.wikipedia.org/wiki/Convex_polygon"
,gist: "037a23f8391390df8560a2043a14121e"
,api: "data/struct.PolygonConvex.html#method.random" })
p
| Unlike regular polygons, convex polygons can be efficiently sampled without bias.
| Mostly useful for testing.
| Adjust the slider to control the number of vertices.