Skip to content

Commit

Permalink
Merge branch 'sd/simple-mesh' into ff/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Aug 31, 2024
2 parents 9dd6d2f + 15eb932 commit 6ffd173
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ function mesh(polygon::AbstractVector{P}; pointtype=P, facetype=GLTriangleFace)
return mesh(Polygon(polygon); pointtype=pointtype, facetype=facetype)
end

# function triangle_mesh(primitive::Union{AbstractGeometry{N}, AbstractVector{<: Point{2}}})::TriangleMesh{N} where {N}
# return mesh(primitive; pointtype=Point{N, Float32})
# end
function triangle_mesh(primitive::Union{AbstractGeometry{N}, AbstractVector{<: Point{N}}})::TriangleMesh{N} where {N}
return mesh(primitive; pointtype=Point{N, Float32})
end


pointtype(x::Mesh) = eltype(decompose(Point, x))
Expand All @@ -78,14 +78,6 @@ function triangle_mesh(primitive::Mesh{N}) where {N}
end
end

function triangle_mesh(primitive::Union{AbstractGeometry{N}, AbstractVector{<: Point{N}}}; nvertices = nothing)::SimpleTriangleMesh{N} where {N}
if nvertices !== nothing
@warn("nvertices argument deprecated. Wrap primitive in `Tesselation(primitive, nvertices)`")
primitive = Tesselation(primitive, nvertices)
end
return mesh(primitive; pointtype=Point{N,Float32}, facetype=GLTriangleFace)
end

function uv_mesh(primitive::AbstractGeometry{N,T}) where {N,T}
return mesh(primitive, uv = decompose_uv(primitive), pointtype=Point{N,Float32}, facetype=GLTriangleFace)
end
Expand Down

0 comments on commit 6ffd173

Please sign in to comment.