Skip to content

Commit

Permalink
expand faceviews before creating Shape
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Nov 18, 2024
1 parent 725eb5b commit 8b798a6
Showing 1 changed file with 6 additions and 6 deletions.
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 8b798a6

Please sign in to comment.