Skip to content

Commit

Permalink
rename Tesselation -> Tessellation
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Nov 4, 2024
1 parent 4c4d7e3 commit aab450d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion RPRMakie/examples/makie_example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using FileIO, Colors
using RPRMakie
RPRMakie.activate!(iterations=200)
earth = load(Makie.assetpath("earth.png"))
m = uv_mesh(Tesselation(Sphere(Point3f(0), 1.0f0), 60))
m = uv_mesh(Tessellation(Sphere(Point3f(0), 1.0f0), 60))
f, ax, mplot = Makie.mesh(m; color=earth)
Makie.mesh!(ax, Sphere(Point3f(2, 0, 0), 0.1f0); color=:red)
x, y = collect(-8:0.5:8), collect(-8:0.5:8)
Expand Down
2 changes: 1 addition & 1 deletion RPRMakie/src/meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function to_rpr_object(context, matsys, scene, plot::Makie.Surface)
end

positions = lift(grid, x, y, z, Makie.transform_func_obs(plot))
r = Tesselation(Rect2f((0, 0), (1, 1)), size(z[]))
r = Tessellation(Rect2f((0, 0), (1, 1)), size(z[]))
# decomposing a rectangle into uv and triangles is what we need to map the z coordinates on
# since the xyz data assumes the coordinates to have the same neighouring relations
# like a grid
Expand Down
8 changes: 4 additions & 4 deletions ReferenceTests/src/tests/examples3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cameracontrols(ax).settings.center[] = false # avoid recenter on display

earth = loadasset("earth.png")
m = uv_mesh(Tesselation(Sphere(Point3f(0), 1f0), 60))
m = uv_mesh(Tessellation(Sphere(Point3f(0), 1f0), 60))
mesh(f[1, 2], m, color=earth, shading=NoShading)

catmesh = loadasset("cat.obj")
Expand Down Expand Up @@ -315,16 +315,16 @@ end
N = 3; nbfacese = 30; radius = 0.02

large_sphere = Sphere(Point3f(0), 1f0)
positions = decompose(Point3f, Tesselation(large_sphere, 30))
positions = decompose(Point3f, Tessellation(large_sphere, 30))
np = length(positions)
pts = [positions[k][l] for k = 1:length(positions), l = 1:3]
pts = vcat(pts, 1.1 .* pts + RNG.randn(size(pts)) / perturbfactor) # light position influence ?
edges = hcat(collect(1:np), collect(1:np) .+ np)
ne = size(edges, 1); np = size(pts, 1)
cylinder = Cylinder(Point3f(0), Point3f(0, 0, 1.0), 1f0)
# define markers meshes
meshC = normal_mesh(Tesselation(cylinder, nbfacese))
meshS = normal_mesh(Tesselation(large_sphere, 20))
meshC = normal_mesh(Tessellation(cylinder, nbfacese))
meshS = normal_mesh(Tessellation(large_sphere, 20))
# define colors, markersizes and rotations
pG = [Point3f(pts[k, 1], pts[k, 2], pts[k, 3]) for k = 1:np]
lengthsC = sqrt.(sum((pts[edges[:,1], :] .- pts[edges[:, 2], :]).^2, dims=2))
Expand Down
2 changes: 1 addition & 1 deletion WGLMakie/src/imagelike.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function create_shader(mscene::Scene, plot::Surface)
apply_transform_and_f32_conversion(plot, f32c, grid_ps)
end
positions = Buffer(ps)
rect = lift(z -> Tesselation(Rect2(0f0, 0f0, 1f0, 1f0), size(z)), plot, pz)
rect = lift(z -> Tessellation(Rect2(0f0, 0f0, 1f0, 1f0), size(z)), plot, pz)
fs = lift(r -> decompose(QuadFace{Int}, r), plot, rect)
fs = map((ps, fs) -> filter(f -> !any(i -> (i > length(ps)) || isnan(ps[i]), f), fs), plot, ps, fs)
faces = Buffer(fs)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/plots/mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mesh(
using GeometryBasics
# Reduce quality of sphere
s = Tesselation(Sphere(Point3f(0), 1f0), 12)
s = Tessellation(Sphere(Point3f(0), 1f0), 12)
ps = coordinates(s)
fs = faces(s)
Expand Down Expand Up @@ -83,7 +83,7 @@ points = vec([Point3f(xv, yv, zv) for (xv, yv, zv) in zip(x2, y2, z2)])
# The coordinates form a matrix, so to connect neighboring vertices with a face
# we can just use the faces of a rectangle with the same dimension as the matrix:
_faces = decompose(QuadFace{GLIndex}, Tesselation(Rect(0, 0, 1, 1), size(z2)))
_faces = decompose(QuadFace{GLIndex}, Tessellation(Rect(0, 0, 1, 1), size(z2)))
# Normals of a centered sphere are easy, they're just the vertices normalized.
_normals = normalize.(points)
Expand Down
2 changes: 1 addition & 1 deletion src/basic_recipes/wireframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function plot!(plot::Wireframe{<: Tuple{<: Any, <: Any, <: AbstractMatrix}})
points = vec(Point3f.(xvector(x, M), yvector(y, N), z))
# Connect the vetices with faces, as one would use for a 2D Rectangle
# grid with M,N grid points
faces = decompose(LineFace{GLIndex}, Tesselation(Rect2(0, 0, 1, 1), (M, N)))
faces = decompose(LineFace{GLIndex}, Tessellation(Rect2(0, 0, 1, 1), (M, N)))
connect(points, faces)
end
linesegments!(plot, Attributes(plot), points_faces)
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ function surface2mesh(xs, ys, zs::AbstractMatrix, transform_func = identity, spa
ps = matrix_grid(p -> apply_transform(transform_func, p, space), xs, ys, zs)
# create valid tessellations (triangulations) for the mesh
# knowing that it is a regular grid makes this simple
rect = Tesselation(Rect2f(0, 0, 1, 1), size(zs))
rect = Tessellation(Rect2f(0, 0, 1, 1), size(zs))
# we use quad faces so that color handling is consistent
faces = decompose(QuadFace{Int}, rect)
# and remove quads that contain a NaN coordinate to avoid drawing triangles
Expand Down

0 comments on commit aab450d

Please sign in to comment.