From 9542ae893ed71a559635dfe552741a137458bf2c Mon Sep 17 00:00:00 2001 From: Frederic Freyer Date: Tue, 19 Nov 2024 12:34:01 +0100 Subject: [PATCH] Update for Makie 0.22 / GeometryBasics 0.5 (#24) * bump version * expand faceviews before creating Shape --- Project.toml | 2 +- src/highlevel-api.jl | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index f9f17d2..f1ff88b 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/highlevel-api.jl b/src/highlevel-api.jl index 950f360..31d5376 100644 --- a/src/highlevel-api.jl +++ b/src/highlevel-api.jl @@ -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 @@ -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 @@ -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) )