diff --git a/Project.toml b/Project.toml index 19d46e8..1d21d15 100644 --- a/Project.toml +++ b/Project.toml @@ -34,7 +34,7 @@ Colors = "0.9, 0.10, 0.11, 0.12" CoordinateTransformations = "0.5, 0.6" DocStringExtensions = "0.5, 0.6, 0.7, 0.8" FFMPEG = "0.2, 0.3, 0.4" -GeometryBasics = "0.3" +GeometryBasics = "0.3, 0.4" MeshIO = "0.4" Meshing = "0.5" MsgPack = "1" diff --git a/Readme.md b/Readme.md index af791c6..e69d5f9 100644 --- a/Readme.md +++ b/Readme.md @@ -71,7 +71,7 @@ settransform!(vis, Translation(-0.5, -0.5, 0)) ```julia using ColorTypes -verts = rand(Point3f0, 100_000) +verts = rand(Point3f, 100_000) colors = [RGB(p...) for p in verts] setobject!(vis, PointCloud(verts, colors)) ``` diff --git a/notebooks/demo.ipynb b/notebooks/demo.ipynb index 2f2ac79..ed849cb 100644 --- a/notebooks/demo.ipynb +++ b/notebooks/demo.ipynb @@ -440,7 +440,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "For a much more efficient point cloud, try using a vector of `StaticVector`s from StaticArrays.jl. The `Point3f0` is one such static vector:\n" + "For a much more efficient point cloud, try using a vector of `StaticVector`s from StaticArrays.jl. The `Point3f` is one such static vector:\n" ] }, { @@ -449,8 +449,8 @@ "metadata": {}, "outputs": [], "source": [ - "using GeometryBasics: Point3f0\n", - "points = rand(Point3f0, 1000000)\n", + "using GeometryBasics: Point3f\n", + "points = rand(Point3f, 1000000)\n", "setobject!(vis[:pointcloud], PointCloud(points))" ] }, diff --git a/src/MeshCat.jl b/src/MeshCat.jl index 9199e80..77c470f 100644 --- a/src/MeshCat.jl +++ b/src/MeshCat.jl @@ -14,7 +14,7 @@ using GeometryBasics: GeometryBasics, NgonFace, OffsetInteger, Point, - Point3f0, + Point3f, Polytope, SimplexFace, Vec, diff --git a/src/lowering.jl b/src/lowering.jl index 4b150e2..7c5c837 100644 --- a/src/lowering.jl +++ b/src/lowering.jl @@ -108,9 +108,9 @@ end function lower(t::Triad) attributes = Dict{String, Any}( - "position" => lower([Point3f0(0, 0, 0), Point3f0(t.scale, 0, 0), - Point3f0(0, 0, 0), Point3f0(0, t.scale, 0), - Point3f0(0, 0, 0), Point3f0(0, 0, t.scale)]), + "position" => lower([Point3f(0, 0, 0), Point3f(t.scale, 0, 0), + Point3f(0, 0, 0), Point3f(0, t.scale, 0), + Point3f(0, 0, 0), Point3f(0, 0, t.scale)]), "color" => lower([RGB{Float32}(1,0,0), RGB{Float32}(1,0.6000000238418579,0), RGB{Float32}(0,1,0), RGB{Float32}(0.6000000238418579,1,0), RGB{Float32}(0,0,1), RGB{Float32}(0,0.6000000238418579,1)]) @@ -147,7 +147,7 @@ lower(faces::Vector{<:AbstractFace}) = lower(to_zero_index.(faces)) function lower(mesh_meta::M) where {M <: AbstractMesh} mesh = metafree(mesh_meta) attributes = Dict{String, Any}( - "position" => lower(convert(Vector{Point3f0}, decompose(Point3f0, mesh))), + "position" => lower(convert(Vector{Point3f}, decompose(Point3f, mesh))), ) if M <: MeshMeta metadata = meta(mesh_meta) @@ -175,11 +175,11 @@ Fallback for everything else (like Polyhedra.jl's Polyhedron types) $(TYPEDSIGNATURES) """ lower(g::GeometryPrimitive) = lower(GeometryBasics.Mesh( - decompose(Point3f0, g), decompose(GLTriangleFace, g))) + decompose(Point3f, g), decompose(GLTriangleFace, g))) function lower(cloud::PointCloud) attributes = Dict{String, Any}( - "position" => lower(convert(Vector{Point3f0}, cloud.position)), + "position" => lower(convert(Vector{Point3f}, cloud.position)), ) if !isempty(cloud.color) attributes["color"] = lower(convert(Vector{RGB{Float32}}, cloud.color)) diff --git a/test/visualizer.jl b/test/visualizer.jl index 085d737..3a7f5f7 100644 --- a/test/visualizer.jl +++ b/test/visualizer.jl @@ -180,7 +180,7 @@ end v = vis[:points] settransform!(v, Translation(-1, 0, 0)) @testset "random points" begin - verts = rand(Point3f0, 100000); + verts = rand(Point3f, 100000); colors = reinterpret(RGB{Float32}, verts); setobject!(v[:random], PointCloud(verts, colors)) settransform!(v[:random], Translation(-0.5, -0.5, 0)) @@ -191,7 +191,7 @@ end v = vis[:points_with_material] settransform!(v, Translation(-1.5, -2.5, 0)) material = PointsMaterial(color=RGBA(0,0,1,0.5)) - cloud = PointCloud(rand(Point3f0, 5000)) + cloud = PointCloud(rand(Point3f, 5000)) obj = Object(cloud, material) @test MeshCat.threejs_type(obj) == "Points" setobject!(v, cloud, material)