Skip to content

Commit

Permalink
Update for Makie 0.22 / GeometryBasics 0.5 (#24)
Browse files Browse the repository at this point in the history
* bump version

* expand faceviews before creating Shape
  • Loading branch information
ffreyer authored Nov 19, 2024
1 parent 41a1f12 commit 9542ae8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RadeonProRender_jll = "e92fa02b-1b7a-5e4e-a5cb-14fe26dfc45b"
[compat]
CEnum = "0.4, 0.5"
Colors = "0.9, 0.10, 0.11, 0.12"
GeometryBasics = "0.4.1"
GeometryBasics = "0.4.1, 0.5"
RadeonProRender_jll = "=3.1.5"
julia = "1.6"

Expand Down
12 changes: 6 additions & 6 deletions src/highlevel-api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Default shape constructor which works with every Geometry from the package
GeometryTypes (Meshes and geometry primitives alike).
"""
function Shape(context::Context, meshlike; kw...)
m = uv_normal_mesh(meshlike; kw...)
m = expand_faceviews(uv_normal_mesh(meshlike; kw...))
return Shape(context, decompose(Point3f, m), decompose_normals(m), faces(m), decompose_uv(m))
end

Expand All @@ -300,7 +300,7 @@ function Shape(context::Context, vertices, normals, faces, uvs)

nraw = decompose(Vec3f, normals)
@assert eltype(nraw) == Vec3f

if isnothing(uvs)
uvraw = C_NULL
uvlength = 0
Expand All @@ -318,10 +318,10 @@ function Shape(context::Context, vertices, normals, faces, uvs)


foreach(i -> checkbounds(vertices, i + 1), iraw)
rpr_mesh = rprContextCreateMesh(context,
vraw, length(vertices), sizeof(Point3f),
nraw, length(normals), sizeof(Vec3f),
uvraw, uvlength, uvbytesize,
rpr_mesh = rprContextCreateMesh(context,
vraw, length(vertices), sizeof(Point3f),
nraw, length(normals), sizeof(Vec3f),
uvraw, uvlength, uvbytesize,
iraw, sizeof(rpr_int), iraw, sizeof(rpr_int), iraw, sizeof(rpr_int), facelens, length(faces)
)

Expand Down

0 comments on commit 9542ae8

Please sign in to comment.