Skip to content

Commit

Permalink
move PR links to end of section and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Dec 18, 2024
1 parent 7230b87 commit 532b3dd
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 21 deletions.
2 changes: 2 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ function make(f, page_folder, destination)
BonitoSites.generate_rss_feed(site_entries, rss_path; title, link, description, relative_path="./website/")
end

##
build = Blog.site_path("build")
isdir(build) && rm(build; recursive=true)
make(Blog.Page, Blog.markdown(), build)
cp(Blog.assetpath("images"), Blog.site_path("build", "images"))

##
BonitoSites.deploy(
"github.com/MakieOrg/Blog.git";
push_preview = true,
Expand Down
3 changes: 3 additions & 0 deletions docs/run-server.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd(joinpath(@__DIR__, "build"))
using LiveServer
LiveServer.serve()
2 changes: 1 addition & 1 deletion src/pages/blogposts/v0.22/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.2"
manifest_format = "2.0"
project_hash = "5c94395257ab91f018820e46d4dbb023464afeee"
project_hash = "4912ea4efa0204eb79b2a57ca1a939d41324e763"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down
2 changes: 2 additions & 0 deletions src/pages/blogposts/v0.22/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
78 changes: 58 additions & 20 deletions src/pages/blogposts/v0.22/post.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
# Makie v0.22

## GeometryBasics 0.5 ([GeometryBasics#173](https://github.com/JuliaGeometry/GeometryBasics.jl/pull/173), [GeometryBasics#219](https://github.com/JuliaGeometry/GeometryBasics.jl/pull/219), [#4319](https://github.com/MakieOrg/Makie.jl/pull/4319))
## GeometryBasics 0.5

The largest part of this release is a refactor of GeometryBasics.
The main goal was to simplify the package, both from a user perspective and a compiler perspective. Even if you don't interact with GeometryBasics directly you should see some improvements to ttfp (specifically using and first display time).

![benchmark](https://gist.githubusercontent.com/MakieBot/acb50b133a32f9e1958696b81c662d07/raw/GLMakie.svg)

[#173](https://github.com/JuliaGeometry/GeometryBasics.jl/pull/173), [#219](https://github.com/JuliaGeometry/GeometryBasics.jl/pull/219), [#4319](https://github.com/MakieOrg/Makie.jl/pull/4319)

### Removed meta

We removed the `meta` infrastructure used for per-vertex and per-face data in GeometryBasics. It generated a lot of type complexity, which you may have noticed before if you looked at the full type of a mesh. Instead a `GeometryBasics.Mesh` now simply holds a `NamedTuple` of array-like data, called `vertex_attributes`. Each array is interpreted as per-vertex data.

A (raw) GeometryBasics mesh is now constructed as:

```julia
# no-eval
# old_mesh = GeometryBasics.mesh(meta(positions, normals = normals, uv = uvs), faces)
new_mesh = GeometryBasics.mesh(positions, faces, normal = normals, uv = uvs)
```

Note as well that `normals` is now called `normal` to match `uv`

### FaceView

For per-face data, or more generally data which uses a different set of indices from other vertex attributes, we introduced the `Faceview` object. It contains some data and a vector of faces which replaces the meshes faces to index the data.

As an example let's look at the mesh generated for `Rect3f`, which wants per-face normals to avoid smooth shading across it's edges and corners. (`facetype` is only set to shorten the output a bit.)

```julia
# no-eval
julia> m = normal_mesh(Rect(0,0,0, 1,1,1), facetype = QuadFace{Int64})
Expand All @@ -32,7 +37,9 @@ Mesh{3, Float32, QuadFace{Int64}}
vertex position: 8
vertex normal: 6
```

The mesh has a different number of positions and normals. If we investigate further, we find that normals are represented by a `FaceView`.

```julia
# no-eval
julia> m.normal
Expand All @@ -44,7 +51,9 @@ FaceView{Vec{3, Float32}, Vector{Vec{3, Float32}}, Vector{QuadFace{Int64}}}:
[0.0, 0.0, -1.0]
[0.0, 0.0, 1.0]
```

The `FaceView` contains 6 normal vectors as data, which is shown above. The number of normals the mesh reports refers to them. The FaceView also contains 6 faces, which correspond to the 6 faces in the mesh.

```julia
# no-eval
julia> m.normal.faces
Expand All @@ -56,9 +65,11 @@ julia> m.normal.faces
QuadFace{Int64}(5, 5, 5, 5)
QuadFace{Int64}(6, 6, 6, 6)
```

Each of these faces refers to just one index in `m.normal.data`, making that data apply per face.

You can convert a mesh with `FaceView`s to one without by calling `expand_faceviews(mesh)`. This will directly return the mesh if it does not contain FaceViews. Otherwise it will build a new mesh without them, remapping indices and separating faces as needed.

```julia
# no-eval
julia> expand_faceviews(m)
Expand All @@ -67,13 +78,15 @@ Mesh{3, Float32, QuadFace{Int64}}
vertex position: 24
vertex normal: 24
```

To combine the per-face normals with positions, our mesh requires 3 copies of each position (one per face using that position) and 4 copies of each normal (one per vertex in the face). The are generated by `expand_faceviews(m)`.

Note that we also added a convenience function `face_normals(points, faces)` to GeometryBasics to generate a `FaceView` for per-face normals. In the docs you can also find an example of how to use `FaceView` to set per-face colors.

### MetaMesh & MeshIO ([MeshIO#98](https://github.com/JuliaIO/MeshIO.jl/pull/98), [#4368](https://github.com/MakieOrg/Makie.jl/pull/4368), [#4496](https://github.com/MakieOrg/Makie.jl/pull/4496))
### MetaMesh & MeshIO

We have introduced a `MetaMesh` type, which allows you to bundle arbitrary data with a `GeometryBasics.Mesh`. Any data (that does not correspond to vertices or faces) can be shipped with this type. It is now used by MeshIO when loading an `obj` file that includes a material template library (i.e. an .mtl file).

```julia
# no-eval
julia> using FileIO, Makie
Expand All @@ -84,9 +97,11 @@ MetaMesh{3, Float32, NgonFace{3, OffsetInteger{-1, UInt32}}}
vertex uv: 60896
meta: [:groups, :material_names, :materials]
```

The material data ends up in `m[:materials]` as a nested `Dict`, where the first key is the name of the material. The names are also listed in `m[:material_names]` in the same order they are referred to by the `.obj` file. The mesh contains a new `m.mesh.views` field, which marks the subset of faces affected by each material. `m[:groups]` is also synchronized with `m.mesh.views`, containing the group names of these faces.

Makie can directly plot a `MetaMesh` as it is constructed by `MeshIO`, applying the material properties it knows how to handle. This includes textures referred to by the mtl file.

```julia
# no-eval
using FileIO, GLMakie
Expand All @@ -95,10 +110,13 @@ f,a,p = Makie.mesh(m)
display(f)
update_cam!(a.scene, Vec3f(-15, 7, 1), Vec3f(3, 5, 0), Vec3f(0,1,0))
```

Note that Makie can currently only handle a very limited subset of the material properties an mtl file can set. As such the results may differ from what the mtl file sets and will improve in the future.

![sponza](https://gist.github.com/user-attachments/assets/af1bd4d2-59aa-440f-b29f-13c83fd751dc)

[MeshIO#98](https://github.com/JuliaIO/MeshIO.jl/pull/98), [#4368](https://github.com/MakieOrg/Makie.jl/pull/4368), [#4496](https://github.com/MakieOrg/Makie.jl/pull/4496)

## [Axis3 Controls](https://github.com/MakieOrg/Makie.jl/pull/4131)

With version 0.22 we have introduced a few new controls to Axis3:
Expand All @@ -121,27 +139,35 @@ You can center the Axis3 on the data under the cursor by pressing left alt and t

## Smaller Changes

### [Scatter marker_offset behavior change](https://github.com/MakieOrg/Makie.jl/pull/4594)
### Scatter marker_offset behavior change

In previous versions `marker_offset` was used to center scatter markers, but it could also be set by the user to specify some other offset. This was somewhat confusing as `marker_offset = Vec2f(0)` did not result in a centered marker. It also did not work with `BezierPath` markers, which have become the default.

In this release we separated the centering into an internal attribute, so that `marker_offset` is a pure user attribute. With this `marker_offset = 0` now results in the same centered marker as not specifying it would. It also now works consistently for all marker types and is no longer affected by the `rotation` attribute.
[#4594](https://github.com/MakieOrg/Makie.jl/pull/4594)

### [MeshScatter transform_marker](https://github.com/MakieOrg/Makie.jl/pull/4606)
### MeshScatter transform_marker

`Scatter` has a `transform_marker::Bool` attribute which controls whether the model matrix (i.e. `translate!()`, `rotate!()`, `zoom!()`) affects the marker. `MeshScatter` now also has this attribute. It is set to `false` by default, which changes the behavior from the previous version. Most notably this will affect the shape of meshscatter objects in an Axis3. Where previously they were scaled based on the limits of the Axis they now preserve their shape and size.

### CairoMakie ([#4606](https://github.com/MakieOrg/Makie.jl/pull/4606), [#4663](https://github.com/MakieOrg/Makie.jl/pull/4663))
[#4606](https://github.com/MakieOrg/Makie.jl/pull/4606)

### CairoMakie

We have cleaned up two rendering pipelines in CairoMakie. The first is the meshscatter/voxel/surface/mesh pipeline. It previously handled transformations incorrectly, always applying transform_func and model to (generated) mesh vertices. This is correct for `mesh` and `surface` but not `meshscatter` and `voxel`. It also didn't allow for meshes without normals.

The second is the `scatter` pipeline. It was previously built with `markerspace = :pixel` in mind, which caused various rendering issues when `markerspace != :pixel`, `transform_marker != false` and/or `rotation` was involved. These issues include silent corruption of Cairo state which causes no more plots to be drawn. These issues have now been resolved and you should get the same results from CairoMakie as you get from GLMakie and WGLMakie when these attributes are involved. (Up to some smaller differences due to perspective projection in 3D.)

| GLMakie | CairoMakie before | CairoMakie after |
| ------- | ----------------- | ---------------- |
| ![example](./images/GLMakie_transform_marker.png) | ![example](./images/CairoMakie_transform_marker_before.png) | ![example](./images/CairoMakie_transform_marker_after.png) |
| **GLMakie** | **CairoMakie before** | **CairoMakie after** |
|-------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|
| ![GLMakie](./images/GLMakie_transform_marker.png) | ![CairoMakie before](./images/CairoMakie_transform_marker_before.png) | ![CairoMakie after](./images/CairoMakie_transform_marker_after.png) |



## [Front Spines in Axis3](https://github.com/MakieOrg/Makie.jl/pull/4305)

[#4606](https://github.com/MakieOrg/Makie.jl/pull/4606), [#4663](https://github.com/MakieOrg/Makie.jl/pull/4663)

## Front Spines in Axis3

Introduces an option to close an Axis3's outline box with a new `front_spines` feature, enhancing the visualization of 3D plots by drawing the box spines in front.

Expand All @@ -155,9 +181,12 @@ mesh!(ax, brain, color = :gray80)
fig
```

## [Enable curvilinear contour plots](https://github.com/MakieOrg/Makie.jl/pull/4670)
[#4305](https://github.com/MakieOrg/Makie.jl/pull/4305)

## Enable curvilinear contour plots

Curvilinear contour plots are enabled using Contour.jl's capabilities, now supporting grids for more flexible contour visualizations:

```julia
using GLMakie
x = -10:10
Expand All @@ -172,25 +201,33 @@ ctr = contour!(ax, xs, ys, zs; color = :orange, levels = levels, labels = true,
fig
```

## [Fix Screen re-opening issue](https://github.com/MakieOrg/Makie.jl/pull/3881)
[#4670](https://github.com/MakieOrg/Makie.jl/pull/4670)

Implements screen reusability by using `empty!` instead of closing and reopening, solving a window behavior issue on Linux when reusing GLMakie's singleton screen.
## Backlog

### Fix Screen re-opening issue

Implements screen reusability by using `empty!` instead of closing and reopening, solving a window behavior issue on Linux when reusing GLMakie's singleton screen.

[#3881](https://github.com/MakieOrg/Makie.jl/pull/3881)

## Backlog - picking ([#4082](https://github.com/MakieOrg/Makie.jl/pull/4082), [#4136](https://github.com/MakieOrg/Makie.jl/pull/4136), [#4137](https://github.com/MakieOrg/Makie.jl/pull/4137), [#4459](https://github.com/MakieOrg/Makie.jl/pull/4459), [#4488](https://github.com/MakieOrg/Makie.jl/pull/4488), [#4604](https://github.com/MakieOrg/Makie.jl/pull/4604))
### Picking improvements

Since the last breaking release we had a bunch of fixes for picking in WGMakie and GLMakie.
Since the last breaking release we had a bunch of fixes for picking in WGMakie and GLMakie.
We added tests and also updated the indices produced by image, heatmap and surface to correspond to the matrix indices of the given data.

## Backlog - [Tick Event](https://github.com/MakieOrg/Makie.jl/pull/3948)
[#4082](https://github.com/MakieOrg/Makie.jl/pull/4082), [#4136](https://github.com/MakieOrg/Makie.jl/pull/4136), [#4137](https://github.com/MakieOrg/Makie.jl/pull/4137), [#4459](https://github.com/MakieOrg/Makie.jl/pull/4459), [#4488](https://github.com/MakieOrg/Makie.jl/pull/4488), [#4604](https://github.com/MakieOrg/Makie.jl/pull/4604)

### Tick Event

In version 0.21.6 we introduced a `events(fig).tick` event.
The event triggers once per frame in GLMakie, CairoMakie and `record()`, and on a timer in WGLMakie.
It can be used for anything that should happen synchronized with rendering, e.g. animation.
The tick event contains the number of frames rendered `tick.count`, the time since rendering started `tick.time` and the time since the last tick `tick.delta_time`.

## Backlog - [uv_transform](https://github.com/MakieOrg/Makie.jl/pull/1406)
[#3948](https://github.com/MakieOrg/Makie.jl/pull/3948)

### uv_transform

In version 0.21.6 we added the `uv_transform` attribute to `image`, `surface`, `mesh` and `meshscatter`.
It acts as a transformation matrix on texture coordinates similar to how model transforms coordinates.
Expand Down Expand Up @@ -227,14 +264,15 @@ meshscatter(
uv_transform = Vec2f.(z[:], 1), # scale only
marker = rect_mesh, color = texture, shading = NoShading
)

f
```

![example](./images/uv-transform.png)
[#1406](https://github.com/MakieOrg/Makie.jl/pull/1406)

## Backlog - [Line Loops](https://github.com/MakieOrg/Makie.jl/pull/3907)
### Line Loops

After reworking our line shaders in 0.21 we added code for rendering closed line loops in version 0.21.4.
If the start and end point of a line is the same and it has at least 4 points, it is detected as a loop.
In that case the line doesn't draw a linecap at the start and end point, but instead another joint, closing the loop.
In that case the line doesn't draw a linecap at the start and end point, but instead another joint, closing the loop.

[#3907](https://github.com/MakieOrg/Makie.jl/pull/3907)

0 comments on commit 532b3dd

Please sign in to comment.