Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for GeometryBasics refactor #4319

Merged
merged 58 commits into from
Oct 16, 2024
Merged

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Sep 4, 2024

Description

Requires:

Version bumps:

This is still in prototyping stage as I'm looking what things GeometryBasics is missing/should do.

TODO:

  • Makie
    • compiles
    • tests
  • get GLMakie working
  • WGLMakie
    • compiles
    • tests pass
  • CairoMakie
    • compiles
    • tests pass
  • RPRMakie
    • compiles
    • tests pass

All RPRMakie examples run with JuliaGraphics/RadeonProRender.jl#22 except for:

  • datashader-rpr (the code is broken regardless of this pr)
  • material_x.jl (crashes julia)
  • sea_cables.jl (fails to download resources)

I'm not familiar enough with RPRMakie to say they look correct with confidence, but most look good to me. I'm not sure what to make of eat_topographie_sphere.jl (that's not a sphere?) and "volume.jl", they might be wrong.

Test failures:

  • FigureSpec step 5: This pr somehow generates a more transparent marker than the refimg, which is barely transparent. The code uses (:red, 0.5), so this seems more correct to me here. I'm just confused why it's different here at all
  • Scatter with FastPixel: red outline color looks more intense in 3D (maybe color change, maybe thickness change, maybe both
  • Triplot of a constained...: a line shifted from one diagonal to the other
  • shading of catmesh changed, seams visible fixed
  • CairoMakie Merged color Mesh change but that's expected due to updates to vertex order
  • CairoMakie voxel clipping looks more odd because triangle faces have shifted orientation fixed via Cleanup voxel clipping #4397
  • CairoMakie voxels have a small shift in face intersections
  • GLMakie heatmap cells shifted a little
  • "FEM mesh 3D" is expected to fail due to vertex index merging not running on load anymore (i.e. the example no longer duplicates vertices unnecessarily and thus the color mapping changed)

Issues:

Type of change

  • Breaking change

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer
Copy link
Collaborator Author

ffreyer commented Sep 14, 2024

The refactor now makes it easier to work with per-face attributes, so I added an example to the mesh docs:

using GeometryBasics

# Reduce quality of sphere
s = Tesselation(Sphere(Point3f(0), 1f0), 12)
ps = coordinates(s)
fs = faces(s)

# Use a FaceView to with a new set of faces which refer to one color per face.
# Each face must have the same length as the respective face in fs.
# (Using the same face type guarantees this)
FT = eltype(fs); N = length(fs)
cs = FaceView(rand(RGBf, N), [FT(i) for i in 1:N])

# generate normals per face (this creates a FaceView as well)
ns = face_normals(ps, fs)

# Create mesh
m = GeometryBasics.mesh(ps, fs, normal = ns, color = cs)

mesh(m)

image

(This still requires vertex duplication, it just happens automatically now.)

Related Issues: #1369, #3624, maybe #742


# For correct z-ordering we need to be in view/camera or screen space
model = copy(primitive.model[])
model = copy(primitive.model[])::Mat4d
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems weird to copy an immutable? Not part of this PR, but still we may want to remove it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may come from my first attempt to get 3D meshes working in CairoMakie where I didn't know what kind of types to expect. I guess technically you could do plot(..., model = rand(4, 4) and pass a Base.Matrix, but iirc this errored when copy(::Mat4d) was generating a Base.Matrix anyway...

@ffreyer ffreyer mentioned this pull request Sep 22, 2024
5 tasks
@ffreyer ffreyer mentioned this pull request Oct 14, 2024
5 tasks
@ffreyer ffreyer changed the base branch from master to breaking-0.22 October 14, 2024 14:21
@ffreyer ffreyer closed this Oct 14, 2024
@ffreyer ffreyer reopened this Oct 14, 2024
@ffreyer ffreyer marked this pull request as ready for review October 15, 2024 22:53
@ffreyer ffreyer merged commit d6f9fdb into breaking-0.22 Oct 16, 2024
19 checks passed
@ffreyer ffreyer deleted the ff/GeometryBasics_refactor branch October 16, 2024 11:36
@SimonDanisch SimonDanisch restored the ff/GeometryBasics_refactor branch October 17, 2024 10:20
@EdsterG EdsterG mentioned this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking a PR with breaking changes
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Some triangles are not rendered Order of decomposes coordinates is not counter/clockwise
4 participants