Skip to content

Commit e084c6a

Browse files
committed
update precompiles
1 parent da91216 commit e084c6a

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
99
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
1010
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
1111
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12+
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1213
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1314

1415
[compat]

src/GeometryBasics.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ export max_dist_dim, max_euclidean, max_euclideansq, min_dist_dim, min_euclidean
6464
export min_euclideansq, minmax_dist_dim, minmax_euclidean, minmax_euclideansq
6565
export self_intersections, split_intersections
6666

67-
if Base.VERSION >= v"1.4.2"
67+
if Base.VERSION >= v"1.8"
6868
include("precompiles.jl")
69-
_precompile_()
7069
end
7170

7271
end # module

src/precompiles.jl

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
1+
using PrecompileTools: @setup_workload, @compile_workload
12

2-
function _precompile_()
3-
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
4-
Point2f(0.5, 0.1) in Triangle(Point2f(0), Point2f(0.5, 1), Point2f(1, 0))
5-
decompose(GLTriangleFace, [Point2f(0), Point2f(0.5, 1), Point2f(1, 0)])
3+
@setup_workload begin
4+
@compile_workload begin
5+
# Hits FaceView, QuadFace, all standard decompose's, some type conversions
6+
r = Rect3d(Point3d(0), Vec3d(1))
7+
m1 = uv_normal_mesh(r)
8+
9+
c = Circle(Point2f(0), 1)
10+
m2 = uv_normal_mesh(c, pointtype = Point3f) # hits normal gen
11+
12+
m = merge([m1, m2]) # hits mixed path, clear_faceviews, then normal path
13+
GeometryBasics.split_mesh(m)
14+
Rect3d(m)
15+
16+
# Getters
17+
vertex_attributes(m)
18+
coordinates(m)
19+
normals(m)
20+
texturecoordinates(m)
21+
faces(m)
22+
23+
face_normals(coordinates(r), faces(r))
24+
25+
# Triangulation
26+
triangle_mesh(Polygon(rand(Point2f, 4)))
27+
28+
# Other primitives
29+
uv_normal_mesh(Rect2(0,0,1,1))
30+
uv_normal_mesh(Tesselation(Sphere(Point3f(0), 1f0), 3))
31+
uv_normal_mesh(Cylinder(Point3f(0), Point3f(0,0,1), 1f0))
32+
uv_normal_mesh(Pyramid(Point3f(0), 1f0, 1f0))
33+
34+
# other disconnected compiles
35+
M = Mat3f(I)
36+
inv(M)
37+
M[1, Vec(1, 3)]
38+
M * Vec(1,2,3)
39+
end
640
end

0 commit comments

Comments
 (0)